sisimai 4.22.5 → 4.22.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sisimai might be problematic. Click here for more details.

Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +20 -0
  3. data/README-JA.md +2 -2
  4. data/README.md +2 -2
  5. data/lib/sisimai/bite/email/amazonses.rb +3 -3
  6. data/lib/sisimai/bite/email/aol.rb +5 -5
  7. data/lib/sisimai/bite/email/biglobe.rb +5 -5
  8. data/lib/sisimai/bite/email/courier.rb +6 -17
  9. data/lib/sisimai/bite/email/domino.rb +10 -13
  10. data/lib/sisimai/bite/email/einsundeins.rb +3 -3
  11. data/lib/sisimai/bite/email/exim.rb +37 -42
  12. data/lib/sisimai/bite/email/gmx.rb +3 -3
  13. data/lib/sisimai/bite/email/google.rb +12 -14
  14. data/lib/sisimai/bite/email/gsuite.rb +7 -7
  15. data/lib/sisimai/bite/email/kddi.rb +6 -6
  16. data/lib/sisimai/bite/email/mailru.rb +31 -21
  17. data/lib/sisimai/bite/email/messagingserver.rb +3 -3
  18. data/lib/sisimai/bite/email/mxlogic.rb +55 -35
  19. data/lib/sisimai/bite/email/notes.rb +8 -9
  20. data/lib/sisimai/bite/email/office365.rb +13 -3
  21. data/lib/sisimai/bite/email/opensmtpd.rb +23 -21
  22. data/lib/sisimai/bite/email/outlook.rb +5 -5
  23. data/lib/sisimai/bite/email/qmail.rb +42 -51
  24. data/lib/sisimai/bite/email/receivingses.rb +7 -7
  25. data/lib/sisimai/bite/email/verizon.rb +6 -6
  26. data/lib/sisimai/bite/email/x4.rb +42 -51
  27. data/lib/sisimai/bite/email/yahoo.rb +5 -0
  28. data/lib/sisimai/bite/email/zoho.rb +3 -3
  29. data/lib/sisimai/data.rb +1 -0
  30. data/lib/sisimai/mda.rb +41 -45
  31. data/lib/sisimai/mime.rb +37 -12
  32. data/lib/sisimai/reason/filtered.rb +15 -22
  33. data/lib/sisimai/reason/notaccept.rb +2 -0
  34. data/lib/sisimai/reason/spamdetected.rb +1 -0
  35. data/lib/sisimai/rhost.rb +2 -1
  36. data/lib/sisimai/rhost/kddi.rb +40 -0
  37. data/lib/sisimai/smtp/error.rb +2 -12
  38. data/lib/sisimai/version.rb +1 -1
  39. data/set-of-emails/README.md +19 -9
  40. data/set-of-emails/logo/horizontalversions.png +0 -0
  41. data/set-of-emails/logo/icon.png +0 -0
  42. data/set-of-emails/maildir/bsd/arf-15.eml +57 -0
  43. data/set-of-emails/maildir/bsd/arf-16.eml +68 -0
  44. data/set-of-emails/maildir/bsd/{arf-05.eml → arf-17.eml} +29 -34
  45. data/set-of-emails/maildir/bsd/arf-18.eml +59 -0
  46. data/set-of-emails/maildir/bsd/arf-19.eml +67 -0
  47. data/set-of-emails/maildir/bsd/arf-20.eml +64 -0
  48. data/set-of-emails/maildir/bsd/arf-21.eml +57 -0
  49. data/set-of-emails/maildir/bsd/arf-22.eml +49 -0
  50. data/set-of-emails/maildir/bsd/{email-amazonworkmail-06.eml → email-amazonworkmail-08.eml} +4 -4
  51. data/set-of-emails/maildir/bsd/email-bigfoot-02.eml +66 -0
  52. data/set-of-emails/maildir/bsd/email-einsundeins-02.eml +45 -0
  53. data/set-of-emails/maildir/bsd/email-exchange2003-07.eml +63 -0
  54. data/set-of-emails/maildir/bsd/email-ezweb-07.eml +39 -0
  55. data/set-of-emails/maildir/bsd/{email-facebook-01.eml → email-facebook-03.eml} +7 -7
  56. data/set-of-emails/maildir/bsd/{email-facebook-02.eml → email-facebook-04.eml} +7 -7
  57. data/set-of-emails/maildir/bsd/email-fml-03.eml +69 -0
  58. data/set-of-emails/maildir/bsd/{email-google-02.eml → email-google-18.eml} +21 -20
  59. data/set-of-emails/maildir/bsd/email-gsuite-08.eml +231 -0
  60. data/set-of-emails/maildir/bsd/email-gsuite-09.eml +231 -0
  61. data/set-of-emails/maildir/bsd/email-gsuite-10.eml +254 -0
  62. data/set-of-emails/maildir/bsd/email-gsuite-11.eml +228 -0
  63. data/set-of-emails/maildir/bsd/email-mailmarshalsmtp-02.eml +43 -0
  64. data/set-of-emails/maildir/bsd/email-mailru-07.eml +82 -0
  65. data/set-of-emails/maildir/bsd/email-mailru-08.eml +82 -0
  66. data/set-of-emails/maildir/bsd/email-mailru-09.eml +80 -0
  67. data/set-of-emails/maildir/bsd/email-messagelabs-02.eml +72 -0
  68. data/set-of-emails/maildir/bsd/email-messagingserver-08.eml +150 -0
  69. data/set-of-emails/maildir/bsd/email-messagingserver-09.eml +153 -0
  70. data/set-of-emails/maildir/bsd/email-messagingserver-10.eml +145 -0
  71. data/set-of-emails/maildir/bsd/email-messagingserver-11.eml +151 -0
  72. data/set-of-emails/maildir/bsd/email-office365-04.eml +635 -0
  73. data/set-of-emails/maildir/bsd/email-office365-05.eml +561 -0
  74. data/set-of-emails/maildir/bsd/email-outlook-08.eml +69 -0
  75. data/set-of-emails/maildir/bsd/email-postfix-33.eml +71 -0
  76. data/set-of-emails/maildir/bsd/email-postfix-34.eml +54 -0
  77. data/set-of-emails/maildir/bsd/email-postfix-35.eml +70 -0
  78. data/set-of-emails/maildir/bsd/email-postfix-36.eml +73 -0
  79. data/set-of-emails/maildir/bsd/email-sendmail-49.eml +67 -0
  80. data/set-of-emails/maildir/bsd/email-sendmail-50.eml +67 -0
  81. data/set-of-emails/maildir/bsd/email-sendmail-51.eml +75 -0
  82. data/set-of-emails/maildir/bsd/email-sendmail-52.eml +68 -0
  83. data/set-of-emails/maildir/bsd/email-x3-05.eml +67 -0
  84. data/set-of-emails/maildir/bsd/email-x4-08.eml +36 -0
  85. data/set-of-emails/maildir/bsd/email-yahoo-06.eml +76 -0
  86. data/set-of-emails/maildir/bsd/email-yahoo-07.eml +76 -0
  87. data/set-of-emails/maildir/bsd/email-yahoo-08.eml +75 -0
  88. data/set-of-emails/maildir/bsd/email-yahoo-09.eml +76 -0
  89. data/set-of-emails/maildir/bsd/email-yahoo-10.eml +75 -0
  90. data/set-of-emails/maildir/bsd/email-yahoo-11.eml +80 -0
  91. data/set-of-emails/maildir/bsd/rfc3464-35.eml +43 -0
  92. data/set-of-emails/maildir/bsd/rfc3464-36.eml +40 -0
  93. data/set-of-emails/maildir/bsd/rfc3464-37.eml +50 -0
  94. data/set-of-emails/maildir/bsd/rfc3464-38.eml +17 -0
  95. data/set-of-emails/maildir/bsd/rfc3464-39.eml +23 -0
  96. data/set-of-emails/maildir/bsd/rfc3464-40.eml +115 -0
  97. data/set-of-emails/maildir/bsd/rhost-godaddy-03.eml +81 -0
  98. data/set-of-emails/maildir/bsd/rhost-kddi-01.eml +67 -0
  99. data/set-of-emails/maildir/bsd/rhost-kddi-02.eml +68 -0
  100. data/set-of-emails/maildir/dos/email-gsuite-01.eml +189 -0
  101. data/set-of-emails/maildir/dos/rfc3834-01.eml +22 -36
  102. data/set-of-emails/maildir/dos/rhost-franceptt-01.eml +102 -0
  103. data/set-of-emails/maildir/mac/email-gsuite-01.eml +1 -10
  104. data/set-of-emails/maildir/mac/rfc3834-01.eml +1 -1
  105. data/set-of-emails/maildir/mac/rhost-franceptt-01.eml +1 -4
  106. metadata +67 -41
  107. data/set-of-emails/maildir/bsd/arf-03.eml +0 -56
  108. data/set-of-emails/maildir/bsd/arf-04.eml +0 -89
  109. data/set-of-emails/maildir/bsd/arf-06.eml +0 -166
  110. data/set-of-emails/maildir/bsd/arf-07.eml +0 -59
  111. data/set-of-emails/maildir/bsd/arf-08.eml +0 -103
  112. data/set-of-emails/maildir/bsd/arf-09.eml +0 -104
  113. data/set-of-emails/maildir/bsd/arf-10.eml +0 -56
  114. data/set-of-emails/maildir/bsd/arf-13.eml +0 -76
  115. data/set-of-emails/maildir/bsd/email-amazonses-04.eml +0 -55
  116. data/set-of-emails/maildir/bsd/email-bigfoot-01.eml +0 -64
  117. data/set-of-emails/maildir/bsd/email-einsundeins-01.eml +0 -38
  118. data/set-of-emails/maildir/bsd/email-exchange2003-06.eml +0 -151
  119. data/set-of-emails/maildir/bsd/email-ezweb-06.eml +0 -33
  120. data/set-of-emails/maildir/bsd/email-fml-01.eml +0 -70
  121. data/set-of-emails/maildir/bsd/email-google-14.eml +0 -304
  122. data/set-of-emails/maildir/bsd/email-mailmarshalsmtp-01.eml +0 -43
  123. data/set-of-emails/maildir/bsd/email-messagelabs-01.eml +0 -76
  124. data/set-of-emails/maildir/bsd/email-outlook-05.eml +0 -85
  125. data/set-of-emails/maildir/bsd/email-postfix-12.eml +0 -71
  126. data/set-of-emails/maildir/bsd/email-postfix-21.eml +0 -60
  127. data/set-of-emails/maildir/bsd/email-x3-04.eml +0 -106
  128. data/set-of-emails/maildir/bsd/email-x4-07.eml +0 -153
  129. data/set-of-emails/maildir/bsd/rfc3464-02.eml +0 -43
  130. data/set-of-emails/maildir/bsd/rfc3464-03.eml +0 -40
  131. data/set-of-emails/maildir/bsd/rfc3464-22.eml +0 -105
  132. data/set-of-emails/maildir/bsd/rfc3464-23.eml +0 -21
  133. data/set-of-emails/maildir/bsd/rfc3464-25.eml +0 -33
  134. data/set-of-emails/maildir/bsd/rfc3464-27.eml +0 -180
  135. data/set-of-emails/maildir/bsd/rhost-godaddy-01.eml +0 -83
  136. data/set-of-emails/to-be-debugged-because/reason-is-onhold/onhold-0001.eml +0 -85
  137. data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0002.eml +0 -27
  138. data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0003.eml +0 -78
  139. data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/cannot-parse-this-email-0002.eml +0 -25
  140. data/set-of-emails/to-be-debugged-because/something-is-wrong/no-message-id-from-pr-150.eml +0 -75
