sisimai 4.25.3-java → 4.25.4-java

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 (123) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -0
  4. data/ANALYTICAL-PRECISION +2 -4
  5. data/CONTRIBUTING +4 -0
  6. data/ChangeLog.md +39 -0
  7. data/Developers.mk +1 -72
  8. data/Makefile +4 -0
  9. data/README-JA.md +3 -0
  10. data/README.md +5 -2
  11. data/lib/sisimai.rb +4 -3
  12. data/lib/sisimai/arf.rb +6 -6
  13. data/lib/sisimai/bite.rb +8 -3
  14. data/lib/sisimai/bite/email.rb +7 -50
  15. data/lib/sisimai/bite/json.rb +5 -25
  16. data/lib/sisimai/data.rb +1 -1
  17. data/lib/sisimai/lhost.rb +101 -0
  18. data/lib/sisimai/{bite/email → lhost}/activehunter.rb +10 -10
  19. data/lib/sisimai/{bite/email → lhost}/amavis.rb +9 -9
  20. data/lib/sisimai/lhost/amazonses.rb +403 -0
  21. data/lib/sisimai/{bite/email → lhost}/amazonworkmail.rb +9 -9
  22. data/lib/sisimai/{bite/email → lhost}/aol.rb +10 -10
  23. data/lib/sisimai/{bite/email → lhost}/apachejames.rb +10 -10
  24. data/lib/sisimai/{bite/email → lhost}/bigfoot.rb +9 -9
  25. data/lib/sisimai/{bite/email → lhost}/biglobe.rb +10 -10
  26. data/lib/sisimai/{bite/email → lhost}/courier.rb +10 -10
  27. data/lib/sisimai/{bite/email → lhost}/domino.rb +9 -9
  28. data/lib/sisimai/{bite/email → lhost}/einsundeins.rb +10 -10
  29. data/lib/sisimai/{bite/email → lhost}/exchange2003.rb +9 -9
  30. data/lib/sisimai/{bite/email → lhost}/exchange2007.rb +9 -9
  31. data/lib/sisimai/{bite/email → lhost}/exim.rb +10 -10
  32. data/lib/sisimai/{bite/email → lhost}/ezweb.rb +9 -9
  33. data/lib/sisimai/{bite/email → lhost}/facebook.rb +9 -9
  34. data/lib/sisimai/{bite/email → lhost}/fml.rb +10 -10
  35. data/lib/sisimai/{bite/email → lhost}/gmx.rb +10 -10
  36. data/lib/sisimai/{bite/email → lhost}/google.rb +14 -14
  37. data/lib/sisimai/{bite/email → lhost}/gsuite.rb +10 -10
  38. data/lib/sisimai/{bite/email → lhost}/imailserver.rb +10 -10
  39. data/lib/sisimai/{bite/email → lhost}/interscanmss.rb +9 -9
  40. data/lib/sisimai/{bite/email → lhost}/kddi.rb +10 -10
  41. data/lib/sisimai/{bite/email → lhost}/mailfoundry.rb +9 -9
  42. data/lib/sisimai/{bite/email → lhost}/mailmarshalsmtp.rb +9 -9
  43. data/lib/sisimai/{bite/email → lhost}/mailru.rb +11 -11
  44. data/lib/sisimai/{bite/email → lhost}/mcafee.rb +9 -9
  45. data/lib/sisimai/{bite/email → lhost}/messagelabs.rb +9 -9
  46. data/lib/sisimai/{bite/email → lhost}/messagingserver.rb +9 -9
  47. data/lib/sisimai/{bite/email → lhost}/mfilter.rb +9 -9
  48. data/lib/sisimai/{bite/email → lhost}/mxlogic.rb +10 -10
  49. data/lib/sisimai/{bite/email → lhost}/notes.rb +9 -9
  50. data/lib/sisimai/{bite/email → lhost}/office365.rb +10 -10
  51. data/lib/sisimai/{bite/email → lhost}/opensmtpd.rb +9 -9
  52. data/lib/sisimai/{bite/email → lhost}/outlook.rb +9 -9
  53. data/lib/sisimai/{bite/email → lhost}/postfix.rb +9 -9
  54. data/lib/sisimai/{bite/email → lhost}/qmail.rb +9 -9
  55. data/lib/sisimai/{bite/email → lhost}/receivingses.rb +11 -11
  56. data/lib/sisimai/{bite/email → lhost}/sendgrid.rb +120 -11
  57. data/lib/sisimai/{bite/email → lhost}/sendmail.rb +9 -9
  58. data/lib/sisimai/{bite/email → lhost}/surfcontrol.rb +9 -9
  59. data/lib/sisimai/{bite/email → lhost}/userdefined.rb +9 -9
  60. data/lib/sisimai/{bite/email → lhost}/v5sendmail.rb +10 -10
  61. data/lib/sisimai/{bite/email → lhost}/verizon.rb +11 -11
  62. data/lib/sisimai/{bite/email → lhost}/x1.rb +9 -9
  63. data/lib/sisimai/{bite/email → lhost}/x2.rb +9 -9
  64. data/lib/sisimai/{bite/email → lhost}/x3.rb +9 -9
  65. data/lib/sisimai/{bite/email → lhost}/x4.rb +10 -10
  66. data/lib/sisimai/{bite/email → lhost}/x5.rb +9 -9
  67. data/lib/sisimai/{bite/email → lhost}/yahoo.rb +9 -9
  68. data/lib/sisimai/{bite/email → lhost}/yandex.rb +10 -10
  69. data/lib/sisimai/{bite/email → lhost}/zoho.rb +10 -10
  70. data/lib/sisimai/mda.rb +1 -1
  71. data/lib/sisimai/message.rb +535 -28
  72. data/lib/sisimai/message/email.rb +3 -454
  73. data/lib/sisimai/message/json.rb +3 -177
  74. data/lib/sisimai/order.rb +238 -4
  75. data/lib/sisimai/order/email.rb +5 -190
  76. data/lib/sisimai/order/json.rb +3 -39
  77. data/lib/sisimai/reason.rb +1 -1
  78. data/lib/sisimai/reason/norelaying.rb +1 -1
  79. data/lib/sisimai/reason/userunknown.rb +1 -1
  80. data/lib/sisimai/reason/virusdetected.rb +1 -0
  81. data/lib/sisimai/rfc1894.rb +2 -2
  82. data/lib/sisimai/rfc3464.rb +13 -13
  83. data/lib/sisimai/rfc3834.rb +3 -3
  84. data/lib/sisimai/rfc5322.rb +1 -1
  85. data/lib/sisimai/rhost.rb +5 -4
  86. data/lib/sisimai/rhost/exchangeonline.rb +1 -1
  87. data/lib/sisimai/rhost/franceptt.rb +1 -1
  88. data/lib/sisimai/rhost/godaddy.rb +1 -1
  89. data/lib/sisimai/rhost/iua.rb +39 -0
  90. data/lib/sisimai/version.rb +1 -1
  91. data/set-of-emails/README.md +0 -1
  92. data/set-of-emails/maildir/bsd/email-gsuite-13.eml +261 -0
  93. data/set-of-emails/maildir/bsd/email-postfix-62.eml +105 -0
  94. data/set-of-emails/maildir/bsd/email-postfix-63.eml +85 -0
  95. data/set-of-emails/maildir/bsd/rhost-iua-01.eml +70 -0
  96. metadata +75 -94
  97. data/fig/sisimai-architecture.png +0 -0
  98. data/lib/sisimai/bite/email/amazonses.rb +0 -186
  99. data/lib/sisimai/bite/json/amazonses.rb +0 -242
  100. data/lib/sisimai/bite/json/sendgrid.rb +0 -123
  101. data/set-of-emails/jsonobj/json-amazonses-01.json +0 -1
  102. data/set-of-emails/jsonobj/json-amazonses-02.json +0 -11
  103. data/set-of-emails/jsonobj/json-amazonses-03.json +0 -1
  104. data/set-of-emails/jsonobj/json-amazonses-04.json +0 -1
  105. data/set-of-emails/jsonobj/json-amazonses-05.json +0 -1
  106. data/set-of-emails/jsonobj/json-amazonses-06.json +0 -1
  107. data/set-of-emails/jsonobj/json-sendgrid-01.json +0 -1
  108. data/set-of-emails/jsonobj/json-sendgrid-02.json +0 -1
  109. data/set-of-emails/jsonobj/json-sendgrid-03.json +0 -1
  110. data/set-of-emails/jsonobj/json-sendgrid-04.json +0 -1
  111. data/set-of-emails/jsonobj/json-sendgrid-05.json +0 -1
  112. data/set-of-emails/jsonobj/json-sendgrid-06.json +0 -1
  113. data/set-of-emails/jsonobj/json-sendgrid-07.json +0 -1
  114. data/set-of-emails/jsonobj/json-sendgrid-08.json +0 -1
  115. data/set-of-emails/jsonobj/json-sendgrid-09.json +0 -1
  116. data/set-of-emails/jsonobj/json-sendgrid-10.json +0 -1
  117. data/set-of-emails/jsonobj/json-sendgrid-11.json +0 -1
  118. data/set-of-emails/jsonobj/json-sendgrid-12.json +0 -1
  119. data/set-of-emails/jsonobj/json-sendgrid-13.json +0 -1
  120. data/set-of-emails/jsonobj/json-sendgrid-14.json +0 -1
  121. data/set-of-emails/jsonobj/json-sendgrid-15.json +0 -1
  122. data/set-of-emails/jsonobj/json-sendgrid-16.json +0 -1
  123. data/set-of-emails/jsonobj/json-sendgrid-17.json +0 -1
