sisimai 5.4.0 → 5.5.0

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.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/codecovio.yml +1 -1
  3. data/.github/workflows/rake-test.yml +1 -1
  4. data/ChangeLog.md +45 -0
  5. data/Makefile +2 -4
  6. data/README-JA.md +23 -20
  7. data/README.md +23 -20
  8. data/lib/sisimai/address.rb +92 -44
  9. data/lib/sisimai/arf.rb +7 -8
  10. data/lib/sisimai/datetime.rb +2 -2
  11. data/lib/sisimai/fact/json.rb +1 -2
  12. data/lib/sisimai/fact/yaml.rb +1 -2
  13. data/lib/sisimai/fact.rb +60 -35
  14. data/lib/sisimai/lda.rb +2 -2
  15. data/lib/sisimai/lhost/activehunter.rb +4 -5
  16. data/lib/sisimai/lhost/amazonses.rb +3 -4
  17. data/lib/sisimai/lhost/apachejames.rb +2 -2
  18. data/lib/sisimai/lhost/biglobe.rb +6 -6
  19. data/lib/sisimai/lhost/courier.rb +7 -7
  20. data/lib/sisimai/lhost/domino.rb +6 -6
  21. data/lib/sisimai/lhost/dragonfly.rb +5 -5
  22. data/lib/sisimai/lhost/einsundeins.rb +4 -4
  23. data/lib/sisimai/lhost/exchange2003.rb +7 -7
  24. data/lib/sisimai/lhost/exchange2007.rb +3 -3
  25. data/lib/sisimai/lhost/exim.rb +7 -7
  26. data/lib/sisimai/lhost/ezweb.rb +3 -2
  27. data/lib/sisimai/lhost/fml.rb +9 -9
  28. data/lib/sisimai/lhost/gmail.rb +9 -9
  29. data/lib/sisimai/lhost/gmx.rb +3 -3
  30. data/lib/sisimai/lhost/googlegroups.rb +6 -7
  31. data/lib/sisimai/lhost/googleworkspace.rb +5 -6
  32. data/lib/sisimai/lhost/imailserver.rb +4 -4
  33. data/lib/sisimai/lhost/kddi.rb +4 -4
  34. data/lib/sisimai/lhost/mailfoundry.rb +3 -3
  35. data/lib/sisimai/lhost/{mailmarshalsmtp.rb → mailmarshal.rb} +5 -5
  36. data/lib/sisimai/lhost/messagingserver.rb +8 -8
  37. data/lib/sisimai/lhost/mfilter.rb +8 -4
  38. data/lib/sisimai/lhost/mimecast.rb +105 -0
  39. data/lib/sisimai/lhost/notes.rb +5 -5
  40. data/lib/sisimai/lhost/opensmtpd.rb +5 -5
  41. data/lib/sisimai/lhost/postfix.rb +38 -32
  42. data/lib/sisimai/lhost/qmail.rb +6 -6
  43. data/lib/sisimai/lhost/sendmail.rb +13 -13
  44. data/lib/sisimai/lhost/{interscanmss.rb → trendmicro.rb} +8 -9
  45. data/lib/sisimai/lhost/v5sendmail.rb +7 -7
  46. data/lib/sisimai/lhost/verizon.rb +3 -3
  47. data/lib/sisimai/lhost/x1.rb +7 -4
  48. data/lib/sisimai/lhost/x2.rb +40 -12
  49. data/lib/sisimai/lhost/x3.rb +3 -3
  50. data/lib/sisimai/lhost/x6.rb +2 -2
  51. data/lib/sisimai/lhost/zoho.rb +5 -5
  52. data/lib/sisimai/lhost.rb +18 -17
  53. data/lib/sisimai/mail/maildir.rb +4 -4
  54. data/lib/sisimai/mail/mbox.rb +4 -4
  55. data/lib/sisimai/mail/memory.rb +1 -1
  56. data/lib/sisimai/mail/stdin.rb +2 -2
  57. data/lib/sisimai/message.rb +34 -34
  58. data/lib/sisimai/order.rb +5 -4
  59. data/lib/sisimai/reason/authfailure.rb +1 -1
  60. data/lib/sisimai/reason/badreputation.rb +1 -1
  61. data/lib/sisimai/reason/blocked.rb +2 -1
  62. data/lib/sisimai/reason/contenterror.rb +1 -2
  63. data/lib/sisimai/reason/exceedlimit.rb +1 -1
  64. data/lib/sisimai/reason/expired.rb +1 -1
  65. data/lib/sisimai/reason/failedstarttls.rb +1 -1
  66. data/lib/sisimai/reason/filtered.rb +1 -1
  67. data/lib/sisimai/reason/hasmoved.rb +1 -1
  68. data/lib/sisimai/reason/hostunknown.rb +2 -2
  69. data/lib/sisimai/reason/mailboxfull.rb +1 -1
  70. data/lib/sisimai/reason/mailererror.rb +1 -1
  71. data/lib/sisimai/reason/mesgtoobig.rb +1 -1
  72. data/lib/sisimai/reason/networkerror.rb +1 -1
  73. data/lib/sisimai/reason/norelaying.rb +2 -2
  74. data/lib/sisimai/reason/notaccept.rb +2 -3
  75. data/lib/sisimai/reason/notcompliantrfc.rb +1 -1
  76. data/lib/sisimai/reason/policyviolation.rb +2 -4
  77. data/lib/sisimai/reason/rejected.rb +5 -3
  78. data/lib/sisimai/reason/requireptr.rb +1 -1
  79. data/lib/sisimai/reason/securityerror.rb +1 -1
  80. data/lib/sisimai/reason/spamdetected.rb +1 -1
  81. data/lib/sisimai/reason/speeding.rb +1 -1
  82. data/lib/sisimai/reason/suspend.rb +2 -1
  83. data/lib/sisimai/reason/systemerror.rb +1 -1
  84. data/lib/sisimai/reason/systemfull.rb +1 -1
  85. data/lib/sisimai/reason/toomanyconn.rb +1 -1
  86. data/lib/sisimai/reason/userunknown.rb +4 -3
  87. data/lib/sisimai/reason/vacation.rb +1 -1
  88. data/lib/sisimai/reason/virusdetected.rb +1 -1
  89. data/lib/sisimai/reason.rb +12 -12
  90. data/lib/sisimai/rfc1123.rb +58 -18
  91. data/lib/sisimai/rfc1894.rb +6 -8
  92. data/lib/sisimai/rfc2045.rb +25 -13
  93. data/lib/sisimai/rfc3464/thirdparty.rb +2 -3
  94. data/lib/sisimai/rfc3464.rb +6 -6
  95. data/lib/sisimai/rfc3834.rb +18 -8
  96. data/lib/sisimai/rfc5322.rb +9 -9
  97. data/lib/sisimai/rfc791.rb +2 -2
  98. data/lib/sisimai/rhost/aol.rb +4 -1
  99. data/lib/sisimai/rhost/apple.rb +11 -7
  100. data/lib/sisimai/rhost/cox.rb +9 -5
  101. data/lib/sisimai/rhost/facebook.rb +9 -3
  102. data/lib/sisimai/rhost/franceptt.rb +86 -37
  103. data/lib/sisimai/rhost/godaddy.rb +10 -1
  104. data/lib/sisimai/rhost/google.rb +26 -22
  105. data/lib/sisimai/rhost/gsuite.rb +1 -1
  106. data/lib/sisimai/rhost/kddi.rb +1 -1
  107. data/lib/sisimai/rhost/messagelabs.rb +160 -2
  108. data/lib/sisimai/rhost/microsoft.rb +80 -29
  109. data/lib/sisimai/rhost/mimecast.rb +30 -21
  110. data/lib/sisimai/rhost/nttdocomo.rb +69 -89
  111. data/lib/sisimai/rhost/outlook.rb +1 -1
  112. data/lib/sisimai/rhost/spectrum.rb +1 -1
  113. data/lib/sisimai/rhost/tencent.rb +5 -4
  114. data/lib/sisimai/rhost/yahooinc.rb +2 -2
  115. data/lib/sisimai/rhost/zoho.rb +72 -0
  116. data/lib/sisimai/rhost.rb +5 -4
  117. data/lib/sisimai/smtp/command.rb +2 -2
  118. data/lib/sisimai/smtp/reply.rb +11 -4
  119. data/lib/sisimai/smtp/status.rb +17 -8
  120. data/lib/sisimai/smtp/transcript.rb +3 -3
  121. data/lib/sisimai/string.rb +6 -10
  122. data/lib/sisimai/version.rb +1 -1
  123. data/lib/sisimai.rb +1 -1
  124. data/set-of-emails/maildir/bsd/lhost-exim-56.eml +40 -40
  125. data/set-of-emails/maildir/bsd/lhost-mfilter-05.eml +41 -0
  126. data/set-of-emails/maildir/bsd/lhost-mimecast-01.eml +46 -0
  127. data/set-of-emails/maildir/bsd/lhost-mimecast-02.eml +59 -0
  128. data/set-of-emails/maildir/bsd/lhost-postfix-79.eml +81 -0
  129. data/set-of-emails/maildir/bsd/lhost-postfix-80.eml +84 -0
  130. data/set-of-emails/maildir/bsd/lhost-x1-03.eml +26 -0
  131. data/set-of-emails/maildir/bsd/lhost-x1-04.eml +45 -0
  132. data/set-of-emails/maildir/bsd/lhost-x2-07.eml +30 -0
  133. data/set-of-emails/maildir/bsd/rfc3464-66.eml +170 -0
  134. data/set-of-emails/maildir/bsd/rfc3834-06.eml +59 -0
  135. data/set-of-emails/maildir/bsd/rhost-apple-05.eml +96 -0
  136. data/set-of-emails/maildir/bsd/rhost-zoho-01.eml +88 -0
  137. data/set-of-emails/maildir/bsd/rhost-zoho-02.eml +86 -0
  138. data/set-of-emails/maildir/bsd/rhost-zoho-03.eml +87 -0
  139. data/set-of-emails/maildir/bsd/rhost-zoho-04.eml +86 -0
  140. data/set-of-emails/maildir/not/rb-issue-368-bug.eml +39 -0
  141. data/sisimai-java.gemspec +1 -1
  142. data/sisimai.gemspec +1 -1
  143. metadata +27 -9
  144. /data/set-of-emails/maildir/bsd/{lhost-mailmarshalsmtp-02.eml → lhost-mailmarshal-02.eml} +0 -0
  145. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-01.eml → lhost-trendmicro-01.eml} +0 -0
  146. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-02.eml → lhost-trendmicro-02.eml} +0 -0
  147. /data/set-of-emails/maildir/bsd/{lhost-interscanmss-03.eml → lhost-trendmicro-03.eml} +0 -0
