sisimai 5.7.0-java → 5.7.2-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/codecovio.yml +1 -1
- data/.github/workflows/rake-test.yml +1 -1
- data/ChangeLog.md +25 -0
- data/README-JA.md +14 -13
- data/README.md +12 -12
- data/lib/sisimai/arf.rb +2 -1
- data/lib/sisimai/eb.rb +116 -0
- data/lib/sisimai/fact.rb +24 -17
- data/lib/sisimai/lda.rb +20 -18
- data/lib/sisimai/lhost/amazonses.rb +11 -10
- data/lib/sisimai/lhost/courier.rb +4 -3
- data/lib/sisimai/lhost/domino.rb +2 -1
- data/lib/sisimai/lhost/einsundeins.rb +3 -2
- data/lib/sisimai/lhost/exchange2003.rb +8 -7
- data/lib/sisimai/lhost/exchange2007.rb +14 -13
- data/lib/sisimai/lhost/exim.rb +7 -6
- data/lib/sisimai/lhost/ezweb.rb +4 -3
- data/lib/sisimai/lhost/fml.rb +4 -3
- data/lib/sisimai/lhost/gmail.rb +10 -9
- data/lib/sisimai/lhost/googlegroups.rb +3 -2
- data/lib/sisimai/lhost/googleworkspace.rb +2 -1
- data/lib/sisimai/lhost/imailserver.rb +3 -2
- data/lib/sisimai/lhost/kddi.rb +4 -3
- data/lib/sisimai/lhost/notes.rb +2 -1
- data/lib/sisimai/lhost/postfix.rb +7 -6
- data/lib/sisimai/lhost/qmail.rb +10 -9
- data/lib/sisimai/lhost/sendmail.rb +4 -3
- data/lib/sisimai/lhost/trendmicro.rb +2 -1
- data/lib/sisimai/lhost/v5sendmail.rb +2 -1
- data/lib/sisimai/lhost/verizon.rb +3 -2
- data/lib/sisimai/message.rb +5 -6
- data/lib/sisimai/reason/authfailure.rb +6 -5
- data/lib/sisimai/reason/badreputation.rb +5 -4
- data/lib/sisimai/reason/blocked.rb +6 -5
- data/lib/sisimai/reason/contenterror.rb +6 -5
- data/lib/sisimai/reason/delivered.rb +3 -2
- data/lib/sisimai/reason/emailtoolarge.rb +6 -5
- data/lib/sisimai/reason/expired.rb +3 -2
- data/lib/sisimai/reason/failedstarttls.rb +5 -3
- data/lib/sisimai/reason/feedback.rb +2 -1
- data/lib/sisimai/reason/filtered.rb +9 -8
- data/lib/sisimai/reason/hasmoved.rb +5 -4
- data/lib/sisimai/reason/hostunknown.rb +5 -4
- data/lib/sisimai/reason/mailboxfull.rb +7 -6
- data/lib/sisimai/reason/mailererror.rb +3 -2
- data/lib/sisimai/reason/networkerror.rb +3 -2
- data/lib/sisimai/reason/norelaying.rb +4 -3
- data/lib/sisimai/reason/notaccept.rb +5 -4
- data/lib/sisimai/reason/notcompliantrfc.rb +4 -3
- data/lib/sisimai/reason/onhold.rb +8 -7
- data/lib/sisimai/reason/policyviolation.rb +7 -6
- data/lib/sisimai/reason/ratelimited.rb +5 -4
- data/lib/sisimai/reason/rejected.rb +18 -14
- data/lib/sisimai/reason/requireptr.rb +5 -4
- data/lib/sisimai/reason/securityerror.rb +4 -3
- data/lib/sisimai/reason/spamdetected.rb +6 -5
- data/lib/sisimai/reason/suppressed.rb +4 -3
- data/lib/sisimai/reason/suspend.rb +4 -3
- data/lib/sisimai/reason/syntaxerror.rb +4 -3
- data/lib/sisimai/reason/systemerror.rb +3 -2
- data/lib/sisimai/reason/systemfull.rb +4 -3
- data/lib/sisimai/reason/undefined.rb +2 -1
- data/lib/sisimai/reason/userunknown.rb +13 -9
- data/lib/sisimai/reason/vacation.rb +2 -1
- data/lib/sisimai/reason/virusdetected.rb +6 -5
- data/lib/sisimai/reason.rb +45 -40
- data/lib/sisimai/rfc1894.rb +8 -2
- data/lib/sisimai/rfc2045.rb +6 -3
- data/lib/sisimai/rfc3464/thirdparty.rb +10 -9
- data/lib/sisimai/rfc3834.rb +4 -2
- data/lib/sisimai/rhost/aol.rb +3 -2
- data/lib/sisimai/rhost/apple.rb +12 -11
- data/lib/sisimai/rhost/cloudflare.rb +3 -2
- data/lib/sisimai/rhost/cox.rb +38 -37
- data/lib/sisimai/rhost/facebook.rb +17 -16
- data/lib/sisimai/rhost/franceptt.rb +39 -38
- data/lib/sisimai/rhost/godaddy.rb +35 -34
- data/lib/sisimai/rhost/google.rb +22 -21
- data/lib/sisimai/rhost/gsuite.rb +8 -7
- data/lib/sisimai/rhost/iua.rb +11 -10
- data/lib/sisimai/rhost/kddi.rb +3 -2
- data/lib/sisimai/rhost/messagelabs.rb +13 -12
- data/lib/sisimai/rhost/microsoft.rb +33 -32
- data/lib/sisimai/rhost/mimecast.rb +18 -17
- data/lib/sisimai/rhost/nttdocomo.rb +10 -9
- data/lib/sisimai/rhost/outlook.rb +3 -2
- data/lib/sisimai/rhost/spectrum.rb +19 -18
- data/lib/sisimai/rhost/tencent.rb +10 -9
- data/lib/sisimai/rhost/yahooinc.rb +11 -10
- data/lib/sisimai/rhost/zoho.rb +8 -7
- data/lib/sisimai/smtp/command.rb +13 -8
- data/lib/sisimai/smtp/failure.rb +9 -8
- data/lib/sisimai/smtp/reply.rb +23 -22
- data/lib/sisimai/smtp/status.rb +141 -140
- data/lib/sisimai/smtp/transcript.rb +3 -2
- data/lib/sisimai/string.rb +4 -3
- data/lib/sisimai/version.rb +1 -1
- data/lib/sisimai.rb +2 -1
- data/set-of-emails/maildir/bsd/lhost-postfix-81.eml +130 -0
- data/set-of-emails/should-not-crash/go-423-deeply-nested-mime-parts.eml +20050 -0
- metadata +5 -2
data/lib/sisimai/smtp/reply.rb
CHANGED
|
@@ -46,6 +46,7 @@ module Sisimai
|
|
|
46
46
|
# Sisimai::SMTP::Reply is utilities for getting SMTP Reply Code value from error message text.
|
|
47
47
|
module Reply
|
|
48
48
|
class << self
|
|
49
|
+
require 'sisimai/eb'
|
|
49
50
|
ReplyCode2 = [
|
|
50
51
|
# http://www.ietf.org/rfc/rfc5321.txt
|
|
51
52
|
# 211 System status, or system help reply
|
|
@@ -111,28 +112,28 @@ module Sisimai
|
|
|
111
112
|
].freeze
|
|
112
113
|
CodeOfSMTP = {'2' => ReplyCode2, '4' => ReplyCode4, '5' => ReplyCode5}.freeze
|
|
113
114
|
Associated = {
|
|
114
|
-
"422" => [
|
|
115
|
-
"432" => [
|
|
116
|
-
"451" => ["",
|
|
117
|
-
"452" => ["",
|
|
118
|
-
"454" => [
|
|
119
|
-
"455" => ["",
|
|
120
|
-
"500" => ["",
|
|
121
|
-
"501" => ["",
|
|
122
|
-
"502" => ["",
|
|
123
|
-
"503" => ["",
|
|
124
|
-
"504" => ["",
|
|
125
|
-
"521" => [
|
|
126
|
-
"523" => [
|
|
127
|
-
"524" => [
|
|
128
|
-
"525" => [
|
|
129
|
-
"534" => [
|
|
130
|
-
"535" => [
|
|
131
|
-
"538" => [
|
|
132
|
-
"551" => ["",
|
|
133
|
-
"552" => ["",
|
|
134
|
-
"555" => ["",
|
|
135
|
-
"556" => [
|
|
115
|
+
"422" => [Sisimai::Eb::CeAUTH, "4.7.12", Sisimai::Eb::ReSAFE], # RFC5238
|
|
116
|
+
"432" => [Sisimai::Eb::CeAUTH, "4.7.12", Sisimai::Eb::ReSAFE], # RFC4954, RFC5321
|
|
117
|
+
"451" => ["", "", Sisimai::Eb::RePROC], # RFC2465, RFC5321
|
|
118
|
+
"452" => ["", "", Sisimai::Eb::ReDISK], # RFC5321
|
|
119
|
+
"454" => [Sisimai::Eb::CeAUTH, "4.7.0", Sisimai::Eb::ReSAFE], # RFC3027, RFC4954
|
|
120
|
+
"455" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
|
|
121
|
+
"500" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
|
|
122
|
+
"501" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
|
|
123
|
+
"502" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
|
|
124
|
+
"503" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
|
|
125
|
+
"504" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
|
|
126
|
+
"521" => [Sisimai::Eb::CeCONN, "", Sisimai::Eb::Re00MX], # RFC7504
|
|
127
|
+
"523" => [Sisimai::Eb::CeAUTH, "5.7.10", Sisimai::Eb::ReSAFE], # RFC5248
|
|
128
|
+
"524" => [Sisimai::Eb::CeAUTH, "5.7.11", Sisimai::Eb::ReSAFE], # RFC5248
|
|
129
|
+
"525" => [Sisimai::Eb::CeAUTH, "5.7.13", Sisimai::Eb::ReSAFE], # RFC5248
|
|
130
|
+
"534" => [Sisimai::Eb::CeAUTH, "5.7.9", Sisimai::Eb::ReSAFE], # RFC4954, RFC5248
|
|
131
|
+
"535" => [Sisimai::Eb::CeAUTH, "5.7.8", Sisimai::Eb::ReSAFE], # RFC4954, RFC5248
|
|
132
|
+
"538" => [Sisimai::Eb::CeAUTH, "5.7.11", Sisimai::Eb::ReSAFE], # RFC4954, RFC5248
|
|
133
|
+
"551" => ["", "", Sisimai::Eb::ReMOVE], # RFC5321, RFC5336, RFC6531
|
|
134
|
+
"552" => ["", "", Sisimai::Eb::ReFULL], # RFC5321
|
|
135
|
+
"555" => ["", "", Sisimai::Eb::ReCOMM], # RFC5321
|
|
136
|
+
"556" => [Sisimai::Eb::CeRCPT, "", Sisimai::Eb::Re00MX], # RFC7504
|
|
136
137
|
}.freeze
|
|
137
138
|
|
|
138
139
|
# Check whether a reply code is a valid code or not
|
data/lib/sisimai/smtp/status.rb
CHANGED
|
@@ -485,6 +485,7 @@ module Sisimai
|
|
|
485
485
|
# reason from D.S.N. value, and getting D.S.N. from the text including D.S.N.
|
|
486
486
|
module Status
|
|
487
487
|
class << self
|
|
488
|
+
require "sisimai/eb"
|
|
488
489
|
require "sisimai/rfc791"
|
|
489
490
|
|
|
490
491
|
CodePatterns = [
|
|
@@ -494,150 +495,150 @@ module Sisimai
|
|
|
494
495
|
%r/\b(2[.][0-7][.][0-7])\b/, # 2.1.5
|
|
495
496
|
]
|
|
496
497
|
StandardCode = {
|
|
497
|
-
'2.1.5' =>
|
|
498
|
+
'2.1.5' => Sisimai::Eb::ReSENT, # Successfully delivered
|
|
498
499
|
# ---------------------------------------------------------------------------------------
|
|
499
|
-
'4.1.6' =>
|
|
500
|
-
'4.1.7' =>
|
|
501
|
-
'4.1.8' =>
|
|
502
|
-
'4.1.9' =>
|
|
503
|
-
'4.2.1' =>
|
|
504
|
-
'4.2.2' =>
|
|
505
|
-
'4.2.3' =>
|
|
506
|
-
'4.2.4' =>
|
|
507
|
-
#
|
|
508
|
-
'4.3.1' =>
|
|
509
|
-
'4.3.2' =>
|
|
510
|
-
'4.3.3' =>
|
|
511
|
-
'4.3.5' =>
|
|
512
|
-
#
|
|
513
|
-
'4.4.1' =>
|
|
514
|
-
'4.4.2' =>
|
|
515
|
-
'4.4.3' =>
|
|
516
|
-
'4.4.4' =>
|
|
517
|
-
'4.4.5' =>
|
|
518
|
-
'4.4.6' =>
|
|
519
|
-
'4.4.7' =>
|
|
520
|
-
'4.4.8' =>
|
|
521
|
-
#
|
|
522
|
-
'4.5.3' =>
|
|
523
|
-
'4.5.5' =>
|
|
524
|
-
'4.6.0' =>
|
|
525
|
-
'4.6.2' =>
|
|
526
|
-
'4.6.5' =>
|
|
527
|
-
#
|
|
528
|
-
'4.7.1' =>
|
|
529
|
-
'4.7.2' =>
|
|
530
|
-
'4.7.5' =>
|
|
531
|
-
'4.7.6' =>
|
|
532
|
-
'4.7.7' =>
|
|
533
|
-
'4.7.12' =>
|
|
534
|
-
'4.7.15' =>
|
|
535
|
-
'4.7.16' =>
|
|
536
|
-
'4.7.24' =>
|
|
537
|
-
'4.7.25' =>
|
|
500
|
+
'4.1.6' => Sisimai::Eb::ReMOVE, # Destination mailbox has moved, No forwarding address
|
|
501
|
+
'4.1.7' => Sisimai::Eb::ReFROM, # Bad sender's mailbox address syntax
|
|
502
|
+
'4.1.8' => Sisimai::Eb::ReFROM, # Bad sender's system address
|
|
503
|
+
'4.1.9' => Sisimai::Eb::RePROC, # Message relayed to non-compliant mailer
|
|
504
|
+
'4.2.1' => Sisimai::Eb::ReQUIT, # Mailbox disabled, not accepting messages
|
|
505
|
+
'4.2.2' => Sisimai::Eb::ReFULL, # Mailbox full
|
|
506
|
+
'4.2.3' => Sisimai::Eb::ReSIZE, # Message length exceeds administrative limit
|
|
507
|
+
'4.2.4' => Sisimai::Eb::RePROC, # Mailing list expansion problem
|
|
508
|
+
#'4.3.0' => Sisimai::Eb::ReSAFE, # Other or undefined mail system status
|
|
509
|
+
'4.3.1' => Sisimai::Eb::ReDISK, # Mail system full
|
|
510
|
+
'4.3.2' => Sisimai::Eb::Re00MX, # System not accepting network messages
|
|
511
|
+
'4.3.3' => Sisimai::Eb::RePROC, # System not capable of selected features
|
|
512
|
+
'4.3.5' => Sisimai::Eb::RePROC, # System incorrectly configured
|
|
513
|
+
#'4.4.0' => Sisimai::Eb::ReINET, # Other or undefined network or routing status
|
|
514
|
+
'4.4.1' => Sisimai::Eb::ReTIME, # No answer from host
|
|
515
|
+
'4.4.2' => Sisimai::Eb::ReINET, # Bad connection
|
|
516
|
+
'4.4.3' => Sisimai::Eb::RePROC, # Directory server failure
|
|
517
|
+
'4.4.4' => Sisimai::Eb::ReINET, # Unable to route
|
|
518
|
+
'4.4.5' => Sisimai::Eb::ReDISK, # Mail system congestion
|
|
519
|
+
'4.4.6' => Sisimai::Eb::ReINET, # Routing loop detected
|
|
520
|
+
'4.4.7' => Sisimai::Eb::ReTIME, # Delivery time expired
|
|
521
|
+
'4.4.8' => Sisimai::Eb::ReINET, # Retry on IPv4
|
|
522
|
+
#'4.5.0' => Sisimai::Eb::ReINET, # Other or undefined protocol status
|
|
523
|
+
'4.5.3' => Sisimai::Eb::ReRATE, # Too many recipients
|
|
524
|
+
'4.5.5' => Sisimai::Eb::RePROC, # Wrong protocol version
|
|
525
|
+
'4.6.0' => Sisimai::Eb::ReBODY, # Other or undefined media error
|
|
526
|
+
'4.6.2' => Sisimai::Eb::ReBODY, # Conversion required and prohibited
|
|
527
|
+
'4.6.5' => Sisimai::Eb::ReBODY, # Conversion Failed
|
|
528
|
+
#'4.7.0' => Sisimai::Eb::ReSAFE, # Other or undefined security status
|
|
529
|
+
'4.7.1' => Sisimai::Eb::ReBLOC, # Delivery not authorized, message refused
|
|
530
|
+
'4.7.2' => Sisimai::Eb::ReFROM, # Mailing list expansion prohibited
|
|
531
|
+
'4.7.5' => Sisimai::Eb::ReSAFE, # Cryptographic failure
|
|
532
|
+
'4.7.6' => Sisimai::Eb::ReSAFE, # Cryptographic algorithm not supported
|
|
533
|
+
'4.7.7' => Sisimai::Eb::ReSAFE, # Message integrity failure
|
|
534
|
+
'4.7.12' => Sisimai::Eb::ReSAFE, # A password transition is needed
|
|
535
|
+
'4.7.15' => Sisimai::Eb::ReSAFE, # Priority Level is too low
|
|
536
|
+
'4.7.16' => Sisimai::Eb::ReSIZE, # Message is too big for the specified priority
|
|
537
|
+
'4.7.24' => Sisimai::Eb::ReAUTH, # SPF validation error
|
|
538
|
+
'4.7.25' => Sisimai::Eb::ReQPTR, # Reverse DNS validation failed
|
|
538
539
|
# ---------------------------------------------------------------------------------------
|
|
539
|
-
'5.1.0' =>
|
|
540
|
-
'5.1.1' =>
|
|
541
|
-
'5.1.2' =>
|
|
542
|
-
'5.1.3' =>
|
|
543
|
-
'5.1.4' =>
|
|
544
|
-
'5.1.6' =>
|
|
545
|
-
'5.1.7' =>
|
|
546
|
-
'5.1.8' =>
|
|
547
|
-
'5.1.9' =>
|
|
548
|
-
'5.1.10' =>
|
|
549
|
-
'5.2.0' =>
|
|
550
|
-
'5.2.1' =>
|
|
551
|
-
'5.2.2' =>
|
|
552
|
-
'5.2.3' =>
|
|
553
|
-
'5.2.4' =>
|
|
554
|
-
'5.3.0' =>
|
|
555
|
-
'5.3.1' =>
|
|
556
|
-
'5.3.2' =>
|
|
557
|
-
'5.3.3' =>
|
|
558
|
-
'5.3.4' =>
|
|
559
|
-
'5.3.5' =>
|
|
560
|
-
'5.4.0' =>
|
|
561
|
-
'5.4.3' =>
|
|
562
|
-
'5.4.4' =>
|
|
563
|
-
'5.5.2' =>
|
|
564
|
-
'5.5.3' =>
|
|
565
|
-
'5.5.4' =>
|
|
566
|
-
'5.5.5' =>
|
|
567
|
-
'5.5.6' =>
|
|
568
|
-
'5.6.0' =>
|
|
569
|
-
'5.6.1' =>
|
|
570
|
-
'5.6.2' =>
|
|
571
|
-
'5.6.3' =>
|
|
572
|
-
'5.6.5' =>
|
|
573
|
-
'5.6.6' =>
|
|
574
|
-
'5.6.7' =>
|
|
575
|
-
'5.6.8' =>
|
|
576
|
-
'5.6.9' =>
|
|
577
|
-
'5.7.0' =>
|
|
578
|
-
'5.7.1' =>
|
|
579
|
-
'5.7.2' =>
|
|
580
|
-
'5.7.3' =>
|
|
581
|
-
'5.7.4' =>
|
|
582
|
-
'5.7.5' =>
|
|
583
|
-
'5.7.6' =>
|
|
584
|
-
'5.7.7' =>
|
|
585
|
-
'5.7.8' =>
|
|
586
|
-
'5.7.9' =>
|
|
587
|
-
'5.7.10' =>
|
|
588
|
-
'5.7.11' =>
|
|
589
|
-
'5.7.13' =>
|
|
590
|
-
'5.7.14' =>
|
|
591
|
-
'5.7.15' =>
|
|
592
|
-
'5.7.16' =>
|
|
593
|
-
'5.7.17' =>
|
|
594
|
-
'5.7.18' =>
|
|
595
|
-
'5.7.19' =>
|
|
596
|
-
'5.7.20' =>
|
|
597
|
-
'5.7.21' =>
|
|
598
|
-
'5.7.22' =>
|
|
599
|
-
'5.7.23' =>
|
|
600
|
-
'5.7.24' =>
|
|
601
|
-
'5.7.25' =>
|
|
602
|
-
'5.7.26' =>
|
|
603
|
-
'5.7.27' =>
|
|
604
|
-
'5.7.28' =>
|
|
605
|
-
'5.7.29' =>
|
|
606
|
-
'5.7.30' =>
|
|
540
|
+
'5.1.0' => Sisimai::Eb::ReUSER, # Other address status
|
|
541
|
+
'5.1.1' => Sisimai::Eb::ReUSER, # Bad destination mailbox address
|
|
542
|
+
'5.1.2' => Sisimai::Eb::ReHOST, # Bad destination system address
|
|
543
|
+
'5.1.3' => Sisimai::Eb::ReUSER, # Bad destination mailbox address syntax
|
|
544
|
+
'5.1.4' => Sisimai::Eb::ReFILT, # Destination mailbox address ambiguous
|
|
545
|
+
'5.1.6' => Sisimai::Eb::ReMOVE, # Destination mailbox has moved, No forwarding address
|
|
546
|
+
'5.1.7' => Sisimai::Eb::ReFROM, # Bad sender's mailbox address syntax
|
|
547
|
+
'5.1.8' => Sisimai::Eb::ReFROM, # Bad sender's system address
|
|
548
|
+
'5.1.9' => Sisimai::Eb::RePROC, # Message relayed to non-compliant mailer
|
|
549
|
+
'5.1.10' => Sisimai::Eb::Re00MX, # Recipient address has null MX
|
|
550
|
+
'5.2.0' => Sisimai::Eb::ReFILT, # Other or undefined mailbox status
|
|
551
|
+
'5.2.1' => Sisimai::Eb::ReFILT, # Mailbox disabled, not accepting messages
|
|
552
|
+
'5.2.2' => Sisimai::Eb::ReFULL, # Mailbox full
|
|
553
|
+
'5.2.3' => Sisimai::Eb::ReSIZE, # Message length exceeds administrative limit
|
|
554
|
+
'5.2.4' => Sisimai::Eb::RePROC, # Mailing list expansion problem
|
|
555
|
+
'5.3.0' => Sisimai::Eb::RePROC, # Other or undefined mail system status
|
|
556
|
+
'5.3.1' => Sisimai::Eb::ReDISK, # Mail system full
|
|
557
|
+
'5.3.2' => Sisimai::Eb::Re00MX, # System not accepting network messages
|
|
558
|
+
'5.3.3' => Sisimai::Eb::RePROC, # System not capable of selected features
|
|
559
|
+
'5.3.4' => Sisimai::Eb::ReSIZE, # Message too big for system
|
|
560
|
+
'5.3.5' => Sisimai::Eb::RePROC, # System incorrectly configured
|
|
561
|
+
'5.4.0' => Sisimai::Eb::ReINET, # Other or undefined network or routing status
|
|
562
|
+
'5.4.3' => Sisimai::Eb::RePROC, # Directory server failure
|
|
563
|
+
'5.4.4' => Sisimai::Eb::ReHOST, # Unable to route
|
|
564
|
+
'5.5.2' => Sisimai::Eb::RePROC, # If the server cannot BASE64 decode any client response (AUTH)
|
|
565
|
+
'5.5.3' => Sisimai::Eb::ReRATE, # Too many recipients
|
|
566
|
+
'5.5.4' => Sisimai::Eb::RePROC, # Invalid command arguments
|
|
567
|
+
'5.5.5' => Sisimai::Eb::RePROC, # Wrong protocol version
|
|
568
|
+
'5.5.6' => Sisimai::Eb::ReCOMM, # Authentication Exchange line is too long
|
|
569
|
+
'5.6.0' => Sisimai::Eb::ReBODY, # Other or undefined media error
|
|
570
|
+
'5.6.1' => Sisimai::Eb::ReBODY, # Media not supported
|
|
571
|
+
'5.6.2' => Sisimai::Eb::ReBODY, # Conversion required and prohibited
|
|
572
|
+
'5.6.3' => Sisimai::Eb::ReBODY, # Conversion required but not supported
|
|
573
|
+
'5.6.5' => Sisimai::Eb::ReBODY, # Conversion Failed
|
|
574
|
+
'5.6.6' => Sisimai::Eb::ReBODY, # Message content not available
|
|
575
|
+
'5.6.7' => Sisimai::Eb::ReFROM, # Non-ASCII addresses not permitted for that sender/recipient
|
|
576
|
+
'5.6.8' => Sisimai::Eb::ReBODY, # UTF-8 string reply is required, but not permitted by the SMTP client
|
|
577
|
+
'5.6.9' => Sisimai::Eb::ReBODY, # UTF-8 header message cannot be transferred to one or more recipients
|
|
578
|
+
'5.7.0' => Sisimai::Eb::ReSAFE, # Other or undefined security status
|
|
579
|
+
'5.7.1' => Sisimai::Eb::ReSAFE, # Delivery not authorized, message refused
|
|
580
|
+
'5.7.2' => Sisimai::Eb::ReSAFE, # Mailing list expansion prohibited
|
|
581
|
+
'5.7.3' => Sisimai::Eb::ReSAFE, # Security conversion required but not possible
|
|
582
|
+
'5.7.4' => Sisimai::Eb::ReSAFE, # Security features not supported
|
|
583
|
+
'5.7.5' => Sisimai::Eb::ReSAFE, # Cryptographic failure
|
|
584
|
+
'5.7.6' => Sisimai::Eb::ReSAFE, # Cryptographic algorithm not supported
|
|
585
|
+
'5.7.7' => Sisimai::Eb::ReSAFE, # Message integrity failure
|
|
586
|
+
'5.7.8' => Sisimai::Eb::ReSAFE, # Authentication credentials invalid
|
|
587
|
+
'5.7.9' => Sisimai::Eb::ReSAFE, # Authentication mechanism is too weak
|
|
588
|
+
'5.7.10' => Sisimai::Eb::ReSAFE, # Encryption Needed
|
|
589
|
+
'5.7.11' => Sisimai::Eb::ReSAFE, # Encryption required for requested authentication mechanism
|
|
590
|
+
'5.7.13' => Sisimai::Eb::ReQUIT, # User Account Disabled
|
|
591
|
+
'5.7.14' => Sisimai::Eb::ReSAFE, # Trust relationship required
|
|
592
|
+
'5.7.15' => Sisimai::Eb::ReSAFE, # Priority Level is too low
|
|
593
|
+
'5.7.16' => Sisimai::Eb::ReSIZE, # Message is too big for the specified priority
|
|
594
|
+
'5.7.17' => Sisimai::Eb::ReMOVE, # Mailbox owner has changed
|
|
595
|
+
'5.7.18' => Sisimai::Eb::ReMOVE, # Domain owner has changed
|
|
596
|
+
'5.7.19' => Sisimai::Eb::RePROC, # RRVS test cannot be completed
|
|
597
|
+
'5.7.20' => Sisimai::Eb::ReAUTH, # No passing DKIM signature found
|
|
598
|
+
'5.7.21' => Sisimai::Eb::ReAUTH, # No acceptable DKIM signature found
|
|
599
|
+
'5.7.22' => Sisimai::Eb::ReAUTH, # No valid author-matched DKIM signature found
|
|
600
|
+
'5.7.23' => Sisimai::Eb::ReAUTH, # SPF validation failed
|
|
601
|
+
'5.7.24' => Sisimai::Eb::ReAUTH, # SPF validation error
|
|
602
|
+
'5.7.25' => Sisimai::Eb::ReQPTR, # Reverse DNS validation failed
|
|
603
|
+
'5.7.26' => Sisimai::Eb::ReAUTH, # Multiple authentication checks failed
|
|
604
|
+
'5.7.27' => Sisimai::Eb::Re00MX, # MX resource record of a destination host is Null MX: RFC7505
|
|
605
|
+
'5.7.28' => Sisimai::Eb::ReSPAM, # The message appears to be part of a mail flood of similar abusive messages.
|
|
606
|
+
'5.7.29' => Sisimai::Eb::ReAUTH, # This status code may be returned when a message fails ARC validation.
|
|
607
|
+
'5.7.30' => Sisimai::Eb::ReTTLS, # REQUIRETLS support required
|
|
607
608
|
}.freeze
|
|
608
609
|
|
|
609
610
|
InternalCode = {
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
611
|
+
Sisimai::Eb::ReAUTH => ['5.9.130', '4.9.130'],
|
|
612
|
+
Sisimai::Eb::ReFAMA => ['5.9.132', '4.9.132'],
|
|
613
|
+
Sisimai::Eb::ReBLOC => ['5.9.134', '4.9.134'],
|
|
614
|
+
Sisimai::Eb::ReBODY => ['5.9.160', '4.9.160'],
|
|
615
|
+
Sisimai::Eb::ReSIZE => ['5.9.161', '4.9.161'],
|
|
616
|
+
Sisimai::Eb::ReTIME => ['5.9.340', '4.9.340'],
|
|
617
|
+
Sisimai::Eb::ReTTLS => ['5.9.350', '4.9.350'],
|
|
618
|
+
Sisimai::Eb::ReFILT => ['5.9.210', '4.9.210'],
|
|
619
|
+
Sisimai::Eb::ReMOVE => ['5.9.211', ''],
|
|
620
|
+
Sisimai::Eb::ReHOST => ['5.9.212', ''],
|
|
621
|
+
Sisimai::Eb::ReFULL => ['5.9.220', '4.9.220'],
|
|
622
|
+
Sisimai::Eb::ReUNIX => ['5.9.230', '4.9.230'],
|
|
623
|
+
Sisimai::Eb::ReINET => ['5.9.341', '4.9.341'],
|
|
624
|
+
Sisimai::Eb::RePASS => ['5.9.214', '4.9.214'],
|
|
625
|
+
Sisimai::Eb::Re00MX => ['5.9.215', '4.9.215'],
|
|
626
|
+
Sisimai::Eb::ReNRFC => ['5.9.162', '4.9.162'],
|
|
627
|
+
Sisimai::Eb::Re___1 => ['5.9.301', '4.9.301'],
|
|
628
|
+
Sisimai::Eb::ReWONT => ['5.9.371', '4.9.371'],
|
|
629
|
+
Sisimai::Eb::ReRATE => ['5.9.131', '4.9.131'],
|
|
630
|
+
Sisimai::Eb::ReFROM => ['5.9.110', '4.9.110'],
|
|
631
|
+
Sisimai::Eb::ReQPTR => ['5.9.133', '4.9.133'],
|
|
632
|
+
Sisimai::Eb::ReSAFE => ['5.9.370', '4.9.370'],
|
|
633
|
+
Sisimai::Eb::ReSPAM => ['5.9.164', '4.9.164'],
|
|
634
|
+
Sisimai::Eb::ReSTOP => ['5.9.310', '4.9.310'],
|
|
635
|
+
Sisimai::Eb::ReQUIT => ['5.9.221', '4.9.221'],
|
|
636
|
+
Sisimai::Eb::ReCOMM => ['5.9.351', '4.9.351'],
|
|
637
|
+
Sisimai::Eb::RePROC => ['5.9.231', '4.9.231'],
|
|
638
|
+
Sisimai::Eb::ReDISK => ['5.9.232', '4.9.232'],
|
|
639
|
+
Sisimai::Eb::Re___0 => ['5.9.300', '4.9.300'],
|
|
640
|
+
Sisimai::Eb::ReUSER => ['5.9.213', ''],
|
|
641
|
+
Sisimai::Eb::ReEXEC => ['5.9.165', '4.9.165'],
|
|
641
642
|
}.freeze
|
|
642
643
|
|
|
643
644
|
# Convert from the reason string to the internal status code
|
|
@@ -839,7 +840,7 @@ module Sisimai
|
|
|
839
840
|
when "4.4.7", "4.7.0" then return codeinmesg
|
|
840
841
|
when "5.1.3" then return codeinmesg if codeinmesg.start_with?('5.7.')
|
|
841
842
|
when "5.1.1"
|
|
842
|
-
# "5.1.1" is a code of "
|
|
843
|
+
# "5.1.1" is a code of "UserUnknown"
|
|
843
844
|
return statuscode if codeinmesg.start_with?('5.5.') || zeroindex1['error'] > 0
|
|
844
845
|
return codeinmesg
|
|
845
846
|
end
|
|
@@ -3,6 +3,7 @@ module Sisimai
|
|
|
3
3
|
# Sisimai::SMTP::Transcript is a decoder for the transcript logs of the SMTP session
|
|
4
4
|
module Transcript
|
|
5
5
|
class << self
|
|
6
|
+
require 'sisimai/eb'
|
|
6
7
|
require 'sisimai/smtp/reply'
|
|
7
8
|
require 'sisimai/smtp/status'
|
|
8
9
|
|
|
@@ -43,7 +44,7 @@ module Sisimai
|
|
|
43
44
|
# An SMTP server response starting with '<<<' is the first
|
|
44
45
|
esmtp << table.call
|
|
45
46
|
cx = esmtp[-1]
|
|
46
|
-
cx['command'] =
|
|
47
|
+
cx['command'] = Sisimai::Eb::CeCONN
|
|
47
48
|
argv0 = argv0[p2, argv0.size] if p2 > -1
|
|
48
49
|
else
|
|
49
50
|
# An SMTP command starting with '>>>' is the first
|
|
@@ -68,7 +69,7 @@ module Sisimai
|
|
|
68
69
|
cx = esmtp[-1]
|
|
69
70
|
cx['command'] = thecommand.upcase
|
|
70
71
|
|
|
71
|
-
if thecommand
|
|
72
|
+
if thecommand == Sisimai::Eb::CeMAIL || thecommand == Sisimai::Eb::CeRCPT || thecommand == Sisimai::Eb::CeXFWD
|
|
72
73
|
# MAIL or RCPT
|
|
73
74
|
if cv = commandarg.match(/\A(?:FROM|TO):[ ]*<(.+[@].+)>[ ]*(.*)\z/)
|
|
74
75
|
# >>> MAIL FROM: <neko@example.com> SIZE=65535
|
data/lib/sisimai/string.rb
CHANGED
|
@@ -53,9 +53,10 @@ module Sisimai
|
|
|
53
53
|
# 3. <a href = 'http://...'>...</a> to " http://... "
|
|
54
54
|
# 4. <a href = 'mailto:...'>...</a> to " Value <mailto:...> "
|
|
55
55
|
plain.scrub!('?')
|
|
56
|
-
|
|
57
|
-
plain = plain.gsub(%r|<
|
|
58
|
-
plain = plain.gsub(%r|<
|
|
56
|
+
cv = plain.downcase
|
|
57
|
+
plain = plain.gsub(%r|<head>.+?</head>|im, "") if cv.include?("</head>")
|
|
58
|
+
plain = plain.gsub(%r|<style.+?>.+?</style>|im, "") if cv.include?("</style>")
|
|
59
|
+
plain = plain.gsub(%r|<a\s+href\s*=\s*(['"])(https?://[^'"]+?)\1[^>]*?>(.*?)</a>|i, ' [\3](\2) ')
|
|
59
60
|
plain = plain.gsub(%r|<a\s+href\s*=\s*["']mailto:([^\s]+?)["']>(.*?)</a>|i, '[\2](mailto:\1)')
|
|
60
61
|
plain = plain.gsub(/<[^<@>]+?>\s*/, ' ') # Delete HTML tags except <neko@example.jp>
|
|
61
62
|
plain = plain.gsub(/</, '<').gsub(/>/, '>') # Convert to angle brackets
|
data/lib/sisimai/version.rb
CHANGED
data/lib/sisimai.rb
CHANGED
|
@@ -104,12 +104,13 @@ module Sisimai
|
|
|
104
104
|
# Reason list Sisimai can detect
|
|
105
105
|
# @return [Hash] Reason list table
|
|
106
106
|
def reason
|
|
107
|
+
require 'sisimai/eb'
|
|
107
108
|
require 'sisimai/reason'
|
|
108
109
|
table = {}
|
|
109
110
|
names = Sisimai::Reason.index
|
|
110
111
|
|
|
111
112
|
# These reasons are not included in the results of Sisimai::Reason.index
|
|
112
|
-
names +=
|
|
113
|
+
names += [Sisimai::Eb::ReSENT, Sisimai::Eb::ReFEED, Sisimai::Eb::Re___0, Sisimai::Eb::ReAWAY]
|
|
113
114
|
while e = names.shift do
|
|
114
115
|
# Call .description() method of Sisimai::Reason::*
|
|
115
116
|
r = "Sisimai::Reason::#{e}"
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Return-Path: <>
|
|
2
|
+
Delivered-To: sironeko@example.com
|
|
3
|
+
Received: by e4.example.com (Postfix) via r2.example.com id FFFFFFFF00;
|
|
4
|
+
Thu, 29 Apr 2005 23:34:45 +0000 (UTC)
|
|
5
|
+
MIME-Version: 1.0
|
|
6
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-01"
|
|
7
|
+
Message-Id: <20050429233445.FFFFFFFF99@e4.example.com>
|
|
8
|
+
From: MAILER-DAEMON@e4.example.com (Mail Delivery System)
|
|
9
|
+
To: sironeko@e4.example.com
|
|
10
|
+
Subject: Undelivered Mail Returned to Sender
|
|
11
|
+
Date: Thu, 29 Apr 2005 23:34:45 +0000 (UTC)
|
|
12
|
+
|
|
13
|
+
This is a MIME-encapsulated message.
|
|
14
|
+
|
|
15
|
+
--BOUNDARY-DEPTH-01
|
|
16
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-02"
|
|
17
|
+
|
|
18
|
+
--BOUNDARY-DEPTH-02
|
|
19
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-03"
|
|
20
|
+
|
|
21
|
+
--BOUNDARY-DEPTH-03
|
|
22
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-04"
|
|
23
|
+
|
|
24
|
+
--BOUNDARY-DEPTH-04
|
|
25
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-05"
|
|
26
|
+
|
|
27
|
+
--BOUNDARY-DEPTH-05
|
|
28
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-06"
|
|
29
|
+
|
|
30
|
+
--BOUNDARY-DEPTH-06
|
|
31
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-07"
|
|
32
|
+
|
|
33
|
+
--BOUNDARY-DEPTH-07
|
|
34
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-08"
|
|
35
|
+
|
|
36
|
+
--BOUNDARY-DEPTH-08
|
|
37
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-09"
|
|
38
|
+
|
|
39
|
+
--BOUNDARY-DEPTH-09
|
|
40
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-10"
|
|
41
|
+
|
|
42
|
+
--BOUNDARY-DEPTH-10
|
|
43
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-11"
|
|
44
|
+
|
|
45
|
+
--BOUNDARY-DEPTH-11
|
|
46
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-12"
|
|
47
|
+
|
|
48
|
+
--BOUNDARY-DEPTH-12
|
|
49
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-13"
|
|
50
|
+
|
|
51
|
+
--BOUNDARY-DEPTH-13
|
|
52
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-14"
|
|
53
|
+
|
|
54
|
+
--BOUNDARY-DEPTH-14
|
|
55
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-15"
|
|
56
|
+
|
|
57
|
+
--BOUNDARY-DEPTH-15
|
|
58
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-16"
|
|
59
|
+
|
|
60
|
+
--BOUNDARY-DEPTH-16
|
|
61
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-17"
|
|
62
|
+
|
|
63
|
+
--BOUNDARY-DEPTH-17
|
|
64
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-18"
|
|
65
|
+
|
|
66
|
+
--BOUNDARY-DEPTH-18
|
|
67
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-19"
|
|
68
|
+
|
|
69
|
+
--BOUNDARY-DEPTH-19
|
|
70
|
+
Content-Type: multipart/mixed; boundary="BOUNDARY-DEPTH-20"
|
|
71
|
+
|
|
72
|
+
--BOUNDARY-DEPTH-20
|
|
73
|
+
Content-Description: Notification
|
|
74
|
+
Content-Type: text/plain
|
|
75
|
+
|
|
76
|
+
This is the Postfix program at host e4.example.com.
|
|
77
|
+
|
|
78
|
+
I'm sorry to have to inform you that the message returned
|
|
79
|
+
below could not be delivered to one or more destinations.
|
|
80
|
+
|
|
81
|
+
For further assistance, please contact <postmaster@e4.example.com>
|
|
82
|
+
|
|
83
|
+
If you do so, please include this problem report. You can
|
|
84
|
+
delete your own text from the message returned below.
|
|
85
|
+
|
|
86
|
+
The Postfix program
|
|
87
|
+
|
|
88
|
+
<kijitora@example.com>: Name service error for domain example.com: Host not
|
|
89
|
+
found, try again
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
--FFFF000020.0000110000/e4.example.com
|
|
93
|
+
Content-Description: Undelivered Message
|
|
94
|
+
Content-Type: message/rfc822
|
|
95
|
+
|
|
96
|
+
Received: by e4.example.com (Postfix, from userid 1)
|
|
97
|
+
id FFFFFFFF55; Thu, 29 Apr 2005 23:34:45 +0000 (UTC)
|
|
98
|
+
MIME-Version: 1.0
|
|
99
|
+
Content-Type: text/plain; charset=us-ascii
|
|
100
|
+
Content-Transfer-Encoding: 7bit
|
|
101
|
+
Message-ID: <ffffffffffffffff000000002@neko.nyaan.example.jp>
|
|
102
|
+
From: Neko <sironeko@example.or.jp>
|
|
103
|
+
Date: Thu, 29 Apr 2005 23:34:45 +0000
|
|
104
|
+
To: Kijitora <kijitora@example.com>
|
|
105
|
+
Subject: Nyaan
|
|
106
|
+
|
|
107
|
+
Nyaan
|
|
108
|
+
|
|
109
|
+
--FFFF000020.0000110000/e4.example.com--
|
|
110
|
+
|
|
111
|
+
--BOUNDARY-DEPTH-20--
|
|
112
|
+
--BOUNDARY-DEPTH-19--
|
|
113
|
+
--BOUNDARY-DEPTH-18--
|
|
114
|
+
--BOUNDARY-DEPTH-17--
|
|
115
|
+
--BOUNDARY-DEPTH-16--
|
|
116
|
+
--BOUNDARY-DEPTH-15--
|
|
117
|
+
--BOUNDARY-DEPTH-14--
|
|
118
|
+
--BOUNDARY-DEPTH-13--
|
|
119
|
+
--BOUNDARY-DEPTH-12--
|
|
120
|
+
--BOUNDARY-DEPTH-11--
|
|
121
|
+
--BOUNDARY-DEPTH-10--
|
|
122
|
+
--BOUNDARY-DEPTH-09--
|
|
123
|
+
--BOUNDARY-DEPTH-08--
|
|
124
|
+
--BOUNDARY-DEPTH-07--
|
|
125
|
+
--BOUNDARY-DEPTH-06--
|
|
126
|
+
--BOUNDARY-DEPTH-05--
|
|
127
|
+
--BOUNDARY-DEPTH-04--
|
|
128
|
+
--BOUNDARY-DEPTH-03--
|
|
129
|
+
--BOUNDARY-DEPTH-02--
|
|
130
|
+
--BOUNDARY-DEPTH-01--
|