From 65de874aff8d39f7507f8480782935a06ec934fe Mon Sep 17 00:00:00 2001 From: azumakuniyuki Date: Fri, 20 Nov 2020 10:34:13 +0900 Subject: [PATCH] Add sample email rejected by Verizon --- lib/sisimai/reason/blocked.rb | 1 + .../maildir/bsd/lhost-postfix-74.eml | 83 +++++++++++++++++++ spec/sisimai/lhost/private-postfix_spec.rb | 1 + spec/sisimai/lhost/public-postfix_spec.rb | 1 + spec/sisimai/mail/maildir_spec.rb | 2 +- 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 set-of-emails/maildir/bsd/lhost-postfix-74.eml diff --git a/lib/sisimai/reason/blocked.rb b/lib/sisimai/reason/blocked.rb index e87bd4e0..04f9995a 100644 --- a/lib/sisimai/reason/blocked.rb +++ b/lib/sisimai/reason/blocked.rb @@ -117,6 +117,7 @@ class << self |check:[ ]fail ) |spf:[ ][^ ]+[ ]is[ ]not[ ]allowed[ ]to[ ]send[ ]mail[.][ ][a-z0-9]_401 + |temporarily[ ]deferred[ ]due[ ]to[ ]unexpected[ ]volume[ ]or[ ]user[ ]complaints |the[ ](?:email|domain|ip)[ ][^ ]+[ ]is[ ]blacklisted |this[ ]system[ ]will[ ]not[ ]accept[ ]messages[ ]from[ ]servers[/]devices[ ]with[ ]no[ ]reverse[ ]dns |too[ ]many[ ](?: diff --git a/set-of-emails/maildir/bsd/lhost-postfix-74.eml b/set-of-emails/maildir/bsd/lhost-postfix-74.eml new file mode 100644 index 00000000..84121a15 --- /dev/null +++ b/set-of-emails/maildir/bsd/lhost-postfix-74.eml @@ -0,0 +1,83 @@ +Return-Path: <> +Delivered-To: deadbeef@mailmagazine.example.com +Received: from u1.em.example.jp + by mbox3.em.example.jp with LMTP id pRi6D904298QQXvAukD22R + for ; Tue, 17 Nov 2020 23:34:45 +0900 +Received: by u1.em.example.jp (Postfix) + id 9UKnCx1J50z3ZQ2; Tue, 17 Nov 2020 23:34:45 +0900 (JST) +Date: Tue, 17 Nov 2020 23:34:45 +0900 (JST) +From: MAILER-DAEMON@u1.em.example.jp (Mail Delivery System) +Subject: Undelivered Mail Returned to Sender +To: deadbeef@mailmagazine.example.com +Auto-Submitted: auto-replied +MIME-Version: 1.0 +Content-Type: multipart/report; report-type=delivery-status; + boundary="9UK8Prr4eZzSPQR.1605555025/u1.em.example.jp" +Message-Id: <9UKnCx1J50z3ZQ2@u1.em.example.jp> + +This is a MIME-encapsulated message. + +--9UK8Prr4eZzSPQR.1605555025/u1.em.example.jp +Content-Description: Notification +Content-Type: text/plain; charset=us-ascii + +This is the mail system at host u1.em.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 mta6.am0.yahoodns.net[67.195.204.72] said: 421 + 4.7.0 [TSS04] Messages from 192.0.2.192 temporarily deferred due to + unexpected volume or user complaints - 4.16.55.1; see + https://postmaster.verizonmedia.com/error-codes (in reply to MAIL FROM + command) + +--9UK8Prr4eZzSPQR.1605555025/u1.em.example.jp +Content-Description: Delivery report +Content-Type: message/delivery-status + +Reporting-MTA: dns; u1.em.example.jp +X-Postfix-Queue-ID: 9UK8Prr4eZzSPQR +X-Postfix-Sender: rfc822; deadbeef@mailmagazine.example.com +Arrival-Date: Mon, 16 Nov 2020 23:34:45 +0900 (JST) + +Final-Recipient: rfc822; kijitora@y.example.ca +Original-Recipient: rfc822;kijitora@y.example.ca +Action: failed +Status: 4.7.0 +Remote-MTA: dns; mta6.am0.yahoodns.net +Diagnostic-Code: smtp; 421 4.7.0 [TSS04] Messages from 192.0.2.192 + temporarily deferred due to unexpected volume or user complaints - + 4.16.55.1; see https://postmaster.verizonmedia.com/error-codes + +--9UK8Prr4eZzSPQR.1605555025/u1.em.example.jp +Content-Description: Undelivered Message +Content-Type: message/rfc822 + +Return-Path: +Received: from u1.em.example.jp (localhost [127.0.0.1]) + by u1.em.example.jp (Postfix) with ESMTP id 9UK8Prr4eZzSPQR + for ; Mon, 16 Nov 2020 23:34:45 +0900 (JST) +Received: from localhost (localhost [127.0.0.1]) + by u1.em.example.jp (Postfix) with ESMTP id 9UK8P757b8z3ZQM + for ; Mon, 16 Nov 2020 23:34:45 +0900 (JST) +MIME-Version: 1.0 +Content-Type: text/plain; charset=ISO-2022-JP +Content-Transfer-Encoding: quoted-printable +From: +To: "Kijitora" +Subject: Nyaan +Message-Id: <9UK8P757b8z3ZQM@u1.em.example.jp> +Date: Mon, 16 Nov 2020 23:34:45 +0900 (JST) +X-Virus-Scanned: ClamAV using ClamSMTP + +Nyaan + +--9UK8Prr4eZzSPQR.1605555025/u1.em.example.jp-- diff --git a/spec/sisimai/lhost/private-postfix_spec.rb b/spec/sisimai/lhost/private-postfix_spec.rb index 6cf2ddff..e18ce1b0 100644 --- a/spec/sisimai/lhost/private-postfix_spec.rb +++ b/spec/sisimai/lhost/private-postfix_spec.rb @@ -233,6 +233,7 @@ { 'n' => '01229', 'r' => /policyviolation/ }, { 'n' => '01230', 'r' => /policyviolation/ }, { 'n' => '01231', 'r' => /policyviolation/ }, + { 'n' => '01232', 'r' => /blocked/ }, ] Sisimai::Lhost::Code.maketest(enginename, isexpected, true) diff --git a/spec/sisimai/lhost/public-postfix_spec.rb b/spec/sisimai/lhost/public-postfix_spec.rb index dc5f8e56..8c7db04f 100644 --- a/spec/sisimai/lhost/public-postfix_spec.rb +++ b/spec/sisimai/lhost/public-postfix_spec.rb @@ -64,6 +64,7 @@ { 'n' => '71', 's' => /\A5[.]7[.]1\z/, 'r' => /policyviolation/, 'b' => /\A1\z/ }, { 'n' => '72', 's' => /\A5[.]7[.]1\z/, 'r' => /policyviolation/, 'b' => /\A1\z/ }, { 'n' => '73', 's' => /\A5[.]7[.]1\z/, 'r' => /policyviolation/, 'b' => /\A1\z/ }, + { 'n' => '74', 's' => /\A4[.]7[.]0\z/, 'r' => /blocked/, 'b' => /\A1\z/ }, ] Sisimai::Lhost::Code.maketest(enginename, isexpected) diff --git a/spec/sisimai/mail/maildir_spec.rb b/spec/sisimai/mail/maildir_spec.rb index be8f60a5..6145d18a 100644 --- a/spec/sisimai/mail/maildir_spec.rb +++ b/spec/sisimai/mail/maildir_spec.rb @@ -3,7 +3,7 @@ describe Sisimai::Mail::Maildir do samplemaildir = './set-of-emails/maildir/bsd' - allofthefiles = 504 + allofthefiles = 505 let(:mailobj) { Sisimai::Mail::Maildir.new(samples) } let(:mockobj) { Sisimai::Mail::Maildir.new(invalid) }