data/lib/sisimai/rhost.rb CHANGED
@@ -6,7 +6,7 @@ module Sisimai
6
6
  class << self
7
7
  RhostClass = {
8
8
  "Aol" => [".mail.aol.com", ".mx.aol.com"],
9
- "Apple" => [".mail.icloud.com", ".apple.com", ".me.com"],
9
+ "Apple" => [".mail.icloud.com", ".apple.com", ".me.com", "privaterelay.appleid.com"],
10
10
  "Cloudflare" => [".mx.cloudflare.net"],
11
11
  "Cox" => ["cox.net"],
12
12
  "Facebook" => [".facebook.com"],
@@ -24,6 +24,7 @@ module Sisimai
24
24
  "Spectrum" => ["charter.net"],
25
25
  "Tencent" => [".qq.com"],
26
26
  "YahooInc" => [".yahoodns.net"],
27
+ "Zoho" => [".zoho.com", ".zoho.eu"],
27
28
  }.freeze
28
29
 
29
30
  # Returns the rhost class name
@@ -44,14 +45,14 @@ module Sisimai
44
45
  # 3. lhost: local MTA hostname
45
46
  RhostClass.each_key do |e|
46
47
  # Try to match the domain part of the recipient address with each value of RhostClass
47
- next unless RhostClass[e].any? { |a| a.end_with?(domainpart) }
48
+ next if RhostClass[e].none? { |a| a.end_with?(domainpart) }
48
49
  rhostclass = e
49
50
  throw :FINDRHOST
50
51
  end
51
52
 
52
53
  RhostClass.each_key do |e|
53
54
  # Try to match the remote host with each value of RhostClass