@@ -15,10 +15,10 @@ module Sisimai::Bite::Email
15
15
  )
16
16
  /x,
17
17
  }.freeze
18
- ReFailures = {
19
- mailboxfull: %r/As their mailbox is full/,
20
- norelaying: %r/Due to the following SMTP relay error/,
21
- hostunknown: %r/As the remote domain doesnt exist/,
18
+ MessagesOf = {
19
+ mailboxfull: ['As their mailbox is full'],
20
+ norelaying: ['Due to the following SMTP relay error'],
21
+ hostunknown: ['As the remote domain doesnt exist'],
22
22
  }.freeze
23
23
 
24
24
  def description; return 'au by KDDI: http://www.au.kddi.com'; end
@@ -133,9 +133,9 @@ module Sisimai::Bite::Email
133
133
  e['reason'] = 'userunknown'
134
134
  else
135
135
  # SMTP command is not RCPT
136
- ReFailures.each_key do |r|
136
+ MessagesOf.each_key do |r|
137
137
  # Verify each regular expression of session errors
138
- next unless e['diagnosis'] =~ ReFailures[r]
138
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
139
139
  e['reason'] = r.to_s
140
140
  break
141
141
  end
@@ -17,25 +17,35 @@ module Sisimai::Bite::Email
17
17
  %r/SMTP error from remote (?:mail server|mailer) after ([A-Za-z]{4})/,
18
18
  %r/SMTP error from remote (?:mail server|mailer) after end of ([A-Za-z]{4})/,
19
19
  ].freeze