@@ -1,13 +1,13 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::IMailServer parses a bounce email which created by
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::IMailServer parses a bounce email which created by
3
3
  # Ipswitch IMail Server.
4
4
  # Methods in the module are called from only Sisimai::Message.
5
5
  module IMailServer
6
6
  class << self
7
- # Imported from p5-Sisimail/lib/Sisimai/Bite::Email/IMailServer.pm
8
- require 'sisimai/bite/email'
7
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/IMailServer.pm
8
+ require 'sisimai/lhost'
9
9
 
10
- Indicators = Sisimai::Bite::Email.INDICATORS
10
+ Indicators = Sisimai::Lhost.INDICATORS
11
11
  StartingOf = {
12
12
  message: [''], # Blank line
13
13
  rfc822: ['Original message follows.'],
@@ -31,7 +31,7 @@ module Sisimai::Bite::Email
31
31
  }.freeze
32
32
 
33
33
  def description; return 'IPSWITCH IMail Server'; end
34
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
34
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
35
35
  def headerlist; return %w[x-mailer]; end
36
36
 
37
37
  # Parse bounce messages from IMailServer
@@ -45,13 +45,13 @@ module Sisimai::Bite::Email
45
45
  # @return [Hash, Nil] Bounce data list and message/rfc822
46
46
  # part or nil if it failed to parse or