54
- next unless RhostClass[e].any? { |a| remotehost.end_with?(a) }
55
+ next if RhostClass[e].none? { |a| remotehost.end_with?(a) }
55
56
  rhostclass = e
56
57
  throw :FINDRHOST
57
58
  end
@@ -59,7 +60,7 @@ module Sisimai
59
60
  # Neither the remote host nor the destination did not matched with any value of RhostClass
60
61
  RhostClass.each_key do |e|
61
62
  # Try to match the client host with each value of RhostClass
62
- next unless RhostClass[e].any? { |a| clienthost.end_with?(a) }
63
+ next if RhostClass[e].none? { |a| clienthost.end_with?(a) }
63
64
  rhostclass = e
64
65
  throw :FINDRHOST
65
66
  end
@@ -28,7 +28,7 @@ module Sisimai
28
28
  # @return [String] An SMTP command
29
29
  # @since v5.0.0
30
30
  def find(argv0 = '')
31
- return "" unless Sisimai::SMTP::Command.test(argv0)
31
+ return "" if Sisimai::SMTP::Command.test(argv0) == false
32
32
 
33
33
  issuedcode = " " + argv0.downcase + " "
34
34
  commandmap = {"STAR" => "STARTTLS", "XFOR" => "XFORWARD"}
@@ -36,7 +36,7 @@ module Sisimai
36
36
 
37
37
  Detectable.each do |e|
38
38
  # Find an SMTP command from the given string
39
- p0 = argv0.index(e); next unless p0
39
+ p0 = argv0.index(e); next if p0.nil?
40
40
  if e.include?(" ") == false
41
41
  # For example, "RCPT T" does not appear in an email address or a domain name
42
42
  cx = true; while true do
@@ -113,18 +113,25 @@ module Sisimai
113
113
  Associated = {
114
114
  "422" => ["AUTH", "4.7.12", "securityerror"], # RFC5238
115
115
  "432" => ["AUTH", "4.7.12", "securityerror"], # RFC4954, RFC5321
116
+ "451" => ["", "", "systemerror"], # RFC2465, RFC5321
117
+ "452" => ["", "", "systemfull"], # RFC5321
118
+ "454" => ["AUTH", "4.7.0", "securityerror"], # RFC3027, RFC4954
119
+ "455" => ["", "", "syntaxerror"], # RFC5321
116
120
  "500" => ["", "", "syntaxerror"], # RFC5321
117
121
  "501" => ["", "", "syntaxerror"], # RFC5321
118
122
  "502" => ["", "", "syntaxerror"], # RFC5321
119
123
  "503" => ["", "", "syntaxerror"], # RFC5321
120
124
  "504" => ["", "", "syntaxerror"], # RFC5321
121
125
  "521" => ["CONN", "", "notaccept"], # RFC7504
122
- "523" => ["AUTH", "", "securityerror"], # RFC5248
123
- "524" => ["AUTH", "", "securityerror"], # RFC5248
124
- "525" => ["AUTH", "", "securityerror"], # RFC5248
126
+ "523" => ["AUTH", "5.7.10", "securityerror"], # RFC5248
127
+ "524" => ["AUTH", "5.7.11", "securityerror"], # RFC5248
128
+ "525" => ["AUTH", "5.7.13", "securityerror"], # RFC5248
125
129
  "534" => ["AUTH", "5.7.9", "securityerror"], # RFC4954, RFC5248
126
130
  "535" => ["AUTH", "5.7.8", "securityerror"], # RFC4954, RFC5248
127
131
  "538" => ["AUTH", "5.7.11", "securityerror"], # RFC4954, RFC5248
132
+ "551" => ["", "", "hasmoved"], # RFC5321, RFC5336, RFC6531
133
+ "552" => ["", "", "mailboxfull"], # RFC5321
134
+ "555" => ["", "", "syntaxerror"], # RFC5321
128
135
  "556" => ["RCPT", "", "notaccept"], # RFC7504
129
136
  }.freeze
130
137
 
@@ -153,7 +160,7 @@ module Sisimai
153
160
 
154
161
  if first == 3
155
162
  # 3yz
156
- return false unless reply == 334 || reply == 354
163
+ return false if reply != 334 && reply != 354
157
164
  return true
158
165
  end
159
166
 
@@ -554,7 +554,7 @@ module Sisimai
554
554
  '5.4.0' => 'networkerror', # Other or undefined network or routing status
555
555
  '5.4.3' => 'systemerror', # Directory server failure
556
556
  '5.4.4' => 'hostunknown', # Unable to route
557
- '5.5.2' => 'syntaxerror', # If the server cannot BASE64 decode any client response (AUTH)
557
+ '5.5.2' => 'systemerror', # If the server cannot BASE64 decode any client response (AUTH)
558
558
  '5.5.3' => 'toomanyconn', # Too many recipients
559
559
  '5.5.4' => 'systemerror', # Invalid command arguments
560
560
  '5.5.5' => 'systemerror', # Wrong protocol version
@@ -692,7 +692,7 @@ module Sisimai
692
692
  # @return [String] Reason name or an empty string
693
693
  # @see code
694
694
  def name(argv1 = nil)
695
- return "" unless Sisimai::SMTP::Status.test(argv1.to_s)
695
+ return "" if Sisimai::SMTP::Status.test(argv1.to_s) == false
696
696
  return StandardCode[argv1] || ""
697
697
  end
698
698
 
@@ -706,7 +706,7 @@ module Sisimai
706
706
 
707
707
  token = []
708
708
  argv1.split('.').each { |e| token << e.to_i }
709
- return false unless token.size == 3
709
+ return false if token.size != 3
710
710
  return false if token[0] < 2 || token[0] == 3 || token[0] > 5
711
711
  return false if token[1] < 0 || token[1] > 7
712
712
  return false if token[2] < 0
@@ -755,7 +755,7 @@ module Sisimai
755
755
 
756
756
  lookingfor.sort_by(&:first).each do |e|
757
757
  # Try to find an SMTP Status Code from the given string
758
- indexofees = esmtperror.index(e[1], e[0]); next unless indexofees
758
+ indexofees = esmtperror.index(e[1], e[0]); next if indexofees.nil?
759
759
  characters = [esmtperror[indexofees - 1, 1].ord] # [0] The previous character of the status