20
- ReFailures = {
21
- expired: %r/(?:retry timeout exceeded|No action is required on your part)/,
22
- userunknown: %r/user not found/,
23
- hostunknown: %r{(?>
24
- all[ ](?:
25
- host[ ]address[ ]lookups[ ]failed[ ]permanently
26
- |relevant[ ]MX[ ]records[ ]point[ ]to[ ]non[-]existent[ ]hosts
27
- )
28
- |Unrouteable[ ]address
29
- )
30
- }x,
31
- mailboxfull: %r/(?:mailbox is full:?|error: quota exceed)/,
32
- notaccept: %r{(?:
33
- an[ ]MX[ ]or[ ]SRV[ ]record[ ]indicated[ ]no[ ]SMTP[ ]service
34
- |no[ ]host[ ]found[ ]for[ ]existing[ ]SMTP[ ]connection
35
- )
36
- }x,
37
- systemerror: %r/(?:delivery to (?:file|pipe) forbidden|local delivery failed)/,
38
- contenterror: %r/Too many ["]Received["] headers /,
20
+ MessagesOf = {
21
+ expired: [
22
+ 'retry timeout exceeded',
23
+ 'No action is required on your part',
24
+ ],
25
+ userunknown: ['user not found'],
26
+ hostunknown: [
27
+ 'all host address lookups failed permanently',
28
+ 'all relevant MX records point to non-existent hosts',
29
+ 'Unrouteable address',
30
+ ],
31
+ mailboxfull: ['mailbox is full', 'error: quota exceed'],
32
+ notaccept: [
33
+ 'an MX or SRV record indicated no SMTP service',
34
+ 'no host found for existing SMTP connection',
35
+ ],
36
+ syntaxerror: [
37
+ 'angle-brackets nested too deep',
38
+ 'expected word or "<"',
39
+ 'domain missing in source-routed address',
40
+ 'malformed address:',
41
+ ],
42
+ systemerror: [
43
+ 'delivery to file forbidden',
44
+ 'delivery to pipe forbidden',
45
+ 'local delivery failed',
46
+ 'LMTP error after ',
47
+ ],
48
+ contenterror: ['Too many "Received" headers'],
39
49
  }.freeze
40
50
 
41
51
  def description; return '@mail.ru: https://mail.ru'; end
@@ -230,9 +240,9 @@ module Sisimai::Bite::Email
230
240
  e['reason'] = 'rejected'
231
241
  else
232
242
  # Verify each regular expression of session errors
233
- ReFailures.each_key do |r|
243
+ MessagesOf.each_key do |r|
234
244
  # Check each regular expression
235
- next unless e['diagnosis'] =~ ReFailures[r]
245
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
236
246
  e['reason'] = r.to_s
237
247
  break
238
248
  end
@@ -11,7 +11,7 @@ module Sisimai::Bite::Email
11
11
  Indicators = Sisimai::Bite::Email.INDICATORS
12
12
  StartingOf = { message: ['This report relates to a message you sent with the following header fields:'] }.freeze
13
13
  MarkingsOf = { rfc822: %r!\A(?:Content-type:[ ]*message/rfc822|Return-path:[ ]*)! }.freeze
14
- ReFailures = { hostunknown: %r|Illegal host/domain name found| }.freeze
14
+ MessagesOf = { hostunknown: ['Illegal host/domain name found'] }.freeze
15
15
 
16
16
  def description; return 'Oracle Communications Messaging Server'; end
17
17
  def smtpagent; return Sisimai::Bite.smtpagent(self); end
@@ -175,9 +175,9 @@ module Sisimai::Bite::Email
175
175
  e['agent'] = self.smtpagent
176
176
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
177
177
 
178
- ReFailures.each_key do |r|
178
+ MessagesOf.each_key do |r|
179
179
  # Verify each regular expression of session errors
180
- next unless e['diagnosis'] =~ ReFailures[r]
180
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
181
181
  e['reason'] = r.to_s
182
182
  break
183
183
  end
@@ -18,39 +18,59 @@ module Sisimai::Bite::Email
18
18
  %r/SMTP error from remote (?:mail server|mailer) after ([A-Za-z]{4})/,
19
19
  %r/SMTP error from remote (?:mail server|mailer) after end of ([A-Za-z]{4})/,
20
20
  ].freeze
