diff --git a/lib/Sisimai/Lhost/Postfix.pm b/lib/Sisimai/Lhost/Postfix.pm index 85c4b2d64..d2d312db9 100644 --- a/lib/Sisimai/Lhost/Postfix.pm +++ b/lib/Sisimai/Lhost/Postfix.pm @@ -113,8 +113,7 @@ sub make { # The mail system # # : host mx.example.co.jp[192.0.2.153] said: 550 - # 5.1.1 ... User Unknown (in reply to RCPT TO - # command) + # 5.1.1 ... User Unknown (in reply to RCPT TO command) if( index($p, 'Diagnostic-Code:') == 0 && $e =~ /\A[ \t]+(.+)\z/ ) { # Continued line of the value of Diagnostic-Code header $v->{'diagnosis'} .= ' '.$1; @@ -126,16 +125,12 @@ sub make { } else { # Alternative error message and recipient - if( $e =~ /[ \t][(]in reply to ([A-Z]{4}).*/ ) { + if( $e =~ /[ \t][(]in reply to (?:end of )?([A-Z]{4}).*/ || + $e =~ /([A-Z]{4})[ \t]*.*command[)]\z/ ) { # 5.1.1 ... User Unknown (in reply to RCPT TO push @commandset, $1; $anotherset->{'diagnosis'} .= ' '.$e if $anotherset->{'diagnosis'}; - } elsif( $e =~ /([A-Z]{4})[ \t]*.*command[)]\z/ ) { - # to MAIL command) - push @commandset, $1; - $anotherset->{'diagnosis'} .= ' '.$e if $anotherset->{'diagnosis'}; - } elsif( $e =~ /\A[<]([^ ]+[@][^ ]+)[>] [(]expanded from [<](.+)[>][)]:[ \t]*(.+)\z/ ) { # (expanded from ): user ... $anotherset->{'recipient'} = $1; diff --git a/lib/Sisimai/Reason/PolicyViolation.pm b/lib/Sisimai/Reason/PolicyViolation.pm index 954c32bb9..b10fc7837 100644 --- a/lib/Sisimai/Reason/PolicyViolation.pm +++ b/lib/Sisimai/Reason/PolicyViolation.pm @@ -19,6 +19,7 @@ sub match { 'because the recipient is not accepting mail with ', # AOL Phoenix 'closed mailing list', 'denied by policy', + 'dmarc policy', 'email not accepted for policy reasons', # http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#554 'email rejected due to security policies', @@ -103,7 +104,7 @@ azumakuniyuki =head1 COPYRIGHT -Copyright (C) 2017-2019 azumakuniyuki, All rights reserved. +Copyright (C) 2017-2020 azumakuniyuki, All rights reserved. =head1 LICENSE diff --git a/lib/Sisimai/Rhost/GoogleApps.pm b/lib/Sisimai/Rhost/GoogleApps.pm index 00b3e6ea0..c53d91d7d 100644 --- a/lib/Sisimai/Rhost/GoogleApps.pm +++ b/lib/Sisimai/Rhost/GoogleApps.pm @@ -98,7 +98,10 @@ sub get { 'Messages with multiple addresses in From: header are not accepted.', 'The user or domain that you are sending to (or from) has a policy', ]}, - { 'reason' => 'rejected', 'string' => ['Unauthenticated email is not accepted from this domain.'] }, + { 'reason' => 'rejected', 'string' => [ + 'This message does not have authentication information or fails to pass authentication checks', + 'Unauthenticated email is not accepted from this domain.' + ] }, ], 'X.7.4' => [{ 'reason' => 'syntaxerror', 'string' => ['Unrecognized Authentication Type.'] }], }; diff --git a/set-of-emails/maildir/bsd/lhost-postfix-66.eml b/set-of-emails/maildir/bsd/lhost-postfix-66.eml new file mode 100644 index 000000000..96c3099b3 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-66.eml @@ -0,0 +1,80 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.48]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0mYaG000334 + for ; Fri, 13 Nov 2020 09:48:34 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKb61hkLz22xZY + for ; Fri, 13 Nov 2020 09:48:34 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.113]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKb61FPyz1yM4D + for ; Fri, 13 Nov 2020 09:48:34 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id 056C3D244EC; Fri, 13 Nov 2020 09:48:34 +0900 (JST) +Date: Fri, 13 Nov 2020 09:48:34 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="08513C0196A.1605228514/smtp.example.jp" +Message-Id: <20201113004834.056C3D244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--08513C0196A.1605228514/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + + : host mx-aol.mail.gm0.yahoodns.net[67.195.204.80] said: + 554 5.7.9 Message not accepted for policy reasons. See + https://postmaster.verizonmedia.com/error-codes (in reply to end of DATA + command) + +--08513C0196A.1605228514/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: 08513C0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:47:59 +0900 (JST) + +Final-Recipient: rfc822; kijitora@aol.example.jp +Original-Recipient: rfc822;kijitora@aol.example.jp +Action: failed +Status: 5.7.9 +Remote-MTA: dns; mx-aol.mail.gm0.yahoodns.net +Diagnostic-Code: smtp; 554 5.7.9 Message not accepted for policy reasons. See + https://postmaster.verizonmedia.com/error-codes + +--08513C0196A.1605228514/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id 08513C0196A + for ; Fri, 13 Nov 2020 09:47:59 +0900 (JST) +From: postmaster@libsisimai.org +Subject: TEST FOR DMARC #7 +To: kijitora@aol.example.jp +Message-Id: <20201113004812.08513C0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:47:59 +0900 (JST) + +Nyaan + +--08513C0196A.1605228514/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-postfix-67.eml b/set-of-emails/maildir/bsd/lhost-postfix-67.eml new file mode 100644 index 000000000..54efe29fa --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-67.eml @@ -0,0 +1,80 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.48]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0ngL7000414 + for ; Fri, 13 Nov 2020 09:49:43 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKcQ60rGz22xZY + for ; Fri, 13 Nov 2020 09:49:42 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.113]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKcQ5YPpz1yM4D + for ; Fri, 13 Nov 2020 09:49:42 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id ADEACD244EC; Fri, 13 Nov 2020 09:49:42 +0900 (JST) +Date: Fri, 13 Nov 2020 09:49:42 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="B5693C0196A.1605228582/smtp.example.jp" +Message-Id: <20201113004942.ADEACD244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--B5693C0196A.1605228582/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + +: host mx-aol.mail.gm0.yahoodns.net[67.195.228.84] said: + 554 5.7.9 Message not accepted for policy reasons. See + https://postmaster.verizonmedia.com/error-codes (in reply to end of DATA + command) + +--B5693C0196A.1605228582/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: B5693C0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:49:11 +0900 (JST) + +Final-Recipient: rfc822; kijitora@aol.example.jp +Original-Recipient: rfc822;kijitora@aol.example.jp +Action: failed +Status: 5.7.9 +Remote-MTA: dns; mx-aol.mail.gm0.yahoodns.net +Diagnostic-Code: smtp; 554 5.7.9 Message not accepted for policy reasons. See + https://postmaster.verizonmedia.com/error-codes + +--B5693C0196A.1605228582/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127,0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id B5693C0196A + for ; Fri, 13 Nov 2020 09:49:11 +0900 (JST) +Subject: TEST FOR DMARC #8 +From: postmaster@libsisimai.org +To: kijitora@aol.example.jp +Message-Id: <20201113004922.B5693C0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:49:11 +0900 (JST) + +Nyaan + +--B5693C0196A.1605228582/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-postfix-68.eml b/set-of-emails/maildir/bsd/lhost-postfix-68.eml new file mode 100644 index 000000000..334c68b18 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-68.eml @@ -0,0 +1,82 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.48]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0ifMd032580 + for ; Fri, 13 Nov 2020 09:44:41 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKVd39fRz22xZY + for ; Fri, 13 Nov 2020 09:44:41 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.113]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKVd2kxmz1yM4D + for ; Fri, 13 Nov 2020 09:44:41 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id 3101DD244EC; Fri, 13 Nov 2020 09:44:41 +0900 (JST) +Date: Fri, 13 Nov 2020 09:44:41 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="48C62C0196A.1605228281/smtp.example.jp" +Message-Id: <20201113004441.3101DD244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--48C62C0196A.1605228281/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + +: host mx2.mail.yahoo.co.jp[202.93.66.118] said: 554 + Message not allowed - 554 Message not allowed - DM Email not accepted for + policy reasons. Please visit + https://www.yahoo-help.jp/app/answers/detail/a_id/80870/p/622 [895] (in + reply to end of DATA command) + +--48C62C0196A.1605228281/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: 48C62C0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:44:12 +0900 (JST) + +Final-Recipient: rfc822; kijitora@yahoo.example.co.jp +Original-Recipient: rfc822;kijitora@yahoo.example.co.jp +Action: failed +Status: 5.0.0 +Remote-MTA: dns; mx2.mail.yahoo.co.jp +Diagnostic-Code: smtp; 554 Message not allowed - 554 Message not allowed - DM + Email not accepted for policy reasons. Please visit + https://www.yahoo-help.jp/app/answers/detail/a_id/80870/p/622 [895] + +--48C62C0196A.1605228281/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id 48C62C0196A + for ; Fri, 13 Nov 2020 09:44:12 +0900 (JST) +Subject: TEST FOR DMARC #3 +From: postmaster@libsisimai.org +To: kijitora@yahoo.example.co.jp +Message-Id: <20201113004420.48C62C0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:44:12 +0900 (JST) + +Nyaan + +--48C62C0196A.1605228281/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-postfix-69.eml b/set-of-emails/maildir/bsd/lhost-postfix-69.eml new file mode 100644 index 000000000..45a4b453e --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-69.eml @@ -0,0 +1,80 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.48]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0i4HY032532 + for ; Fri, 13 Nov 2020 09:44:04 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKTw02Xtz22xZY + for ; Fri, 13 Nov 2020 09:44:04 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.113]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKTv6hp1z1yM4D + for ; Fri, 13 Nov 2020 09:44:03 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id A4D0FD244EC; Fri, 13 Nov 2020 09:44:03 +0900 (JST) +Date: Fri, 13 Nov 2020 09:44:03 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="2041FC0196A.1605228243/smtp.example.jp" +Message-Id: <20201113004403.A4D0FD244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--2041FC0196A.1605228243/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + +: host mta5.am0.yahoodns.net[67.195.204.73] said: 554 + 5.7.9 Message not accepted for policy reasons. See + https://postmaster.verizonmedia.com/error-codes (in reply to end of DATA + command) + +--2041FC0196A.1605228243/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: 2041FC0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:43:26 +0900 (JST) + +Final-Recipient: rfc822; kijitora@yahoo.example.com +Original-Recipient: rfc822;kijitora@yahoo.example.com +Action: failed +Status: 5.7.9 +Remote-MTA: dns; mta5.am0.yahoodns.net +Diagnostic-Code: smtp; 554 5.7.9 Message not accepted for policy reasons. See + https://postmaster.verizonmedia.com/error-codes + +--2041FC0196A.1605228243/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id 2041FC0196A + for ; Fri, 13 Nov 2020 09:43:26 +0900 (JST) +Subject: TEST FOR DMARC #2 +From: postmaster@libsisimai.org +To: kijitora@yahoo.example.com +Message-Id: <20201113004335.2041FC0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:43:26 +0900 (JST) + +Nyaan + +--2041FC0196A.1605228243/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-postfix-70.eml b/set-of-emails/maildir/bsd/lhost-postfix-70.eml new file mode 100644 index 000000000..352914325 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-70.eml @@ -0,0 +1,87 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.25]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0hCh1032498 + for ; Fri, 13 Nov 2020 09:43:12 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKSw1zdgz22xZY + for ; Fri, 13 Nov 2020 09:43:12 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.127]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKSw1C1Mz1yM4D + for ; Fri, 13 Nov 2020 09:43:12 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id 06AD3D244EC; Fri, 13 Nov 2020 09:43:12 +0900 (JST) +Date: Fri, 13 Nov 2020 09:43:12 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="AF578C0196A.1605228192/smtp.example.jp" +Message-Id: <20201113004312.06AD3D244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--AF578C0196A.1605228192/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + +: host gmail-smtp-in.l.google.com[64.233.189.27] said: + 550-5.7.26 Unauthenticated email from libsisimai.org is not accepted due to + 550-5.7.26 domain's DMARC policy. Please contact the administrator of + 550-5.7.26 libsisimai.org domain if this was a legitimate mail. Please + visit 550-5.7.26 https://support.google.com/mail/answer/2451690 to learn + about the 550 5.7.26 DMARC initiative. z2si1584129pfn.61 - gsmtp (in reply + to end of DATA command) + +--AF578C0196A.1605228192/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: AF578C0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:42:35 +0900 (JST) + +Final-Recipient: rfc822; kijitora@google.example.com +Original-Recipient: rfc822;kijitora@google.example.com +Action: failed +Status: 5.7.26 +Remote-MTA: dns; gmail-smtp-in.l.google.com +Diagnostic-Code: smtp; 550-5.7.26 Unauthenticated email from libsisimai.org is + not accepted due to 550-5.7.26 domain's DMARC policy. Please contact the + administrator of 550-5.7.26 libsisimai.org domain if this was a legitimate + mail. Please visit 550-5.7.26 + https://support.google.com/mail/answer/2451690 to learn about the 550 + 5.7.26 DMARC initiative. z2si1584129pfn.61 - gsmtp + +--AF578C0196A.1605228192/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id AF578C0196A + for ; Fri, 13 Nov 2020 09:42:35 +0900 (JST) +Subject: TEST FOR DMARC #1 +From: postmaster@libsisimai.org +To: kijitora@google.example.com +Message-Id: <20201113004243.AF578C0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:42:35 +0900 (JST) + +Nyaan + +--AF578C0196A.1605228192/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-postfix-71.eml b/set-of-emails/maildir/bsd/lhost-postfix-71.eml new file mode 100644 index 000000000..98de8bb6f --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-71.eml @@ -0,0 +1,81 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.25]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0lpdN032754 + for ; Fri, 13 Nov 2020 09:47:51 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKZH4NX1z22xZY + for ; Fri, 13 Nov 2020 09:47:51 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.127]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKZH3xdDz1yM4D + for ; Fri, 13 Nov 2020 09:47:51 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id 7344BD244EC; Fri, 13 Nov 2020 09:47:51 +0900 (JST) +Date: Fri, 13 Nov 2020 09:47:51 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="3574FC0196A.1605228471/smtp.example.jp" +Message-Id: <20201113004751.7344BD244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--3574FC0196A.1605228471/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + +: host mx01.mail.icloud.com[17.57.152.9] said: 554 + 5.7.1 Your message was rejected due to libsisimai.org's DMARC policy. See + https://support.apple.com/en-us/HT204137 for info (in reply to end of DATA + command) + +--3574FC0196A.1605228471/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: 3574FC0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:47:12 +0900 (JST) + +Final-Recipient: rfc822; kijitora@apple.example.com +Original-Recipient: rfc822;kijitora@apple.example.com +Action: failed +Status: 5.7.1 +Remote-MTA: dns; mx01.mail.icloud.com +Diagnostic-Code: smtp; 554 5.7.1 Your message was rejected due to + libsisimai.org's DMARC policy. See https://support.apple.com/en-us/HT204137 + for info + +--3574FC0196A.1605228471/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id 3574FC0196A + for ; Fri, 13 Nov 2020 09:47:12 +0900 (JST) +Subject: TEST FOR DMARC #6 +From: postmaster@libsisimai.org +To: kijitora@apple.example.com +Message-Id: <20201113004724.3574FC0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:47:12 +0900 (JST) + +Nyaan + +--3574FC0196A.1605228471/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-postfix-72.eml b/set-of-emails/maildir/bsd/lhost-postfix-72.eml new file mode 100644 index 000000000..d70692238 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-72.eml @@ -0,0 +1,81 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.25]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0oeJ2000466 + for ; Fri, 13 Nov 2020 09:50:40 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKdX2gnRz22xZY + for ; Fri, 13 Nov 2020 09:50:40 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.127]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKdX2DNcz1yM4D + for ; Fri, 13 Nov 2020 09:50:40 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id 36B85D244EC; Fri, 13 Nov 2020 09:50:40 +0900 (JST) +Date: Fri, 13 Nov 2020 09:50:40 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="61B70C0196A.1605228640/smtp.example.jp" +Message-Id: <20201113005040.36B85D244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--61B70C0196A.1605228640/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + +: host mxs.mail.ru[94.100.180.31] said: 550 5.7.1 This + message was not accepted due to domain (libsisimai.org) owner DMARC policy + (RFC 7489) https://help.mail.ru/mail-help/postmaster/dmarc (in reply to end + of DATA command) + +--61B70C0196A.1605228640/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: 61B70C0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:49:56 +0900 (JST) + +Final-Recipient: rfc822; kijitora@mail.example.ru +Original-Recipient: rfc822;kijitora@mail.example.ru +Action: failed +Status: 5.7.1 +Remote-MTA: dns; mxs.mail.ru +Diagnostic-Code: smtp; 550 5.7.1 This message was not accepted due to domain + (libsisimai.org) owner DMARC policy (RFC 7489) + https://help.mail.ru/mail-help/postmaster/dmarc + +--61B70C0196A.1605228640/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id 61B70C0196A + for ; Fri, 13 Nov 2020 09:49:56 +0900 (JST) +Subject: TEST FOR DMARC #9 +From: postmaster@libsisimai.org +To: kijitora@mail.example.ru +Message-Id: <20201113005007.61B70C0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:49:56 +0900 (JST) + +Nyaan + +--61B70C0196A.1605228640/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-postfix-73.eml b/set-of-emails/maildir/bsd/lhost-postfix-73.eml new file mode 100644 index 000000000..5a5d46664 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-73.eml @@ -0,0 +1,79 @@ +Return-Path: <> +Received: from mbox.example.jp (mail.example.jp [192.0.2.25]) + by mx.example.jp (V8/cf) with ESMTP id 0AD0pNap000537 + for ; Fri, 13 Nov 2020 09:51:23 +0900 +Received: from mbox.example.jp (localhost [127.0.0.1]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKfM39Nrz22xZY + for ; Fri, 13 Nov 2020 09:51:23 +0900 (JST) +Received: from smtp.example.jp (smtp.example.jp [203.0.113.127]) + by mbox.example.jp (Postfix) with ESMTP id 4CXKfM2k8Fz1yM4D + for ; Fri, 13 Nov 2020 09:51:23 +0900 (JST) +Received: by smtp.example.jp (Postfix) + id 4DE07D244EC; Fri, 13 Nov 2020 09:51:23 +0900 (JST) +Date: Fri, 13 Nov 2020 09:51:23 +0900 (JST) +From: MAILER-DAEMON@smtp.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: postmaster@sisimai.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="C146BC0196A.1605228683/smtp.example.jp" +Message-Id: <20201113005123.4DE07D244EC@smtp.example.jp> +X-Virus-Scanned: ClamAV using ClamSMTP + +This is a MIME-encapsulated message. + +--C146BC0196A.1605228683/smtp.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host smtp.example.jp. + +I'm sorry to have to inform you that your message could not +be delivered to one or more recipients. It's attached below. + +For further assistance, please send mail to postmaster. + +If you do so, please include this problem report. You can +delete your own text from the attached returned message. + + The mail system + +: host smtpin.zoho.com[136.143.191.23] said: 550 5.7.1 + Email rejected per DMARC policy for libsisimai.org (in reply to end of DATA + command) + +--C146BC0196A.1605228683/smtp.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; smtp.example.jp +X-Postfix-Queue-ID: C146BC0196A +X-Postfix-Sender: rfc822; postmaster@sisimai.example.com +Arrival-Date: Fri, 13 Nov 2020 09:50:49 +0900 (JST) + +Final-Recipient: rfc822; kijitora@zoho.example.com +Original-Recipient: rfc822;kijitora@zoho.example.com +Action: failed +Status: 5.7.1 +Remote-MTA: dns; smtpin.zoho.com +Diagnostic-Code: smtp; 550 5.7.1 Email rejected per DMARC policy for + libsisimai.org + +--C146BC0196A.1605228683/smtp.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from [127.0.0.1] (localhost [127.0.0.1]) + by smtp.example.jp (Postfix) with ESMTP id C146BC0196A + for ; Fri, 13 Nov 2020 09:50:49 +0900 (JST) +Subject: TEST FOR DMARC #10 +From: postmaster@libsisimai.org +To: kijitora@zoho.example.com +Message-Id: <20201113005058.C146BC0196A@smtp.example.jp> +Date: Fri, 13 Nov 2020 09:50:49 +0900 (JST) + +Nyaan + +--C146BC0196A.1605228683/smtp.example.jp-- diff --git a/set-of-emails/maildir/bsd/lhost-sendmail-58.eml b/set-of-emails/maildir/bsd/lhost-sendmail-58.eml new file mode 100644 index 000000000..5d99adf05 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-sendmail-58.eml @@ -0,0 +1,70 @@ +Return-Path: +Received: from localhost (localhost) + by mx2.example.jp (V8/cf) id x8U5fjWf022128; + Mon, 30 Sep 2019 14:42:27 +0900 +Date: Mon, 30 Sep 2019 14:42:27 +0900 +From: Mail Delivery Subsystem +Message-Id: <201909300542.x8U5fjWf022128@mx2.example.jp> +To: postmaster +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="x8U5fjWf022128.1569822147/mx2.example.jp" +Subject: Postmaster notify: see transcript for details +Auto-Submitted: auto-generated (postmaster-notification) + +This is a MIME-encapsulated message + +--x8U5fjWf022128.1569822147/mx2.example.jp + +The original message was received at Mon, 30 Sep 2019 14:41:41 +0900 +from no.rdns.hostshield.net [178.159.7.4] (may be forged) +with id x8U5feWe022126 + + ----- The following addresses had permanent fatal errors ----- +kijitora+neko-nyaan@google.example.com + (reason: 550-5.7.1 Unauthenticated email from cpanel.com is not accepted due to domain's) + (expanded from: neko.nyaan.jp) + + ----- Transcript of session follows ----- +... while talking to gmail-smtp-in.l.google.com.: +>>> DATA +<<< 550-5.7.1 Unauthenticated email from cpanel.com is not accepted due to domain's +<<< 550-5.7.1 DMARC policy. Please contact the administrator of cpanel.com domain +<<< 550-5.7.1 if this was a legitimate mail. Please visit +<<< 550-5.7.1 https://support.google.com/mail/answer/2451690 to learn about the +<<< 550 5.7.1 DMARC initiative. y13si1773519pll.31 - gsmtp +554 5.0.0 Service unavailable + +--x8U5fjWf022128.1569822147/mx2.example.jp +Content-Type: message/delivery-status + +Reporting-MTA: dns; mx2.example.jp +Received-From-MTA: DNS; no.rdns.hostshield.net +Arrival-Date: Mon, 30 Sep 2019 14:41:41 +0900 + +Final-Recipient: RFC822; info@example.jp +X-Actual-Recipient: RFC822; kijitora+neko-nyaan@google.example.com +Action: failed +Status: 5.7.1 +Remote-MTA: DNS; gmail-smtp-in.l.google.com +Diagnostic-Code: SMTP; 550-5.7.1 Unauthenticated email from cpanel.com is not accepted due to domain's +Last-Attempt-Date: Mon, 30 Sep 2019 14:41:45 +0900 + +--x8U5fjWf022128.1569822147/mx2.example.jp +Content-Type: text/rfc822-headers + +Return-Path: +Received: from cpanel.com (no.rdns.hostshield.net [178.159.7.4] (may be forged)) + by mx2.example.jp (V8/cf) with ESMTP id x8U5feWe022126 + for ; Mon, 30 Sep 2019 14:41:41 +0900 +From: cPanel +To: info@example.jp +Subject: Suspension : Removal of cubicroot.jp from our server +Date: 29 Sep 2019 22:41:32 -0700 +Message-ID: <20190929224104.0E998710D86830E8@cpanel.com> +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_NextPart_000_0012_E69873DD.5248EBCF" + +--x8U5fjWf022128.1569822147/mx2.example.jp-- + diff --git a/set-of-emails/maildir/bsd/lhost-sendmail-59.eml b/set-of-emails/maildir/bsd/lhost-sendmail-59.eml new file mode 100644 index 000000000..67a78f0e0 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-sendmail-59.eml @@ -0,0 +1,68 @@ +Return-Path: +Received: from localhost (localhost) + by mx.example.jp (V8/cf) id x15GrRRK009751; + Wed, 6 Feb 2019 01:55:36 +0900 +Date: Wed, 6 Feb 2019 01:55:36 +0900 +From: Mail Delivery Subsystem +Message-Id: <201902051655.x15GrRRK009751@mx.example.jp> +To: postmaster +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="x15GrRRK009751.1549385736/mx.example.jp" +Subject: Postmaster notify: see transcript for details +Auto-Submitted: auto-generated (postmaster-notification) + +This is a MIME-encapsulated message + +--x15GrRRK009751.1549385736/mx.example.jp + +The original message was received at Wed, 6 Feb 2019 01:42:26 +0900 +from [62.4.57.226] +with id x15GgPm9009702 + + ----- The following addresses had permanent fatal errors ----- +kijitora+example.jp@google.example.com + (reason: 550-5.7.1 This message does not have authentication information or fails to pass) + (expanded from: neko.example.jp) + + ----- Transcript of session follows ----- +... while talking to gmail-smtp-in.l.google.com.: +>>> DATA +<<< 550-5.7.1 This message does not have authentication information or fails to pass +<<< 550-5.7.1 authentication checks. To best protect our users from spam, the +<<< 550-5.7.1 message has been blocked. Please visit +<<< 550-5.7.1 https://support.google.com/mail/answer/81126#authentication for more +<<< 550 5.7.1 information. 37si3479471pgw.590 - gsmtp +554 5.0.0 Service unavailable + +--x15GrRRK009751.1549385736/mx.example.jp +Content-Type: message/delivery-status + +Reporting-MTA: dns; mx.example.jp +Arrival-Date: Wed, 6 Feb 2019 01:42:26 +0900 + +Final-Recipient: RFC822; info@example.jp +X-Actual-Recipient: RFC822; kijitora+example.jp@google.example.com +Action: failed +Status: 5.7.1 +Remote-MTA: DNS; gmail-smtp-in.l.google.com +Diagnostic-Code: SMTP; 550-5.7.1 This message does not have authentication information or fails to pass +Last-Attempt-Date: Wed, 6 Feb 2019 01:53:29 +0900 + +--x15GrRRK009751.1549385736/mx.example.jp +Content-Type: text/rfc822-headers + +Return-Path: +Received: from lh71.143.2.199.talksite.com ([62.4.57.226]) + by mx.example.jp (V8/cf) with ESMTP id x15GgPm9009702 + for ; Wed, 6 Feb 2019 01:42:26 +0900 +Message-Id: <201902051642.x15GgPm9009702@mx.example.jp> +From: "European Permit" +Subject: European Residence Permit in 2019 +To: "info" +Content-Type: multipart/alternative; boundary="6YEfpD2Iag=_BYxOCMb3twznLqotKNyJfW" +MIME-Version: 1.0 +Date: Tue, 5 Feb 2019 17:42:24 +0100 + +--x15GrRRK009751.1549385736/mx.example.jp-- + diff --git a/t/022-mail-maildir.t b/t/022-mail-maildir.t index 6eb218b3e..a39b73c76 100644 --- a/t/022-mail-maildir.t +++ b/t/022-mail-maildir.t @@ -8,7 +8,7 @@ my $MethodNames = { 'class' => ['new'], 'object' => ['path', 'dir', 'file', 'size', 'offset', 'handle', 'read'], }; -my $MaildirSize = 492; +my $MaildirSize = 502; my $SampleEmail = './set-of-emails/maildir/bsd'; my $NewInstance = $PackageName->new($SampleEmail); diff --git a/t/640-lhost-postfix.t b/t/640-lhost-postfix.t index 85b0c4fd6..7cc3a981f 100644 --- a/t/640-lhost-postfix.t +++ b/t/640-lhost-postfix.t @@ -61,6 +61,14 @@ my $isexpected = [ { 'n' => '63', 's' => qr/\A5[.]2[.]2\z/, 'r' => qr/mailboxfull/,'b' => qr/\A1\z/ }, { 'n' => '64', 's' => qr/\A5[.]0[.]\d+\z/, 'r' => qr/undefined/, 'b' => qr/\A1\z/ }, { 'n' => '65', 's' => qr/\A5[.]0[.]0\z/, 'r' => qr/securityerror/,'b' => qr/\A1\z/ }, + { 'n' => '66', 's' => qr/\A5[.]7[.]9\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, + { 'n' => '67', 's' => qr/\A5[.]7[.]9\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, + { 'n' => '68', 's' => qr/\A5[.]0[.]0\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, + { 'n' => '69', 's' => qr/\A5[.]7[.]9\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, + { 'n' => '70', 's' => qr/\A5[.]7[.]26\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, + { 'n' => '71', 's' => qr/\A5[.]7[.]1\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, + { 'n' => '72', 's' => qr/\A5[.]7[.]1\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, + { 'n' => '73', 's' => qr/\A5[.]7[.]1\z/, 'r' => qr/policyviolation/,'b' => qr/\A1\z/ }, ]; $enginetest->($enginename, $isexpected); diff --git a/t/644-lhost-sendmail.t b/t/644-lhost-sendmail.t index 3cab6a294..3b4f2abef 100644 --- a/t/644-lhost-sendmail.t +++ b/t/644-lhost-sendmail.t @@ -63,6 +63,8 @@ my $isexpected = [ { 'n' => '55', 's' => qr/\A4[.]5[.]0\z/, 'r' => qr/mailererror/, 'b' => qr/\A1\z/ }, { 'n' => '56', 's' => qr/\A5[.]5[.]0\z/, 'r' => qr/blocked/, 'b' => qr/\A1\z/ }, { 'n' => '57', 's' => qr/\A5[.]7[.]27\z/, 'r' => qr/notaccept/, 'b' => qr/\A0\z/ }, + { 'n' => '58', 's' => qr/\A5[.]7[.]1\z/, 'r' => qr/policyviolation/, 'b' => qr/\A1\z/ }, + { 'n' => '59', 's' => qr/\A5[.]7[.]1\z/, 'r' => qr/rejected/, 'b' => qr/\A1\z/ }, ]; $enginetest->($enginename, $isexpected); diff --git a/xt/640-lhost-postfix.t b/xt/640-lhost-postfix.t index 7486f48b8..4b714000c 100644 --- a/xt/640-lhost-postfix.t +++ b/xt/640-lhost-postfix.t @@ -209,7 +209,7 @@ my $isexpected = [ { 'n' => '01199', 'r' => qr/toomanyconn/ }, { 'n' => '01200', 'r' => qr/blocked/ }, { 'n' => '01201', 'r' => qr/blocked/ }, - { 'n' => '01202', 'r' => qr/policyviolation/ }, + { 'n' => '01202', 'r' => qr/policyviolation/}, { 'n' => '01203', 'r' => qr/suspend/ }, { 'n' => '01204', 'r' => qr/syntaxerror/ }, { 'n' => '01205', 'r' => qr/rejected/ }, @@ -230,6 +230,15 @@ my $isexpected = [ { 'n' => '01220', 'r' => qr/virusdetected/ }, { 'n' => '01221', 'r' => qr/userunknown/ }, { 'n' => '01222', 'r' => qr/mailboxfull/ }, + { 'n' => '01223', 'r' => qr/policyviolation/}, + { 'n' => '01224', 'r' => qr/policyviolation/}, + { 'n' => '01225', 'r' => qr/policyviolation/}, + { 'n' => '01226', 'r' => qr/policyviolation/}, + { 'n' => '01227', 'r' => qr/policyviolation/}, + { 'n' => '01228', 'r' => qr/policyviolation/}, + { 'n' => '01229', 'r' => qr/policyviolation/}, + { 'n' => '01230', 'r' => qr/policyviolation/}, + { 'n' => '01231', 'r' => qr/policyviolation/}, ]; plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath; diff --git a/xt/644-lhost-sendmail.t b/xt/644-lhost-sendmail.t index e060fb32e..292c823be 100644 --- a/xt/644-lhost-sendmail.t +++ b/xt/644-lhost-sendmail.t @@ -224,6 +224,14 @@ my $isexpected = [ { 'n' => '01217', 'r' => qr/blocked/ }, { 'n' => '01218', 'r' => qr/blocked/ }, { 'n' => '01219', 'r' => qr/notaccept/ }, + { 'n' => '01220', 'r' => qr/policyviolation/}, + { 'n' => '01221', 'r' => qr/contenterror/ }, + { 'n' => '01222', 'r' => qr/policyviolation/}, + { 'n' => '01223', 'r' => qr/policyviolation/}, + { 'n' => '01224', 'r' => qr/policyviolation/}, + { 'n' => '01225', 'r' => qr/policyviolation/}, + { 'n' => '01226', 'r' => qr/rejected/ }, + { 'n' => '01227', 'r' => qr/rejected/ }, ]; plan 'skip_all', sprintf("%s not found", $samplepath) unless -d $samplepath;