760
760
  [2, 3].each do |i|
761
761
  # [1] The value of the "Subject", "5.[7].261"
@@ -788,7 +788,7 @@ module Sisimai
788
788
  next if characters[3] < 48 || characters[3] > 57 # The 1st digit of the detail is not a number
789
789
  readbuffer << characters[3].chr
790
790
 
791
- if readbuffer.index('.0.0') || readbuffer == '4.4.7'
791
+ if Sisimai::SMTP::Status.is_ambiguous(readbuffer) || readbuffer == "4.4.7"
792
792
  # Find another status code except *.0.0, 4.4.7
793
793
  anotherone = readbuffer
794
794
  next
@@ -827,8 +827,8 @@ module Sisimai
827
827
  # @return [String] The preferred value
828
828
  # @since v5.0.0
829
829
  def prefer(argv0 = nil, argv1 = nil, argv2 = nil)
830
- return argv1 unless argv0; return argv1 unless argv0.size > 4
831
- return argv0 unless argv1; return argv0 unless argv1.size > 4
830
+ return argv1 if argv0.nil?; return argv1 if argv0.size < 5
831
+ return argv0 if argv1.nil?; return argv0 if argv1.size < 5
832
832
 
833
833
  statuscode = argv0
834
834
  codeinmesg = argv1
@@ -883,7 +883,7 @@ module Sisimai
883
883
  return statuscode
884
884
  end
885
885
 
886
- # is_explicit() returns 0 when the argument is empty or is an internal code
886
+ # is_explicit() returns false when the argument is empty or is an internal code
887
887
  # @param string argv1 Status code
888
888
  # @return bool false: The delivery status code is not explicit
889
889
  def is_explicit(argv1 = '')
@@ -891,6 +891,15 @@ module Sisimai
891
891
  return false if argv1.size == 7 && argv1.start_with?("5.0.9", "4.0.9")
892
892
  return true
893
893
  end
894
+
895
+ # is_ambiguous() returns true when the argument is not empty and ends with ".0.0".
896
+ # @param string argv1 Status code
897
+ # @return bool false: The delivery status code is not ambiguous
898
+ def is_ambiguous(argv1 = '')
899
+ return true if argv1.nil? || argv1.empty?
900
+ return true if argv1.size == 5 && argv1.end_with?(".0.0")
901
+ return false
902
+ end
894
903
  end
895
904
  end
896
905
  end
@@ -17,8 +17,8 @@ module Sisimai
17
17
  return nil if argv0.size == 0
18
18
 
19
19
  # 1. Replace label strings of SMTP client/server at the each line