21
- ReFailures = {
22
- userunknown: %r/user not found/,
23
- hostunknown: %r{(?>
24
- all[ ](?:
25
- host[ ]address[ ]lookups[ ]failed[ ]permanently
26
- |relevant[ ]MX[ ]records[ ]point[ ]to[ ]non[-]existent[ ]hosts
27
- )
28
- |Unrouteable[ ]address
29
- )
30
- }x,
31
- mailboxfull: %r/(?:mailbox is full:?|error: quota exceed)/,
32
- notaccept: %r{(?:
33
- an[ ]MX[ ]or[ ]SRV[ ]record[ ]indicated[ ]no[ ]SMTP[ ]service
34
- |no[ ]host[ ]found[ ]for[ ]existing[ ]SMTP[ ]connection
35
- )
36
- }x,
37
- systemerror: %r{(?>
38
- delivery[ ]to[ ](?:file|pipe)[ ]forbidden
39
- |local[ ]delivery[ ]failed
40
- |LMTP[ ]error[ ]after[ ]
41
- )
42
- }x,
43
- contenterror: %r/Too many ["]Received["] headers/,
21
+ MessagesOf = {
22
+ # find exim/ -type f -exec grep 'message = US' {} /dev/null \;
23
+ # route.c:1158| DEBUG(D_uid) debug_printf("getpwnam() returned NULL (user not found)\n");
24
+ userunknown: ['user not found'],
25
+ # transports/smtp.c:3524| addr->message = US"all host address lookups failed permanently";
26
+ # routers/dnslookup.c:331| addr->message = US"all relevant MX records point to non-existent hosts";
27
+ # route.c:1826| uschar *message = US"Unrouteable address";
28
+ hostunknown: [
29
+ 'all host address lookups failed permanently',
30
+ 'all relevant MX records point to non-existent hosts',
31
+ 'Unrouteable address',
32
+ ],
33
+ # transports/appendfile.c:2567| addr->user_message = US"mailbox is full";
34
+ # transports/appendfile.c:3049| addr->message = string_sprintf("mailbox is full "
35
+ # transports/appendfile.c:3050| "(quota exceeded while writing to file %s)", filename);
36
+ mailboxfull: ['mailbox is full', 'error: quota exceed'],
37
+ # routers/dnslookup.c:328| addr->message = US"an MX or SRV record indicated no SMTP service";
38
+ # transports/smtp.c:3502| addr->message = US"no host found for existing SMTP connection";
39
+ notaccept: [
40
+ 'an MX or SRV record indicated no SMTP service',
41
+ 'no host found for existing SMTP connection',
42
+ ],
43
+ # parser.c:666| *errorptr = string_sprintf("%s (expected word or \"<\")", *errorptr);
44
+ # parser.c:701| if(bracket_count++ > 5) FAILED(US"angle-brackets nested too deep");
45
+ # parser.c:738| FAILED(US"domain missing in source-routed address");
46
+ # parser.c:747| : string_sprintf("malformed address: %.32s may not follow %.*s",
47
+ syntaxerror: [
48
+ 'angle-brackets nested too deep',
49
+ 'expected word or "<"',
50
+ 'domain missing in source-routed address',
51
+ 'malformed address:',
52
+ ],
53
+ # deliver.c:5614| addr->message = US"delivery to file forbidden";
54
+ # deliver.c:5624| addr->message = US"delivery to pipe forbidden";
55
+ # transports/pipe.c:1156| addr->user_message = US"local delivery failed";
56
+ systemerror: [
57
+ 'delivery to file forbidden',
58
+ 'delivery to pipe forbidden',
59
+ 'local delivery failed',
60
+ 'LMTP error after ',
61
+ ],
62
+ # deliver.c:5425| new->message = US"Too many \"Received\" headers - suspected mail loop";
63
+ contenterror: ['Too many "Received" headers'],
44
64
  }.freeze
45
- ReDelaying = %r{(?:
46
- retry[ ]timeout[ ]exceeded
47
- |No[ ]action[ ]is[ ]required[ ]on[ ]your[ ]part
48
- |retry[ ]time[ ]not[ ]reached[ ]for[ ]any[ ]host[ ]after[ ]a[ ]long[ ]failure[ ]period
49
- |all[ ]hosts[ ]have[ ]been[ ]failing[ ]for[ ]a[ ]long[ ]time[ ]and[ ]were[ ]last[ ]tried
50
- |Delay[ ]reason:[ ]
51
- |Message[ ].+[ ](?:has[ ]been[ ]frozen|was[ ]frozen[ ]on[ ]arrival[ ]by[ ])
52
- )
53
- }x
65
+ DelayedFor = [
66
+ 'retry timeout exceeded',
67
+ 'No action is required on your part',
68
+ 'retry time not reached for any host after a long failure period',
69
+ 'all hosts have been failing for a long time and were last tried',
70
+ 'Delay reason: ',
71
+ 'has been frozen',
72
+ 'was frozen on arrival by ',
73
+ ].freeze
54
74
 
55
75
  def description; return 'McAfee SaaS'; end
56
76
  def smtpagent; return Sisimai::Bite.smtpagent(self); end
@@ -209,16 +229,16 @@ module Sisimai::Bite::Email
209
229
  e['reason'] = 'blocked'
210
230
  else
211
231
  # Verify each regular expression of session errors
212
- ReFailures.each_key do |r|
232
+ MessagesOf.each_key do |r|
213
233
  # Check each regular expression
214
- next unless e['diagnosis'] =~ ReFailures[r]
234
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
215
235
  e['reason'] = r.to_s
216
236
  break
217
237
  end
218
238
 
219
239
  unless e['reason']
220
240
  # The reason "expired"
221
- e['reason'] = 'expired' if e['diagnosis'] =~ ReDelaying
241
+ e['reason'] = 'expired' if DelayedFor.find { |a| e['diagnosis'].include?(a) }
222
242
  end
223
243
  end
224
244
  end
@@ -11,13 +11,12 @@ module Sisimai::Bite::Email
11
11
  message: ['------- Failure Reasons '],
12
12
  rfc822: ['------- Returned Message '],
13
13
  }.freeze