47
47
  # the arguments are missing
48
- def scan(mhead, mbody)
48
+ def make(mhead, mbody)
49
49
  match = 0
50
50
  match += 1 if mhead['subject'] =~ /\AUndeliverable Mail[ ]*\z/
51
51
  match += 1 if mhead['x-mailer'].to_s.start_with?('<SMTP32 v')
52
52
  return nil unless match > 0
53
53
 
54
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
54
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
55
55
  hasdivided = mbody.split("\n")
56
56
  rfc822list = [] # (Array) Each line in message/rfc822 part string
57
57
  blanklines = 0 # (Integer) The number of blank lines
@@ -97,7 +97,7 @@ module Sisimai::Bite::Email
97
97
  # Unknown user: kijitora@example.com
98
98
  if v['recipient']
99
99
  # There are multiple recipient addresses in the message body.
100
- dscontents << Sisimai::Bite.DELIVERYSTATUS
100
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
101
101
  v = dscontents[-1]
102
102
  end
103
103
  v['diagnosis'] = cv[1] + ' ' + cv[2]
@@ -108,7 +108,7 @@ module Sisimai::Bite::Email
108
108
  # undeliverable to kijitora@example.com
109
109
  if v['recipient']
110
110
  # There are multiple recipient addresses in the message body.
111
- dscontents << Sisimai::Bite.DELIVERYSTATUS
111
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
112
112
  v = dscontents[-1]