20
- argv0.gsub!(/^[ ]+#{argv1}\s+/m, '>>> '); return nil unless argv0.include?('>>> ')
21
- argv0.gsub!(/^[ ]+#{argv2}\s+/m, '<<< '); return nil unless argv0.include?('<<< ')
20
+ argv0.gsub!(/^[ ]+#{argv1}\s+/m, '>>> '); return nil if argv0.include?('>>> ') == false
21
+ argv0.gsub!(/^[ ]+#{argv2}\s+/m, '<<< '); return nil if argv0.include?('<<< ') == false
22
22
 
23
23
  # 2. Remove strings until the first '<<<' or '>>>'
24
24
  esmtp = []
@@ -96,7 +96,7 @@ module Sisimai
96
96
  end
97
97
  else
98
98
  # SMTP server sent a response "<<< response text"
99
- p = e.index('<<< '); next unless p == 0
99
+ p = e.index('<<< '); next if p.nil? && p != 0
100
100
  e = e[4, e.size].sub(/\A<<<[ ]/, '')
101
101
 
102
102
  if cv = e.match(/\A([2-5]\d\d)[ ]/) then cx['response']['reply'] = cv[1] end
@@ -14,10 +14,8 @@ module Sisimai
14
14
  # @return [String] Message token(MD5 hex digest) or blank(failed to create token)
15
15
  # @see http://en.wikipedia.org/wiki/ASCII
16
16
  def token(addr1, addr2, epoch)
17
- return "" unless addr1.is_a?(::String)
18
- return "" unless addr2.is_a?(::String)
19
- return "" unless epoch.is_a?(Integer)
20
- return "" if addr1.empty? || addr2.empty?
17
+ return "" if addr1.is_a?(::String) == false || addr2.is_a?(::String) == false
18
+ return "" if addr1.empty? || addr2.empty? || epoch.is_a?(Integer) == false
21
19
 
22
20
  # Format: STX(0x02) Sender-Address RS(0x1e) Recipient-Address ETX(0x03)
23
21
  require 'digest/sha1'
@@ -30,7 +28,7 @@ module Sisimai
30
28
  def is_8bit(argvs)
31
29
  v = argvs.to_s
32
30
  return false if v.empty?
33
- return true unless v =~ /\A[\x00-\x7f]*\z/
31
+ return true if v !~ /\A[\x00-\x7f]*\z/
34
32
  return false
35
33
  end
36
34
 
@@ -40,7 +38,7 @@ module Sisimai
40
38
  # @example Clean up text
41
39
  # sweep(' neko ') #=> 'neko'
42
40
  def sweep(argv1)
43
- return argv1 unless argv1.is_a?(::String)
41
+ return argv1 if argv1.is_a?(::String) == false
44
42
  argv1 = argv1.chomp.squeeze(' ').strip
45
43
  argv1 = argv1.sub(/ [-]{2,}[^ ].+\z/, '')
46
44
  return argv1
@@ -52,16 +50,14 @@ module Sisimai
52
50
  # @return [Boolean]
53
51
  # @since v5.0.0
54
52
  def aligned(argv1, argv2)
55
- return false if argv1.to_s.empty?
56
- return false unless argv2.is_a? Array
57
- return false unless argv2.size > 1
53
+ return false if argv1.to_s.empty? || argv2.is_a?(Array) == false || argv2.size < 2
58
54
 
59
55
  align = -1
60
56
  right = 0
61
57
  argv2.each do |e|
62
58
  # Get the position of each element in the 1st argument using index()
63
59
  p = argv1.index(e, align + 1)
64
- break unless p # Break this loop when there is no string in the 1st argument
60
+ break if p == nil # Break this loop when there is no string in the 1st argument
65
61
  align = e.length + p - 1 # There is an aligned string in the 1st argument
66
62
  right += 1
67
63
  end
@@ -1,4 +1,4 @@
1
1
  # Define the version number of Sisimai
2
2
  module Sisimai
3
- VERSION = '5.4.0'.freeze
3
+ VERSION = '5.5.0'.freeze
4
4
  end
data/lib/sisimai.rb CHANGED
@@ -44,7 +44,7 @@ module Sisimai
44
44
  end
45
45
  end
46
46
 
47
- sisi += fact unless fact.empty?
47
+ sisi += fact if fact.empty? == false
48
48
  end
49
49
 
50
50
  return nil if sisi.empty?
@@ -1,40 +1,40 @@
1
- Return-path: <>
2
- Envelope-to: sironeko@node2.example.net
3
- Delivery-date: Thu, 29 Apr 2016 23:34:45 +0900
4
- Received: from mta22.example.com by node2.example.net with local (Exim 4.88)
5
- id nekochan-nyaaan-22
6
- for sironeko@node2.example.net; Thu, 29 Apr 2016 23:34:45 +0900
7
- X-Failed-Recipients: kijitora@example.com
8
- Auto-Submitted: auto-replied
9
- From: Mail Delivery System <Mailer-Daemon@node2.example.net>
10
- To: sironeko@node2.example.net
11
- Subject: Mail delivery failed: returning message to sender
12
- Message-Id: <nekochan-nyaaan-22@node2.example.net>
13
- Date: Thu, 29 Apr 2016 23:34:45 +0900
14
-
15
- This message was created automatically by mail delivery software.
16
-
17
- A message that you sent could not be delivered to one or more of its
18
- recipients. This is a permanent error. The following address(es) failed:
19
-
20
- kijitora@example.com
21
- SMTP error from remote mail server after initial connection:
22
- host email-22.example.net [192.0.2.222]:
23
- 554 neko-22.nyaan.r.example.net :
24
- CAT : neko22 : CAT : You've reached your daily relay quota - 203.0.113.0
25
-
26
- ------ This is a copy of the message, including all the headers. ------
27
-
28
- Return-path: <sironeko@.example.net>
29
- Received: from sironeko by node2.example.net with local (Exim 4.88)
30
- (envelope-from <sironeko@.example.net>)
31
- id nekochan-nyaaan-22
32
- for kijitora@example.com; Thu, 29 Apr 2016 23:34:45 +0900
33
- To: kijitora@example.com
34
- Subject: Nyaan
35
- Message-Id: <nekochan-nyaaan-22@node2.example.net>
36
- From: sironeko@.example.net
37
- Date: Thu, 29 Apr 2016 23:34:45 +0900
38
-
39
- Nyaan
40
-
1
+ Return-path: <>
2
+ Envelope-to: sironeko@node2.example.net
3
+ Delivery-date: Thu, 29 Apr 2016 23:34:45 +0900
4
+ Received: from mta22.example.com by node2.example.net with local (Exim 4.88)
5
+ id nekochan-nyaaan-22
6
+ for sironeko@node2.example.net; Thu, 29 Apr 2016 23:34:45 +0900
7
+ X-Failed-Recipients: kijitora@example.com
8
+ Auto-Submitted: auto-replied
9
+ From: Mail Delivery System <Mailer-Daemon@node2.example.net>
10
+ To: sironeko@node2.example.net
11
+ Subject: Mail delivery failed: returning message to sender
12
+ Message-Id: <nekochan-nyaaan-22@node2.example.net>
13
+ Date: Thu, 29 Apr 2016 23:34:45 +0900
14
+
15
+ This message was created automatically by mail delivery software.
16
+
17
+ A message that you sent could not be delivered to one or more of its
18
+ recipients. This is a permanent error. The following address(es) failed:
19
+
20
+ kijitora@example.com
21
+ SMTP error from remote mail server after initial connection:
22
+ host email-22.example.net [192.0.2.222]:
23
+ 554 neko-22.nyaan.r.example.net :
24
+ CAT : neko22 : CAT : You've reached your daily relay quota - 203.0.113.0
25
+
26
+ ------ This is a copy of the message, including all the headers. ------
27
+
28
+ Return-path: <sironeko@example.net>
29
+ Received: from sironeko by node2.example.net with local (Exim 4.88)
30
+ (envelope-from <sironeko@example.net>)
31
+ id nekochan-nyaaan-22
32
+ for kijitora@example.com; Thu, 29 Apr 2016 23:34:45 +0900
33
+ To: kijitora@example.com
34
+ Subject: Nyaan
35
+ Message-Id: <nekochan-nyaaan-22@node2.example.net>
36
+ From: sironeko@example.net
37
+ Date: Thu, 29 Apr 2016 23:34:45 +0900
38
+
39
+ Nyaan
40
+
@@ -0,0 +1,41 @@
1
+ Return-Path: <>
2
+ X-Original-To: system@errors.example.org
3
+ Delivered-To: system@errors.example.org
4
+ Received: from relay1.example.org (unknown [192.0.2.20])
5
+ by sys.example.org (Postfix) with ESMTPS id zkxVXLYvL8zRVYdx
6
+ for <system@errors.example.org>; Sun, 30 Mar 2025 23:34:55 +0900 (JST)
7
+ Received: from smtpd.relaying.example.jp (ip-192-0-2-2.ap-northeast-1.compute.internal [192.0.2.2])
8
+ by relay1.example.org (Postfix) with ESMTPS id SPCY8TBznXzt2VRQ
9
+ for <nekochan@example.org>; Sun, 30 Mar 2025 23:34:55 +0900 (JST)
10
+ Received: by smtpd.relaying.example.jp (localhost) id SMNgMS1V071253; Sun, 30 Mar 2025 23:34:55 +0900
11
+ Received: from esmtp2.example.co.jp ([192.0.2.25])
12
+ by relay.relaying.example.jp (relayhost) id Jr3FHeoX083118
13
+ Sun, 30 Mar 2025 23:34:54 +0900
14
+ Received: from esmtp2.example.co.jp ([127.0.0.1]) by smtphost with ESMTP; Sun, 30 Mar 2025 23:34:53 +0900
15
+ Reply-To: <>
16
+ X-Mailer: local-mailhub
17
+ Message-Id: <000000000000.00000.00000000.POSTMASTER@EXAMPLE.CO.JP>
18
+ MIME-Version: 1.0
19
+ Content-Type: text/plain; charset="UTF-8"
20
+ Content-Transfer-Encoding: Base64
21
+ From: postmaster <postmaster@example.co.jp>
22
+ To: nekochan@example.org
23
+ Date: Sun, 30 Mar 2025 00:56:39 +0900
24
+ Subject: failure notice
25
+
26
+ 44GT44Gu44Oh44O844Or44Gv44CM44Oh44O844Or44K344Og44OG44Og44CN44GM
27
+ 6Ieq5YuV55qE44Gr55Sf5oiQ44GX44Gm6YCB5L+h44GX44Gm44GE44G+44GZ44CC
28
+ CuODoeODvOODq+OCteODvOODkOODvOOBqOOBrumAmuS/oeS4reOAgeS4i+iomOOB
29
+ rueQhueUseOBq+OCiOOCigrjgZPjga7jg6Hjg7zjg6vjga/pgIHkv6HjgafjgY3j
30
+ gb7jgZvjgpPjgafjgZfjgZ/jgIIKCuS7peS4i+OBruODoeODvOODq+OCouODieOD
31
+ rOOCueOBuOOBrumAgeS/oeOBq+WkseaVl+OBl+OBvuOBl+OBn+OAggpraWppdG9y
32
+ YUBleGFtcGxlLmNvLmpwCgoKLS0tLS0tLXNlcnZlciBtZXNzYWdlCjQ1MiA0LjMu
33
+ MSBJbnN1ZmZpY2llbnQgc3lzdGVtIHJlc291cmNlcyAoVXNlZERpc2tTcGFjZVtE
34
+ OlxQcm9ncmFtIEZpbGVzXE1pY3Jvc29mdFxFeGNoYW5nZSBTZXJ2ZXJcVjE1XFRy
35
+ YW5zcG9ydFJvbGVzXGRhdGFcUXVldWVdKQoKLS0tLS0tLVNNVFAgY29tbWFuZApE
36
+ QVRBCgotLS0tLS0tb3JpZ2luYWwgbWFpbCBpbmZvCkZyb206IG5la29jaGFuQGV4
37
+ YW1wbGUub3JnClN1YmplY3Q6IOODi+ODo+ODvOODs++8nwpEYXRlOiBTYXQsIDI5
38
+ IE1hciAyMDI1IDIzOjUyOjIyICswOTAwCk1lc3NhZ2UtSUQ6IDwwMDAwMDAwMDAy
39
+ MTEuMjIyMjIyMjIyMDAwQGxvY2FsaG9zdD4KQk9EWToKLS0tLS0tLS0tLS0tLS0t
40
+ LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpOeWFhbgoK
41
+
@@ -0,0 +1,46 @@
1
+ Return-Path: <>
2
+ X-Original-To: neko@error.example.jp
3
+ Delivered-To: neko@error.example.jp
4
+ Received: from smtp.example.jp (unknown [192.0.2.25])
5
+ by eb.example.jp (Postfix) with ESMTPS id X4RDMVtpJ9z25xtV
6
+ for <neko@error.example.jp>; Mon, 29 Apr 2024 18:30:22 +0900 (JST)
7
+ Authentication-Results: eb.example.jp;
8
+ dkim=pass (1024-bit key, unprotected) header.d=ef.example.org header.i=@ef.example.org header.a=rsa-sha256 header.s=mimecast20180622 header.b=e...
9
+ Received: from us-smtp-delivery-225.mimecast.com (ip-192-0-2-125.us-east-1.compute.internal [192.0.2.22])
10
+ by smtp.example.jp (Postfix) with ESMTP id Zgr2Fply9TzPD185
11
+ for <kijitora@example.jp>; Mon, 29 Apr 2024 18:30:22 +0900 (JST)
12
+ Authentication-Results: smtp.example.jp;
13
+ dkim=pass (1024-bit key; unprotected) header.d=ef.example.org header.i=@ef.example.org header.a=rsa-sha256 header.s=mimecast20180622 header.b=e...
14
+ Subject: [Postmaster] Email Delivery Failure
15
+ Message-Id: <0123456789-1102117314000@us-mta-587.us.mimecast.lan>
16
+ Date: Mon, 29 Apr 2024 20:30:00 +1100
17
+ From: "postmaster" <postmaster@ef.example.org>
18
+ To: <kijitora@example.jp>
19
+ Mime-Version: 1.0
20
+ X-MC-System: =UmV0dXJuLVBhdGg6IDw+ClgtT3JpZ2luYWwtVG86IG5la29AZXJyb3IuZXhhbXBs
21
+ X-Mimecast-Originator: <>
22
+ Content-Type: text/plain; charset=UTF-8
23
+ Content-Transfer-Encoding: quoted-printable
24
+
25
+ This is an automated alert notification. Please do not reply.
26
+
27
+ An email that you attempted to send to the following address could not be d=
28
+ elivered:
29
+ -- sabineko@neko.ef.example.org
30
+
31
+ The problem appears to be :
32
+ -- Recipient email address is possibly incorrect
33
+
34
+ Additional information follows :
35
+ -- 5.4.1 Recipient address rejected: Access denied. [QQQQQQE00000000.jpnprd=
36
+ 01.prod.outlook.com 2024-02-19T09:30:25.255Z FFFFFFFFFFEEEEEE]
37
+
38
+ This condition occurred after 1 attempt(s) to deliver over
39
+ a period of 0 hour(s).
40
+
41
+ If you sent the email to multiple recipients, you will receive one
42
+ of these messages for each one which failed delivery, otherwise
43
+ they have been sent.
44
+
45
+ If you require further information, please contact the Service Desk.
46
+
@@ -0,0 +1,59 @@
1
+ Return-Path: <>
2
+ X-Original-To: sisi@errors.rr.example.jp
3
+ Delivered-To: sisi@errors.rr.example.jp
4
+ Received: from smtp.rr.example.jp (unknown [192.0.2.25])
5
+ by be.rr.example.jp (Postfix) with ESMTPS id 86ZvZmL8hKzWT593
6
+ for <sisi@errors.rr.example.jp>; Sat, 8 Feb 2025 20:22:22 +0900 (JST)
7
+ Received: from eu-smtp-delivery-255.mimecast.com (ip-192-0-2-22.ap-northeast-1.compute.internal [192.0.2.22])
8
+ by smtp.rr.example.jp (Postfix) with ESMTP id qQSDNz8RQjzVCWf3
9
+ for <kijitora@rr.example.jp>; Sat, 8 Feb 2025 20:22:21 +0900 (JST)
10
+ Subject: [Postmaster] Email Delivery Failure
11
+ Message-Id: <000000002-1111111110222@uk-mta-64.uk.mimecast.lan>
12
+ Date: Sat, 08 Feb 2025 11:22:30 +0000
13
+ From: Postmaster <postmaster@example.com>
14
+ To: <kijitora@rr.example.jp>
15
+ Mime-Version: 1.0
16
+ X-MC-System: =aHR0cHM6Ly9saWJzaXNpbWFpLm9yZy8K
17
+ X-Mimecast-Originator: <>
18
+ Content-Type: multipart/report; report-type=delivery-status;
19
+ boundary="MCBoundary=_14916154590123456"
20
+
21
+ --MCBoundary=_14916154590123456
22
+ Content-Type: text/plain; charset=UTF-8
23
+ Content-Transfer-Encoding: quoted-printable
24
+
25
+ This is a delivery failure notification message indicating that
26
+ an email you addressed to email address :
27
+ -- sabatora@example.net
28
+
29
+ could not be delivered. The problem appears to be :
30
+ -- Recipient email address is possibly incorrect
31
+
32
+ Additional information follows :
33
+ -- 5.7.54 SMTP; Unable to relay recipient in non-accepted domain
34
+
35
+ This condition occurred after 1 attempt(s) to deliver over
36
+ a period of 0 hour(s).
37
+
38
+ If you sent the email to multiple recipients, you will receive one
39
+ of these messages for each one which failed delivery, otherwise
40
+ they have been sent.
41
+
42
+ --MCBoundary=_14916154590123456
43
+ Content-Type: message/delivery-status; charset=UTF-8
44
+
45
+ DISPLAY_DATE_FORMAT : EEE, dd MMM yyyy HH:mm:ss zzz
46
+ Original-Envelope-Id : 5gENiF_01OCe5ak-neko22
47
+ Reporting-MTA : dns;eu-smtp-inbound-delivery-1.mimecast.com
48
+ Arrival-Date : Sat, 08 Feb 2025 11:22:21 GMT
49
+ Action : failed
50
+ Status : 5.0.0
51
+ Diagnostic-Code : smtp;550 5.7.54 SMTP; Unable to relay recipient in non-accepted domain
52
+ Last-Attempt-Date : Sat, 08 Feb 2025 11:22:28 GMT
53
+ Original-Recipient : rfc/822;sabatora@example.net
54
+ Remote-MTA : example.net
55
+ Final-Recipient : rfc/822;sabatora@example.net
56
+
57
+
58
+ --MCBoundary=_14916154590123456--
59
+
@@ -0,0 +1,81 @@
1
+ Return-Path: <>
2
+ X-Original-To: nekochan@smtp.example.org
3
+ Delivered-To: mail@smtp.example.org
4
+ Received: from mailhub0 (ip-192-0-2-25.ap-northeast-1.compute.internal [192.0.2.25])
5
+ by re1.smtp.example.org (Postfix) with ESMTPS id vQgJNkN94LzpGl2M
6
+ for <nekochan@smtp.example.org>; Thu, 7 Nov 2024 22:22:19 +0900 (JST)
7
+ Received: by mailhub0 (Postfix) id 720D5D4D56BF; Thu, 7 Nov 2024 22:21:23 +0900 (JST)
8
+ Date: Thu, 7 Nov 2024 22:21:23 +0900 (JST)
9
+ From: MAILER-DAEMON@mailhub0 (Mail Delivery System)
10
+ Subject: Undelivered Mail Returned to Sender
11
+ To: nekochan@smtp.example.org
12
+ Auto-Submitted: auto-replied
13
+ MIME-Version: 1.0
14
+ Content-Type: multipart/report; report-type=delivery-status;
15
+ boundary="B1CABDB88213.1157730000/mailhub0"
16
+ Content-Transfer-Encoding: 8bit
17
+ Message-Id: <20241100000000.B26CFC3B7CE@mailhub0>
18
+
19
+ This is a MIME-encapsulated message.
20
+
21
+ --B1CABDB88213.1157730000/mailhub0
22
+ Content-Description: Notification
23
+ Content-Type: text/plain; charset=utf-8
24
+ Content-Transfer-Encoding: 8bit
25
+
26
+ This is the mail system at host mailhub0.
27
+
28
+ I'm sorry to have to inform you that your message could not
29
+ be delivered to one or more recipients. It's attached below.
30
+
31
+ For further assistance, please send mail to postmaster.
32
+
33
+ If you do so, please include this problem report. You can
34
+ delete your own text from the attached returned message.
35
+
36
+ The mail system
37
+
38
+ <kijitora@mailhub0> (expanded from <nekko@c.example.co.jp>): can't create user
39
+ output file. Command output: procmail: Lock failure on
40
+ "/var/virtmail/k/ij/it/kijitora/mailbox.lock" procmail: Error while
41
+ writing to "/var/virtmail/k/ij/it/kijitora/mailbox"
42
+
43
+ --B1CABDB88213.1157730000/mailhub0
44
+ Content-Description: Delivery report
45
+ Content-Type: message/delivery-status
46
+
47
+ Reporting-MTA: dns; mailhub0
48
+ X-Postfix-Queue-ID: B1CABDB88213
49
+ X-Postfix-Sender: rfc822; nekochan@smtp.example.org
50
+ Arrival-Date: Thu, 7 Nov 2024 22:21:21 +0900 (JST)
51
+
52
+ Final-Recipient: rfc822; kijitora@mailhub0
53
+ Original-Recipient: rfc822;nekko@c.example.co.jp
54
+ Action: failed
55
+ Status: 5.2.0
56
+ Diagnostic-Code: x-unix; procmail: Lock failure on
57
+ "/var/virtmail/k/ij/it/kijitora/mailbox.lock" procmail: Error while
58
+ writing to "/var/virtmail/k/ij/it/kijitora/mailbox"
59
+
60
+ --B1CABDB88213.1157730000/mailhub0
61
+ Content-Description: Undelivered Message
62
+ Content-Type: message/rfc822
63
+ Content-Transfer-Encoding: 8bit
64
+
65
+ Return-Path: <nekochan@smtp.example.org>
66
+ Received: from relaying1.smtp.example.org (relaying1.smtp.example.org [192.0.2.1])
67
+ by mailhub0 (Postfix) with ESMTP id B1CABDB88213
68
+ for <nekko@c.example.co.jp>; Thu, 7 Nov 2024 22:21:21 +0900 (JST)
69
+ MIME-Version: 1.0
70
+ Subject: Nyaan?
71
+ From: <nekochan@smtp.example.org>
72
+ To: <nekko@c.example.co.jp>
73
+ Date: 7 Nov 2024 15:19:45 +0900
74
+ Content-Type: text/plain; charset=iso-2022-jp
75
+ Content-Transfer-Encoding: quoted-printable
76
+ Message-Id: <cwLHKS2rB9zDX8SS@relaying1.smtp.example.org>
77
+
78
+ Nyaan?
79
+
80
+ --B1CABDB88213.1157730000/mailhub0--
81
+
@@ -0,0 +1,84 @@
1
+ Return-Path: <>
2
+ X-Original-To: xxxx@xxxx.com
3
+ Delivered-To: xxxx@xxxx.xxxx.net
4
+ Received: from xxx.xxx.net (unknown [#.#.#.#])
5
+ by xxxx.xxxx.net (Postfix) with ESMTP id 3DF29198
6
+ for <xxxx@xxxx.com>; Mon, 27 Oct 2025 12:28:26 +0100 (CET)
7
+ Received: by xxxx.xxxx.net (Postfix)
8
+ id 39CFF763854; Mon, 27 Oct 2025 12:28:26 +0100 (CET)
9
+ Date: Mon, 27 Oct 2025 12:28:26 +0100 (CET)
10
+ From: Mail Delivery System <MAILER-DAEMON@xxxx.xxxx.net>
11
+ Subject: Undelivered Mail Returned to Sender
12
+ To: xxxx@xxxx.com
13
+ Auto-Submitted: auto-replied
14
+ MIME-Version: 1.0
15
+ Content-Type: multipart/report; report-type=delivery-status;
16
+ boundary="05805763851.1761564506/xxxx.xxxx.net"
17
+ Content-Transfer-Encoding: 8bit
18
+ Message-Id: <20251027112826@xxxx.xxxx.net>
19
+
20
+ This is a MIME-encapsulated message.
21
+
22
+ --05805763851.1761564506/xxxx.xxxx.net
23
+ Content-Description: Notification
24
+ Content-Type: text/plain; charset=utf-8
25
+ Content-Transfer-Encoding: 8bit
26
+
27
+ This is the mail system at host xxxx.xxxx.net.
28
+
29
+ I'm sorry to have to inform you that your message could not
30
+ be delivered to one or more recipients. It's attached below.
31
+
32
+ For further assistance, please send mail to postmaster.
33
+
34
+ If you do so, please include this problem report. You can
35
+ delete your own text from the attached returned message.
36
+
37
+ The mail system
38
+
39
+ <xxxx@xxxx.com>: host xxxx.xxxx.com[#.#.#.#] said:
40
+ 550-5.1.0 MXIN506 MailFrom domain is listed in Spamhaus. To request removal
41
+ from this list see https: 550 5.1.0 //www.spamhaus.org/query/lookup/
42
+ ;id=DLOkvMxsVeZooDLOkv7hl0;sid=DLOkvMxsVeZoo;mta=mx12-prd-nl1-vmo;d=20251027;t=122826[CET];ipsrc=#.#.#.#;
43
+ (in reply to MAIL FROM command)
44
+
45
+ --05805763851.1761564506/xxxx.xxxx.net
46
+ Content-Description: Delivery report
47
+ Content-Type: message/delivery-status
48
+
49
+ Reporting-MTA: dns; xxxx.xxxx.net
50
+ X-Postfix-Queue-ID: 05805763851
51
+ X-Postfix-Sender: rfc822; xxxx@xxxx.com
52
+ Arrival-Date: Mon, 27 Oct 2025 12:28:26 +0100 (CET)
53
+
54
+ Final-Recipient: rfc822; xxxx@xxxx.com
55
+ Original-Recipient: rfc822;xxxx@xxxx.com
56
+ Action: failed
57
+ Status: 5.1.0
58
+ Remote-MTA: dns; xxxx.xxxx.com
59
+ Diagnostic-Code: smtp; 550-5.1.0 MXIN506 MailFrom domain is listed in Spamhaus.
60
+ To request removal from this list see https: 550 5.1.0
61
+ //www.spamhaus.org/query/lookup/
62
+ ;id=DLOkvMxsVeZooDLOkv7hl0;sid=DLOkvMxsVeZoo;mta=mx12-prd-nl1-vmo;d=20251027;t=122826[CET];ipsrc=#.#.#.#;
63
+
64
+ --05805763851.1761564506/xxxx.xxxx.net
65
+ Content-Description: Undelivered Message Headers
66
+ Content-Type: text/rfc822-headers
67
+ Content-Transfer-Encoding: 8bit
68
+
69
+ Return-Path: <xxxx@xxxx.com>
70
+ Message-Id: <1761564505.xxxx@xxxx.com>
71
+ Feedback-Id: 488:3356
72
+ List-Unsubscribe: <mailto:xxxx@lu.xxxx.com>
73
+ Precedence: bulk
74
+ From: "=?UTF-8?Q?xxxxx?=" <offerte@xxxx.com>
75
+ To: xxxx@xxxx.com
76
+ Reply-To: xxxx@xxxx.com
77
+ Content-Type: text/html; charset=utf-8
78
+ Subject: =?UTF-8?Q?xxxx?=
79
+ Content-Disposition: inline
80
+ Content-Transfer-Encoding: quoted-printable
81
+ MIME-Version: 1.0
82
+ Date: Mon, 27 Oct 2025 12:28:25 +0100
83
+
84
+ --05805763851.1761564506/xxxx.xxxx.net--