14
- ReFailures = {
15
- userunknown: %r{(?:
16
- User[ ]not[ ]listed[ ]in[ ]public[ ]Name[ ][&][ ]Address[ ]Book
17
- |ディレクトリのリストにありません
18
- )
19
- }x,
20
- networkerror: %r/Message has exceeded maximum hop count/,
14
+ MessagesOf = {
15
+ userunknown: [
16
+ 'User not listed in public Name & Address Book',
17
+ 'ディレクトリのリストにありません',
18
+ ],
19
+ networkerror: ['Message has exceeded maximum hop count'],
21
20
  }.freeze
22
21
 
23
22
  def description; return 'Lotus Notes'; end
@@ -152,9 +151,9 @@ module Sisimai::Bite::Email
152
151
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
153
152
  e['recipient'] = Sisimai::Address.s3s4(e['recipient'])
154
153
 
155
- ReFailures.each_key do |r|
154
+ MessagesOf.each_key do |r|
156
155
  # Check each regular expression of Notes error messages
157
- next unless e['diagnosis'] =~ ReFailures[r]
156
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
158
157
  e['reason'] = r.to_s
159
158
  pseudostatus = Sisimai::SMTP::Status.code(r.to_s)
160
159
  e['status'] = pseudostatus if pseudostatus.size > 0
@@ -46,6 +46,9 @@ module Sisimai::Bite::Email
46
46
  %r/\A5[.]7[.]6[1-4]\d\z/ => 'blocked',
47
47
  %r/\A5[.]7[.]7[0-4]\d\z/ => 'toomanyconn',
48
48
  }.freeze