113
113
  end
114
114
  v['recipient'] = cv[1]
@@ -1,20 +1,20 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::InterScanMSS parses a bounce email which created by
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::InterScanMSS parses a bounce email which created by
3
3
  # Trend Micro InterScan Messaging Security Suite. Methods in the module are
4
4
  # called from only Sisimai::Message.
5
5
  module InterScanMSS
6
6
  class << self
7
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/InterScanMSS.pm
8
- require 'sisimai/bite/email'
7
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/InterScanMSS.pm
8
+ require 'sisimai/lhost'
9
9
 
10
- Indicators = Sisimai::Bite::Email.INDICATORS
10
+ Indicators = Sisimai::Lhost.INDICATORS
11
11
  StartingOf = {
12
12
  message: [''],
13
13
  rfc822: ['Content-type: message/rfc822'],
14
14
  }.freeze
15
15
 
16
16
  def description; return 'Trend Micro InterScan Messaging Security Suite'; end
17
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
17
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
18
18
  def headerlist; return []; end
19
19
 
20
20
  # Parse bounce messages from InterScanMSS
@@ -28,7 +28,7 @@ module Sisimai::Bite::Email
28
28
  # @return [Hash, Nil] Bounce data list and message/rfc822
29
29
  # part or nil if it failed to parse or
30
30
  # the arguments are missing
31
- def scan(mhead, mbody)
31
+ def make(mhead, mbody)
32
32
  # :received => %r/[ ][(]InterScanMSS[)][ ]with[ ]/,
33
33
  match = 0
