| 1 | package Sisimai::Order; | ||||||||||||
| 2 | 90 | ▶ | use v5.26; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 90 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 90 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 90 | ▶ | use Sisimai::Lhost; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 3546 | ▶ | sub make { | ||||||||||
|
Subroutine
make: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||
| 8 | # Returns an MTA Order decided by the first word of the "Subject": header | ||||||||||||
| 9 | # @param [String] argv0 Subject header string | ||||||||||||
| 10 | # @return [Array] Order of MTA modules | ||||||||||||
| 11 | # @since v4.25.4 | ||||||||||||
| 12 | 3546 | my $class = shift; | |||||||||||
| 13 | 3546 | ▶ | my $argv0 = shift || return []; y/_[] / /s, s/\A[ ]+// for $argv0; | ||||||||||
|
Condition100%2/2
shift() || (return [])
MC/DC100%1/1
shift() || (return [])
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||
| 14 | 3528 | my @words = split(/[ ]/, lc($argv0), 3); | |||||||||||
| 15 | 3528 | my $first = ''; | |||||||||||
| 16 | |||||||||||||
| 17 | # The following order is decided by the first 2 words of Subject: header | ||||||||||||
| 18 | 3528 | state $subject = { | |||||||||||
| 19 | 'abuse-report' => ['Sisimai::ARF'], | ||||||||||||
| 20 | 'auto' => ['Sisimai::RFC3834'], | ||||||||||||
| 21 | 'auto-reply' => ['Sisimai::RFC3834'], | ||||||||||||
| 22 | 'automatic-reply' => ['Sisimai::RFC3834'], | ||||||||||||
| 23 | 'aws-notification' => ['Sisimai::Lhost::AmazonSES'], | ||||||||||||
| 24 | 'complaint-about' => ['Sisimai::ARF'], | ||||||||||||
| 25 | 'delivery-failure' => ['Sisimai::Lhost::Domino', 'Sisimai::Lhost::X2'], | ||||||||||||
| 26 | 'delivery-notification' => ['Sisimai::Lhost::MessagingServer'], | ||||||||||||
| 27 | 'delivery-status' => [ | ||||||||||||
| 28 | 'Sisimai::Lhost::OpenSMTPD', | ||||||||||||
| 29 | 'Sisimai::Lhost::GoogleWorkspace', | ||||||||||||
| 30 | 'Sisimai::Lhost::Gmail', | ||||||||||||
| 31 | 'Sisimai::Lhost::GoogleGroups', | ||||||||||||
| 32 | 'Sisimai::Lhost::AmazonSES', | ||||||||||||
| 33 | 'Sisimai::Lhost::X3', | ||||||||||||
| 34 | ], | ||||||||||||
| 35 | 'dmarc-ietf-dmarc' => ['Sisimai::ARF'], | ||||||||||||
| 36 | 'email-feedback' => ['Sisimai::ARF'], | ||||||||||||
| 37 | 'failed-delivery' => ['Sisimai::Lhost::X2'], | ||||||||||||
| 38 | 'failure-delivery' => ['Sisimai::Lhost::X2'], | ||||||||||||
| 39 | 'failure-notice' => ['Sisimai::Lhost::qmail', 'Sisimai::Lhost::mFILTER', 'Sisimai::Lhost::Activehunter'], | ||||||||||||
| 40 | 'loop-alert' => ['Sisimai::Lhost::FML'], | ||||||||||||
| 41 | 'mail-could' => ['Sisimai::Lhost::TrendMicro'], | ||||||||||||
| 42 | 'mail-delivery' => [ | ||||||||||||
| 43 | 'Sisimai::Lhost::Exim', | ||||||||||||
| 44 | 'Sisimai::Lhost::DragonFly', | ||||||||||||
| 45 | 'Sisimai::Lhost::GMX', | ||||||||||||
| 46 | 'Sisimai::Lhost::Zoho', | ||||||||||||
| 47 | 'Sisimai::Lhost::EinsUndEins', | ||||||||||||
| 48 | 'Sisimai::Lhost::DeutscheTelekom', | ||||||||||||
| 49 | ], | ||||||||||||
| 50 | 'mail-failed' => ['Sisimai::Lhost::DeutscheTelekom'], | ||||||||||||
| 51 | 'mail-failure' => ['Sisimai::Lhost::Exim'], | ||||||||||||
| 52 | 'mail-system' => ['Sisimai::Lhost::EZweb'], | ||||||||||||
| 53 | 'message-delivery' => ['Sisimai::Lhost::MailFoundry'], | ||||||||||||
| 54 | 'message-frozen' => ['Sisimai::Lhost::Exim'], | ||||||||||||
| 55 | 'non-recapitabile' => ['Sisimai::Lhost::Exchange2007'], | ||||||||||||
| 56 | 'non-remis' => ['Sisimai::Lhost::Exchange2007'], | ||||||||||||
| 57 | 'notice' => ['Sisimai::Lhost::Courier'], | ||||||||||||
| 58 | 'postmaster-email' => ['Sisimai::Lhost::Mimecast'], | ||||||||||||
| 59 | 'postmaster-notify' => ['Sisimai::Lhost::Sendmail'], | ||||||||||||
| 60 | 'returned-mail' => [ | ||||||||||||
| 61 | 'Sisimai::Lhost::Sendmail', | ||||||||||||
| 62 | 'Sisimai::Lhost::Biglobe', | ||||||||||||
| 63 | 'Sisimai::Lhost::V5sendmail', | ||||||||||||
| 64 | 'Sisimai::Lhost::X1', | ||||||||||||
| 65 | ], | ||||||||||||
| 66 | 'there-was' => ['Sisimai::Lhost::X6'], | ||||||||||||
| 67 | 'undeliverable' => ['Sisimai::Lhost::Exchange2007', 'Sisimai::Lhost::Exchange2003'], | ||||||||||||
| 68 | 'undeliverable-mail' => ['Sisimai::Lhost::MailMarshal', 'Sisimai::Lhost::IMailServer'], | ||||||||||||
| 69 | 'undeliverable-message' => ['Sisimai::Lhost::Notes', 'Sisimai::Lhost::Verizon'], | ||||||||||||
| 70 | 'undelivered-mail' => ['Sisimai::Lhost::Postfix', 'Sisimai::Lhost::Zoho'], | ||||||||||||
| 71 | 'warning' => ['Sisimai::Lhost::Sendmail', 'Sisimai::Lhost::Exim'], | ||||||||||||
| 72 | }; | ||||||||||||
| 73 | |||||||||||||
| 74 | 3528 | ▶ | if( rindex($words[0], ':') > 0 ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 75 | # Undeliverable: ..., notify: ... | ||||||||||||
| 76 | 206 | $first = lc substr($argv0, 0, index($argv0, ':')); | |||||||||||
| 77 | |||||||||||||
| 78 | } else { | ||||||||||||
| 79 | # Postmaster notify, returned mail, ... | ||||||||||||
| 80 | 3322 | $first = join('-', splice(@words, 0, 2)); | |||||||||||
| 81 | } | ||||||||||||
| 82 | 3528 | $first =~ y/:",*//d; | |||||||||||
| 83 | 3528 | ▶ | return $subject->{ $first } || []; | ||||||||||
|
Condition100%2/2
$subject->{$first} || []
MC/DC100%1/1
$subject->{$first} || []
$subject->{$first}
Truth table100%2/2
A
A= $subject->{$first}
| |||||||||||||
| 84 | } | ||||||||||||
| 85 | |||||||||||||
| 86 | 88 | ▶ | sub another { | ||||||||||
|
Subroutine
another: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 87 | # Make MTA modules list as a spare | ||||||||||||
| 88 | # @return [Array] Ordered module list | ||||||||||||
| 89 | # @since v4.13.1 | ||||||||||||
| 90 | |||||||||||||
| 91 | # There are another patterns in the value of "Subject:" header of a bounce mail generated by the | ||||||||||||
| 92 | # following MTA modules | ||||||||||||
| 93 | 88 | state $orderE0 = [ | |||||||||||
| 94 | 'Sisimai::Lhost::Exim', | ||||||||||||
| 95 | 'Sisimai::Lhost::Sendmail', | ||||||||||||
| 96 | 'Sisimai::Lhost::Exchange2007', | ||||||||||||
| 97 | 'Sisimai::Lhost::Exchange2003', | ||||||||||||
| 98 | 'Sisimai::Lhost::AmazonSES', | ||||||||||||
| 99 | 'Sisimai::Lhost::TrendMicro', | ||||||||||||
| 100 | 'Sisimai::Lhost::DeutscheTelekom', | ||||||||||||
| 101 | 'Sisimai::Lhost::KDDI', | ||||||||||||
| 102 | 'Sisimai::Lhost::FML', | ||||||||||||
| 103 | 'Sisimai::Lhost::Verizon', | ||||||||||||
| 104 | 'Sisimai::Lhost::ApacheJames', | ||||||||||||
| 105 | 'Sisimai::Lhost::X2', | ||||||||||||
| 106 | ]; | ||||||||||||
| 107 | |||||||||||||
| 108 | # Fallback list: The following MTA/ESP modules is not listed orderE0 | ||||||||||||
| 109 | 88 | state $orderE1 = [ | |||||||||||
| 110 | 'Sisimai::Lhost::Postfix', | ||||||||||||
| 111 | 'Sisimai::Lhost::OpenSMTPD', | ||||||||||||
| 112 | 'Sisimai::Lhost::qmail', | ||||||||||||
| 113 | 'Sisimai::Lhost::Courier', | ||||||||||||
| 114 | 'Sisimai::Lhost::MessagingServer', | ||||||||||||
| 115 | 'Sisimai::Lhost::GoogleWorkspace', | ||||||||||||
| 116 | 'Sisimai::Lhost::Gmail', | ||||||||||||
| 117 | 'Sisimai::Lhost::GMX', | ||||||||||||
| 118 | 'Sisimai::Lhost::Zoho', | ||||||||||||
| 119 | 'Sisimai::Lhost::Domino', | ||||||||||||
| 120 | 'Sisimai::Lhost::Notes', | ||||||||||||
| 121 | 'Sisimai::Lhost::IMailServer', | ||||||||||||
| 122 | 'Sisimai::Lhost::mFILTER', | ||||||||||||
| 123 | 'Sisimai::Lhost::Activehunter', | ||||||||||||
| 124 | 'Sisimai::Lhost::MailFoundry', | ||||||||||||
| 125 | 'Sisimai::Lhost::GoogleGroups', | ||||||||||||
| 126 | 'Sisimai::Lhost::MailMarshal', | ||||||||||||
| 127 | 'Sisimai::Lhost::V5sendmail', | ||||||||||||
| 128 | 'Sisimai::Lhost::EZweb', | ||||||||||||
| 129 | 'Sisimai::Lhost::Biglobe', | ||||||||||||
| 130 | 'Sisimai::Lhost::EinsUndEins', | ||||||||||||
| 131 | 'Sisimai::Lhost::DragonFly', | ||||||||||||
| 132 | 'Sisimai::Lhost::X1', | ||||||||||||
| 133 | 'Sisimai::Lhost::X3', | ||||||||||||
| 134 | 'Sisimai::Lhost::X6', | ||||||||||||
| 135 | ]; | ||||||||||||
| 136 | 88 | return [@$orderE0, @$orderE1]; | |||||||||||
| 137 | }; | ||||||||||||
| 138 | |||||||||||||
| 139 | 90 | 1; | |||||||||||
| 140 | __END__ | ||||||||||||