49
+ ReCommands = {
50
+ RCPT: %r/unknown recipient or mailbox unavailable ->.+[<].+[@].+[>]/,
51
+ }.freeze
49
52
 
50
53
  def description; return 'Microsoft Office 365: http://office.microsoft.com/'; end
51
54
  def smtpagent; return Sisimai::Bite.smtpagent(self); end
@@ -143,9 +146,9 @@ module Sisimai::Bite::Email
143
146
  next if e.empty?
144
147
 
145
148
  # kijitora@example.com<mailto:kijitora@example.com>
146
- # The email address wasn=92t found at the destination domain. It might be mis=
147
- # spelled or it might not exist any longer. Try retyping the address and rese=
148
- # nding the message.
149
+ # The email address wasn't found at the destination domain. It might
150
+ # be misspelled or it might not exist any longer. Try retyping the
151
+ # address and resending the message.
149
152
  v = dscontents[-1]
150
153
 
151
154
  if cv = e.match(/\A.+[@].+[<]mailto:(.+[@].+)[>]\z/)
@@ -231,6 +234,13 @@ module Sisimai::Bite::Email
231
234
  pseudostatus = Sisimai::SMTP::Status.find(e['diagnosis'])
232
235
  e['status'] = pseudostatus if pseudostatus.size > 0
233
236
  end
237
+
238
+ ReCommands.each_key do |p|
239
+ # Try to match with regular expressions defined in ReCommands
240
+ next unless e['diagnosis'] =~ ReCommands[p]
241
+ e['command'] = p.to_s
242
+ break
243
+ end
234
244
  next unless e['status']
235
245
 
236
246
  StatusList.each_key do |f|
@@ -36,31 +36,33 @@ module Sisimai::Bite::Email
36
36
  message: [' This is the MAILER-DAEMON, please DO NOT REPLY to this '],
37
37
  rfc822: [' Below is a copy of the original message:'],
38
38
  }.freeze
39
- ReFailures = {
39
+ MessagesOf = {
40
40
  # smtpd/queue.c:221| envelope_set_errormsg(&evp, "Envelope expired");
41
- expired: %r/Envelope expired/,
41
+ expired: ['Envelope expired'],
42
42
  # smtpd/mta.c:976| relay->failstr = "Invalid domain name";
43
43
  # smtpd/mta.c:980| relay->failstr = "Domain does not exist";
44
- hostunknown: %r/(?:Invalid domain name|Domain does not exist)/,
44
+ hostunknown: [
45
+ 'Invalid domain name',
46
+ 'Domain does not exist',
47
+ ],
45
48
  # smtp/mta.c:1085| relay->failstr = "Destination seem to reject all mails";
46
- notaccept: %r/Destination seem to reject all mails/,
49
+ notaccept: ['Destination seem to reject all mails'],
47
50
  # smtpd/mta.c:972| relay->failstr = "Temporary failure in MX lookup";
48
- networkerror: %r{(?>
49
- Address[ ]family[ ]mismatch[ ]on[ ]destination[ ]MXs
50
- |All[ ]routes[ ]to[ ]destination[ ]blocked
51
- |bad[ ]DNS[ ]lookup[ ]error[ ]code
52
- |Could[ ]not[ ]retrieve[ ]source[ ]address
53
- |Loop[ ]detected
54
- |Network[ ]error[ ]on[ ]destination[ ]MXs
55
- |No[ ](?>
56
- MX[ ]found[ ]for[ ](?:domain|destination)
57
- |valid[ ]route[ ]to[ ](?:remote[ ]MX|destination)
58
- )
59
- |Temporary[ ]failure[ ]in[ ]MX[ ]lookup
60
- )
61
- }x,
51
+ networkerror: [
52
+ 'Address family mismatch on destination MXs',
53
+ 'All routes to destination blocked',
54
+ 'bad DNS lookup error code',
55
+ 'Could not retrieve source address',
56
+ 'Loop detected',
57
+ 'Network error on destination MXs',
58
+ 'No MX found for domain',
59
+ 'No MX found for destination',
60
+ 'No valid route to remote MX',
61
+ 'No valid route to destination',
62
+ 'Temporary failure in MX lookup',
63
+ ],
62
64
  # smtpd/mta.c:1013| relay->failstr = "Could not retrieve credentials";
63
- securityerror: %r/Could not retrieve credentials/,
65
+ securityerror: ['Could not retrieve credentials'],
64
66
  }.freeze
65
67
 
66
68
  def description; return 'OpenSMTPD'; end
@@ -156,9 +158,9 @@ module Sisimai::Bite::Email
156
158
  e['agent'] = self.smtpagent
157
159
  e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
158
160
 
159
- ReFailures.each_key do |r|
161
+ MessagesOf.each_key do |r|
160
162
  # Verify each regular expression of session errors
161
- next unless e['diagnosis'] =~ ReFailures[r]
163
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
162
164
  e['reason'] = r.to_s
163
165
  break
164
166
  end
@@ -12,9 +12,9 @@ module Sisimai::Bite::Email
12
12
  message: ['This is an automatically generated Delivery Status Notification'],
13
13
  rfc822: ['Content-Type: message/rfc822'],
14
14
  }.freeze