34
34
  tryto = [
@@ -40,7 +40,7 @@ module Sisimai::Bite::Email
40
40
  match += 1 if tryto.any? { |a| mhead['subject'] == a }
41
41
  return nil unless match > 0
42
42
 
43
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
43
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
44
44
  hasdivided = mbody.split("\n")
45
45
  rfc822list = [] # (Array) Each line in message/rfc822 part string
46
46
  blanklines = 0 # (Integer) The number of blank lines
@@ -88,7 +88,7 @@ module Sisimai::Bite::Email
88
88
  # Received >>> 550 5.1.1 <kijitora@example.co.jp>... user unknown
89
89
  if v['recipient'] && cv[1] != v['recipient']
90
90
  # There are multiple recipient addresses in the message body.
91
- dscontents << Sisimai::Bite.DELIVERYSTATUS
91
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
92
92
  v = dscontents[-1]
93
93
  end
94
94
  v['recipient'] = cv[1]
@@ -1,12 +1,12 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::KDDI parses a bounce email which created by au by KDDI.
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::KDDI parses a bounce email which created by au by KDDI.
3
3
  # Methods in the module are called from only Sisimai::Message.
4
4
  module KDDI
5
5
  class << self
6
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/KDDI.pm
7
- require 'sisimai/bite/email'
6
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/KDDI.pm
7
+ require 'sisimai/lhost'
8
8
 
9
- Indicators = Sisimai::Bite::Email.INDICATORS
9
+ Indicators = Sisimai::Lhost.INDICATORS
10
10
  StartingOf = { rfc822: ['Content-Type: message/rfc822'] }.freeze
11
11
  MarkingsOf = {
12
12
  message: %r/\AYour[ ]mail[ ](?:
@@ -21,8 +21,8 @@ module Sisimai::Bite::Email
21
21
  'hostunknown' => ['As the remote domain doesnt exist'],
22
22
  }.freeze
23
23
 
24
- def description; return 'au by KDDI: http://www.au.kddi.com'; end
25
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
24
+ def description; return 'au by KDDI: https://www.au.kddi.com'; end
25
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
26
26
  def headerlist; return []; end
27
27
 
28
28
  # Parse bounce messages from au by KDDI
@@ -36,7 +36,7 @@ module Sisimai::Bite::Email
36
36
  # @return [Hash, Nil] Bounce data list and message/rfc822
37
37
  # part or nil if it failed to parse or
38
38
  # the arguments are missing
39
- def scan(mhead, mbody)
39
+ def make(mhead, mbody)
40
40
  # :'message-id' => %r/[@].+[.]ezweb[.]ne[.]jp[>]\z/,
41
41
  match = 0
42
42
  match += 1 if mhead['from'] =~ /no-reply[@].+[.]dion[.]ne[.]jp/
@@ -45,7 +45,7 @@ module Sisimai::Bite::Email
45
45
  match += 1 if mhead['received'].any? { |a| a.include?('.au.com (') }
46
46
  return nil unless match > 0
47
47
 
48
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
48
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
49
49
  hasdivided = mbody.split("\n")
50
50
  rfc822list = [] # (Array) Each line in message/rfc822 part string
51
51
  blanklines = 0 # (Integer) The number of blank lines
@@ -90,7 +90,7 @@ module Sisimai::Bite::Email
90
90
  # As their mailbox is full.
91
91
  if v['recipient']
92
92
  # There are multiple recipient addresses in the message body.
93
- dscontents << Sisimai::Bite.DELIVERYSTATUS
93
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
94
94
  v = dscontents[-1]
95
95
  end
96
96
  r = Sisimai::Address.s3s4(cv[1])
@@ -1,12 +1,12 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::MailFoundry parses a bounce email which created by
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::MailFoundry parses a bounce email which created by
3
3
  # MailFoundry. Methods in the module are called from only Sisimai::Message.
4
4
  module MailFoundry
5
5
  class << self
6
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/MailFoundry.pm
7
- require 'sisimai/bite/email'
6
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/MailFoundry.pm
7
+ require 'sisimai/lhost'
8
8
 
9
- Indicators = Sisimai::Bite::Email.INDICATORS
9
+ Indicators = Sisimai::Lhost.INDICATORS
10
10
  StartingOf = {
11
11
  message: ['This is a MIME encoded message'],
12
12
  rfc822: ['Content-Type: message/rfc822'],
@@ -14,7 +14,7 @@ module Sisimai::Bite::Email
14
14
  }.freeze
15
15
 
16
16
  def description; return 'MailFoundry'; end
17
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
17
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
18
18
  def headerlist; return []; end
19
19
 
20
20
  # Parse bounce messages from MailFoundry
@@ -28,11 +28,11 @@ module Sisimai::Bite::Email
28
28
  # @return [Hash, Nil] Bounce data list and message/rfc822
29
29
  # part or nil if it failed to parse or
30
30
  # the arguments are missing
31
- def scan(mhead, mbody)
31
+ def make(mhead, mbody)
32
32
  return nil unless mhead['subject'] == 'Message delivery has failed'
33
33
  return nil unless mhead['received'].any? { |a| a.include?('(MAILFOUNDRY) id ') }
34
34
 
35
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
35
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
36
36
  hasdivided = mbody.split("\n")
37
37
  rfc822list = [] # (Array) Each line in message/rfc822 part string
38
38
  blanklines = 0 # (Integer) The number of blank lines
@@ -81,7 +81,7 @@ module Sisimai::Bite::Email
81
81
  # Unable to deliver message to: <kijitora@example.org>
82
82
  if v['recipient']
83
83
  # There are multiple recipient addresses in the message body.
84
- dscontents << Sisimai::Bite.DELIVERYSTATUS
84
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
85
85
  v = dscontents[-1]
86
86
  end
87
87
  v['recipient'] = cv[1]
@@ -1,13 +1,13 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::MailMarshalSMTP parses a bounce email which created
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::MailMarshalSMTP parses a bounce email which created
3
3
  # by Trustwave Secure Email Gateway: formerly MailMarshal SMTP. Methods in
4
4
  # the module are called from only Sisimai::Message.
5
5
  module MailMarshalSMTP
6
6
  class << self
7
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/MailMarshalSMTP.pm
8
- require 'sisimai/bite/email'
7
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/MailMarshalSMTP.pm
8
+ require 'sisimai/lhost'
9
9
 
10
- Indicators = Sisimai::Bite::Email.INDICATORS
10
+ Indicators = Sisimai::Lhost.INDICATORS
11
11
  StartingOf = {
12
12
  message: ['Your message:'],
13
13
  error: ['Could not be delivered because of'],
@@ -15,7 +15,7 @@ module Sisimai::Bite::Email
15
15
  }.freeze
16
16
 
17
17
  def description; return 'Trustwave Secure Email Gateway'; end
18
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
18
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
19
19
  def headerlist; return ['X-Mailer']; end
20
20
 
21
21
  # Parse bounce messages from MailMarshalSMTP
@@ -29,10 +29,10 @@ module Sisimai::Bite::Email
29
29
  # @return [Hash, Nil] Bounce data list and message/rfc822
30
30
  # part or nil if it failed to parse or
31
31
  # the arguments are missing
32
- def scan(mhead, mbody)
32
+ def make(mhead, mbody)
33
33
  return nil unless mhead['subject'].start_with?('Undeliverable Mail: "')
34
34
 
35
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
35
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
36
36
  hasdivided = mbody.split("\n")
37
37
  rfc822list = [] # (Array) Each line in message/rfc822 part string
38
38
  blanklines = 0 # (Integer) The number of blank lines
@@ -97,7 +97,7 @@ module Sisimai::Bite::Email
97
97
  # dummyuser@blabla.xxxxxxxxxxxx.com
98
98
  if v['recipient']
99
99
  # There are multiple recipient addresses in the message body.
100
- dscontents << Sisimai::Bite.DELIVERYSTATUS
100
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
101
101
  v = dscontents[-1]
102
102
  end
103
103
  v['recipient'] = cv[1]
@@ -1,13 +1,13 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::MailRu parses a bounce email which created by @mail.ru.
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::MailRu parses a bounce email which created by @mail.ru.
3
3
  # Methods in the module are called from only Sisimai::Message.
4
4
  module MailRu
5
5
  class << self
6
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/MailRu.pm
7
- # Based on Sisimai::Bite::Email::Exim
8
- require 'sisimai/bite/email'
6
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/MailRu.pm
7
+ # Based on Sisimai::Lhost::Exim
8
+ require 'sisimai/lhost'
9
9
 
10
- Indicators = Sisimai::Bite::Email.INDICATORS
10
+ Indicators = Sisimai::Lhost.INDICATORS
11
11
  StartingOf = {
12
12
  message: ['This message was created automatically by mail delivery software.'],
13
13
  rfc822: ['------ This is a copy of the message, including all the headers. ------'],
@@ -49,7 +49,7 @@ module Sisimai::Bite::Email
49
49
  }.freeze
50
50
 
51
51
  def description; return '@mail.ru: https://mail.ru'; end
52
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
52
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
53
53
  def headerlist; return %w[x-failed-recipients]; end
54
54
 
55
55
  # Parse bounce messages from @mail.ru
@@ -63,7 +63,7 @@ module Sisimai::Bite::Email
63
63
  # @return [Hash, Nil] Bounce data list and message/rfc822
64
64
  # part or nil if it failed to parse or
65
65
  # the arguments are missing
66
- def scan(mhead, mbody)
66
+ def make(mhead, mbody)
67
67
  return nil unless mhead['from'] =~ /[<]?mailer-daemon[@].*mail[.]ru[>]?/i
68
68
  return nil unless mhead['message-id'].end_with?('.mail.ru>', 'smailru.net>')
69
69
  return nil unless mhead['subject'] =~ %r{(?:
@@ -76,7 +76,7 @@ module Sisimai::Bite::Email
76
76
  )
77
77
  }x
78
78
 
79
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
79
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
80
80
  hasdivided = mbody.split("\n")
81
81
  rfc822list = [] # (Array) Each line in message/rfc822 part string
82
82
  blanklines = 0 # (Integer) The number of blank lines
@@ -139,7 +139,7 @@ module Sisimai::Bite::Email
139
139
  # kijitora@example.jp
140
140
  if v['recipient']
141
141
  # There are multiple recipient addresses in the message body.
142
- dscontents << Sisimai::Bite.DELIVERYSTATUS
142
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
143
143
  v = dscontents[-1]
144
144
  end
145
145
  v['recipient'] = cv[1]
@@ -172,7 +172,7 @@ module Sisimai::Bite::Email
172
172
  # Insert each recipient address into dscontents
173
173
  dscontents[-1]['recipient'] = e
174
174
  next if dscontents.size == recipients
175
- dscontents << Sisimai::Bite.DELIVERYSTATUS
175
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
176
176
  end
177
177
  end
178
178
  end
@@ -1,12 +1,12 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::McAfee parses a bounce email which created by McAfee
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::McAfee parses a bounce email which created by McAfee
3
3
  # Email Appliance. Methods in the module are called from only Sisimai::Message.
4
4
  module McAfee
5
5
  class << self
6
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/McAfee.pm
7
- require 'sisimai/bite/email'
6
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/McAfee.pm
7
+ require 'sisimai/lhost'
8
8
 
9
- Indicators = Sisimai::Bite::Email.INDICATORS
9
+ Indicators = Sisimai::Lhost.INDICATORS
10
10
  StartingOf = {
11
11
  message: ['--- The following addresses had delivery problems ---'],
12
12
  rfc822: ['Content-Type: message/rfc822'],
@@ -22,7 +22,7 @@ module Sisimai::Bite::Email
22
22
  }.freeze
23
23
 
24
24
  def description; return 'McAfee Email Appliance'; end
25
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
25
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
26
26
  def headerlist; return %w[x-nai-header]; end
27
27
 
28
28
  # Parse bounce messages from McAfee Email Appliance
@@ -36,14 +36,14 @@ module Sisimai::Bite::Email
36
36
  # @return [Hash, Nil] Bounce data list and message/rfc822
37
37
  # part or nil if it failed to parse or
38
38
  # the arguments are missing
39
- def scan(mhead, mbody)
39
+ def make(mhead, mbody)
40
40
  return nil unless mhead['x-nai-header']
41
41
  return nil unless mhead['x-nai-header'].start_with?('Modified by McAfee ')
42
42
  return nil unless mhead['subject'] == 'Delivery Status'
43
43
 
44
44
  require 'sisimai/rfc1894'
45
45
  fieldtable = Sisimai::RFC1894.FIELDTABLE
46
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
46
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
47
47
  hasdivided = mbody.split("\n")
48
48
  havepassed = ['']
49
49
  rfc822list = [] # (Array) Each line in message/rfc822 part string
@@ -102,7 +102,7 @@ module Sisimai::Bite::Email
102
102
  # <kijitora@example.co.jp> (Unknown user kijitora@example.co.jp)
103
103
  if v['recipient']
104
104
  # There are multiple recipient addresses in the message body.
105
- dscontents << Sisimai::Bite.DELIVERYSTATUS
105
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
106
106
  v = dscontents[-1]
107
107
  end
108
108
  v['recipient'] = cv[1]
@@ -1,13 +1,13 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::MessageLabs parses a bounce email which created by
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::MessageLabs parses a bounce email which created by
3
3
  # Symantec.cloud: formerly MessageLabs. Methods in the module are called
4
4
  # from only Sisimai::Message.
5
5
  module MessageLabs
6
6
  class << self
7
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/MessageLabs.pm
8
- require 'sisimai/bite/email'
7
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/MessageLabs.pm
8
+ require 'sisimai/lhost'
9
9
 
10
- Indicators = Sisimai::Bite::Email.INDICATORS
10
+ Indicators = Sisimai::Lhost.INDICATORS
11
11
  StartingOf = {
12
12
  message: ['Content-Type: message/delivery-status'],
13
13
  rfc822: ['Content-Type: text/rfc822-headers'],
@@ -18,7 +18,7 @@ module Sisimai::Bite::Email
18
18
  }.freeze
19
19
 
20
20
  def description; return 'Symantec.cloud http://www.messagelabs.com'; end
21
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
21
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
22
22
 
23
23
  # X-Msg-Ref: server-11.tower-143.messagelabs.com!1419367175!36473369!1
24
24
  # X-Originating-IP: [10.245.230.38]
@@ -38,7 +38,7 @@ module Sisimai::Bite::Email
38
38
  # @return [Hash, Nil] Bounce data list and message/rfc822
39
39
  # part or nil if it failed to parse or
40
40
  # the arguments are missing
41
- def scan(mhead, mbody)
41
+ def make(mhead, mbody)
42
42
  return nil unless mhead['x-msg-ref']
43
43
  return nil unless mhead['from'].include?('MAILER-DAEMON@messagelabs.com')
44
44
  return nil unless mhead['subject'].start_with?('Mail Delivery Failure')
@@ -47,7 +47,7 @@ module Sisimai::Bite::Email
47
47
  fieldtable = Sisimai::RFC1894.FIELDTABLE
48
48
  permessage = {} # (Hash) Store values of each Per-Message field
49
49
 
50
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
50
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
51
51
  hasdivided = mbody.split("\n")
52
52
  havepassed = ['']
53
53
  rfc822list = [] # (Array) Each line in message/rfc822 part string
@@ -103,7 +103,7 @@ module Sisimai::Bite::Email
103
103
  # Final-Recipient: rfc822; kijitora@example.jp
104
104
  if v['recipient']
105
105
  # There are multiple recipient addresses in the message body.
106
- dscontents << Sisimai::Bite.DELIVERYSTATUS
106
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
107
107
  v = dscontents[-1]
108
108
  end
109
109
  v['recipient'] = o[2]
@@ -1,19 +1,19 @@
1
- module Sisimai::Bite::Email
2
- # Sisimai::Bite::Email::MessagingServer parses a bounce email which created
1
+ module Sisimai::Lhost
2
+ # Sisimai::Lhost::MessagingServer parses a bounce email which created
3
3
  # by Oracle Communications Messaging Server and Sun Java System Messaging
4
4
  # Server. Methods in the module are called from only Sisimai::Message.
5
5
  module MessagingServer
6
6
  class << self
7
- # Imported from p5-Sisimail/lib/Sisimai/Bite/Email/MessagingServer.pm
8
- require 'sisimai/bite/email'
7
+ # Imported from p5-Sisimail/lib/Sisimai/Lhost/MessagingServer.pm
8
+ require 'sisimai/lhost'
9
9
 
10
- Indicators = Sisimai::Bite::Email.INDICATORS
10
+ Indicators = Sisimai::Lhost.INDICATORS
11
11
  StartingOf = { message: ['This report relates to a message you sent with the following header fields:'] }.freeze
12
12
  MarkingsOf = { rfc822: %r!\A(?:Content-type:[ ]*message/rfc822|Return-path:[ ]*)! }.freeze
13
13
  MessagesOf = { 'hostunknown' => ['Illegal host/domain name found'] }.freeze
14
14
 
15
15
  def description; return 'Oracle Communications Messaging Server'; end
16
- def smtpagent; return Sisimai::Bite.smtpagent(self); end
16
+ def smtpagent; return Sisimai::Lhost.smtpagent(self); end
17
17
  def headerlist; return []; end
18
18
 
19
19
  # Parse bounce messages from MessagingServer
@@ -27,14 +27,14 @@ module Sisimai::Bite::Email
27
27
  # @return [Hash, Nil] Bounce data list and message/rfc822
28
28
  # part or nil if it failed to parse or
29
29
  # the arguments are missing
30
- def scan(mhead, mbody)
30
+ def make(mhead, mbody)
31
31
  # :received => %r/[ ][(]MessagingServer[)][ ]with[ ]/,
32
32
  match = 0
33
33
  match += 1 if mhead['content-type'].include?('Boundary_(ID_')
34
34
  match += 1 if mhead['subject'].start_with?('Delivery Notification: ')
35
35
  return nil unless match > 0
36
36
 
37
- dscontents = [Sisimai::Bite.DELIVERYSTATUS]
37
+ dscontents = [Sisimai::Lhost.DELIVERYSTATUS]
38
38
  hasdivided = mbody.split("\n")
39
39
  rfc822list = [] # (Array) Each line in message/rfc822 part string
40
40
  blanklines = 0 # (Integer) The number of blank lines
@@ -96,7 +96,7 @@ module Sisimai::Bite::Email
96
96
  # Recipient address: kijitora@example.jp
97
97
  if v['recipient']
98
98
  # There are multiple recipient addresses in the message body.
99
- dscontents << Sisimai::Bite.DELIVERYSTATUS
99
+ dscontents << Sisimai::Lhost.DELIVERYSTATUS
100
100
  v = dscontents[-1]
101
101
  end
102
102
  v['recipient'] = Sisimai::Address.s3s4(cv[1])