15
- ReFailures = {
16
- hostunknown: %r/The mail could not be delivered to the recipient because the domain is not reachable/,
17
- userunknown: %r/Requested action not taken: mailbox unavailable/,
15
+ MessagesOf = {
16
+ hostunknown: ['The mail could not be delivered to the recipient because the domain is not reachable'],
17
+ userunknown: ['Requested action not taken: mailbox unavailable'],
18
18
  }.freeze
19
19
 
20
20
  def description; return 'Microsoft Outlook.com: https://www.outlook.com/'; end
@@ -177,9 +177,9 @@ module Sisimai::Bite::Email
177
177
  end
178
178
  end
179
179
 
180
- ReFailures.each_key do |r|
180
+ MessagesOf.each_key do |r|
181
181
  # Verify each regular expression of session errors
182
- next unless e['diagnosis'] =~ ReFailures[r]
182
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
183
183
  e['reason'] = r.to_s
184
184
  break
185
185
  end
@@ -50,62 +50,53 @@ module Sisimai::Bite::Email
50
50
  |remote[ ]host[ ]([-0-9a-zA-Z.]+[0-9a-zA-Z])[ ]said:
51
51
  )
52
52
  }x
53
- ReLDAP = {
54
- # qmail-ldap-1.03-20040101.patch:19817 - 19866
55
- suspend: %r/Mailaddress is administrative?le?y disabled/, # 5.2.1
56
- userunknown: %r/[Ss]orry, no mailbox here by that name/, # 5.1.1
57
- exceedlimit: %r/The message exeeded the maximum size the user accepts/, # 5.2.3
58
- systemerror: %r{(?>
59
- Automatic[ ]homedir[ ]creator[ ]crashed # 4.3.0
60
- |Illegal[ ]value[ ]in[ ]LDAP[ ]attribute # 5.3.5
61
- |LDAP[ ]attribute[ ]is[ ]not[ ]given[ ]but[ ]mandatory # 5.3.5
62
- |Timeout[ ]while[ ]performing[ ]search[ ]on[ ]LDAP[ ]server # 4.4.3
63
- |Too[ ]many[ ]results[ ]returned[ ]but[ ]needs[ ]to[ ]be[ ]unique # 5.3.5
64
- |Permanent[ ]error[ ]while[ ]executing[ ]qmail[-]forward # 5.4.4
65
- |Temporary[ ](?:
66
- error[ ](?:
67
- in[ ]automatic[ ]homedir[ ]creation # 4.3.0 or 5.3.0
68
- |while[ ]executing[ ]qmail[-]forward # 4.4.4
69
- )
70
- |failure[ ]in[ ]LDAP[ ]lookup # 4.4.3
71
- )
72
- |Unable[ ]to[ ](?:
73
- contact[ ]LDAP[ ]server # 4.4.3
74
- |login[ ]into[ ]LDAP[ ]server,[ ]bad[ ]credentials # 4.4.3
75
- )
76
- )
77
- }x,
78
- }.freeze
79
53
 
80
54
  # qmail-send.c:922| ... (&dline[c],"I'm not going to try again; this message has been in the queue too long.\n")) nomem();
81
- ReDelaying = %r/this message has been in the queue too long[.]\z/
55
+ HasExpired = 'this message has been in the queue too long.'
82
56
  ReCommands = %r/Sorry, no SMTP connection got far enough; most progress was ([A-Z]{4}) /
83
57
  ReIsOnHold = %r/\A[^ ]+ does not like recipient[.][ ]+.+this message has been in the queue too long[.]\z/
84
- ReFailures = {
58
+ FailOnLDAP = {
59
+ # qmail-ldap-1.03-20040101.patch:19817 - 19866
60
+ suspend: ['Mailaddress is administrative?le?y disabled'], # 5.2.1
61
+ userunknown: ['Sorry, no mailbox here by that name'], # 5.1.1
62
+ exceedlimit: ['The message exeeded the maximum size the user accepts'], # 5.2.3
63
+ systemerror: [
64
+ 'Automatic homedir creator crashed', # 4.3.0
65
+ 'Illegal value in LDAP attribute', # 5.3.5
66
+ 'LDAP attribute is not given but mandatory', # 5.3.5
67
+ 'Timeout while performing search on LDAP server', # 4.4.3
68
+ 'Too many results returned but needs to be unique', # 5.3.5
69
+ 'Permanent error while executing qmail-forward', # 5.4.4
70
+ 'Temporary error in automatic homedir creation', # 4.3.0 or 5.3.0
71
+ 'Temporary error while executing qmail-forward', # 4.4.4
72
+ 'Temporary failure in LDAP lookup', # 4.4.3
73
+ 'Unable to contact LDAP server', # 4.4.3
74
+ 'Unable to login into LDAP server, bad credentials',# 4.4.3
75
+ ],
76
+ }.freeze
77
+ MessagesOf = {
85
78
  # qmail-local.c:589| strerr_die1x(100,"Sorry, no mailbox here by that name. (#5.1.1)");
86
79
  # qmail-remote.c:253| out("s"); outhost(); out(" does not like recipient.\n");
87
- userunknown: %r/(?:no mailbox here by that name| does not like recipient[.])/,
80
+ userunknown: ['no mailbox here by that name', 'does not like recipient.'],
88
81
  # error_str.c:192| X(EDQUOT,"disk quota exceeded")
89
- mailboxfull: %r/disk quota exceeded/,
82
+ mailboxfull: ['disk quota exceeded'],
90
83
  # qmail-qmtpd.c:233| ... result = "Dsorry, that message size exceeds my databytes limit (#5.3.4)";
91
84
  # qmail-smtpd.c:391| ... out("552 sorry, that message size exceeds my databytes limit (#5.3.4)\r\n"); return;
92
- mesgtoobig: %r/Message size exceeds fixed maximum message size:/,
85
+ mesgtoobig: ['Message size exceeds fixed maximum message size:'],
93
86
  # qmail-remote.c:68| Sorry, I couldn't find any host by that name. (#4.1.2)\n"); zerodie();
94
87
  # qmail-remote.c:78| Sorry, I couldn't find any host named ");
95
- hostunknown: %r/\ASorry, I couldn't find any host /,
96
- systemfull: %r/Requested action not taken: mailbox unavailable [(]not enough free space[)]/,
97
- systemerror: %r{(?>
98
- bad[ ]interpreter:[ ]No[ ]such[ ]file[ ]or[ ]directory
99
- |system[ ]error
100
- |Unable[ ]to\b
101
- )
102
- }x,
103
- networkerror: %r{Sorry(?:
104
- [,][ ]I[ ]wasn[']t[ ]able[ ]to[ ]establish[ ]an[ ]SMTP[ ]connection
105
- |[,][ ]I[ ]couldn[']t[ ]find[ ]a[ ]mail[ ]exchanger[ ]or[ ]IP[ ]address
106
- |[.][ ]Although[ ]I[']m[ ]listed[ ]as[ ]a[ ]best[-]preference[ ]MX[ ]or[ ]A[ ]for[ ]that[ ]host
107
- )
108
- }x,
88
+ hostunknown: ["Sorry, I couldn't find any host "],
89
+ systemfull: ['Requested action not taken: mailbox unavailable (not enough free space)'],
90
+ systemerror: [
91
+ 'bad interpreter: No such file or directory',
92
+ 'system error',
93
+ 'Unable to',
94
+ ],
95
+ networkerror: [
96
+ "Sorry, I wasn't able to establish an SMTP connection",
97
+ "Sorry, I couldn't find a mail exchanger or IP address",
98
+ "Sorry. Although I'm listed as a best-preference MX or A for that host",
99
+ ],
109
100
  }.freeze
110
101
 
111
102
  def description; return 'qmail'; end
@@ -246,31 +237,31 @@ module Sisimai::Bite::Email
246
237
  # Sisimai::Reason::* modules
247
238
  e['reason'] = 'onhold'
248
239
  else
249
- ReFailures.each_key do |r|
240
+ MessagesOf.each_key do |r|
250
241
  # Verify each regular expression of session errors
251
242
  if e['alterrors']
252
243
  # Check the value of "alterrors"
253
- next unless e['alterrors'] =~ ReFailures[r]
244
+ next unless MessagesOf[r].find { |a| e['alterrors'].include?(a) }
254
245
  e['reason'] = r.to_s
255
246
  end
256
247
  break if e['reason']
257
248
 
258
- next unless e['diagnosis'] =~ ReFailures[r]
249
+ next unless MessagesOf[r].find { |a| e['diagnosis'].include?(a) }
259
250
  e['reason'] = r.to_s
260
251
  break
261
252
  end
262
253
 
263
254
  unless e['reason']
264
- ReLDAP.each_key do |r|
255
+ FailOnLDAP.each_key do |r|
265
256
  # Verify each regular expression of LDAP errors
266
- next unless e['diagnosis'] =~ ReLDAP[r]
257
+ next unless FailOnLDAP[r].find { |a| e['diagnosis'].include?(a) }
267
258
  e['reason'] = r.to_s
268
259
  break
269
260
  end
270
261
  end
271
262
 
272
263
  unless e['reason']
273
- e['reason'] = 'expired' if e['diagnosis'] =~ ReDelaying
264
+ e['reason'] = 'expired' if e['diagnosis'].include?(HasExpired)
274
265
  end
275
266
  end
276
267
  end