sisimai 4.24.1-java → 4.25.0-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 (155) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -2
  3. data/ANALYTICAL-PRECISION +16 -25
  4. data/ChangeLog.md +41 -0
  5. data/Developers.mk +2 -2
  6. data/README-JA.md +13 -13
  7. data/README.md +13 -13
  8. data/lib/sisimai.rb +3 -7
  9. data/lib/sisimai/address.rb +25 -41
  10. data/lib/sisimai/arf.rb +58 -59
  11. data/lib/sisimai/bite.rb +0 -1
  12. data/lib/sisimai/bite/email.rb +7 -7
  13. data/lib/sisimai/bite/email/activehunter.rb +4 -3
  14. data/lib/sisimai/bite/email/amavis.rb +133 -0
  15. data/lib/sisimai/bite/email/amazonses.rb +53 -87
  16. data/lib/sisimai/bite/email/amazonworkmail.rb +51 -57
  17. data/lib/sisimai/bite/email/aol.rb +50 -76
  18. data/lib/sisimai/bite/email/apachejames.rb +2 -2
  19. data/lib/sisimai/bite/email/bigfoot.rb +47 -74
  20. data/lib/sisimai/bite/email/biglobe.rb +8 -9
  21. data/lib/sisimai/bite/email/courier.rb +56 -101
  22. data/lib/sisimai/bite/email/domino.rb +7 -8
  23. data/lib/sisimai/bite/email/einsundeins.rb +4 -5
  24. data/lib/sisimai/bite/email/exchange2003.rb +21 -22
  25. data/lib/sisimai/bite/email/exchange2007.rb +26 -28
  26. data/lib/sisimai/bite/email/exim.rb +48 -47
  27. data/lib/sisimai/bite/email/ezweb.rb +24 -36
  28. data/lib/sisimai/bite/email/facebook.rb +54 -79
  29. data/lib/sisimai/bite/email/fml.rb +10 -10
  30. data/lib/sisimai/bite/email/gmx.rb +6 -6
  31. data/lib/sisimai/bite/email/google.rb +12 -13
  32. data/lib/sisimai/bite/email/gsuite.rb +80 -108
  33. data/lib/sisimai/bite/email/imailserver.rb +16 -16
  34. data/lib/sisimai/bite/email/interscanmss.rb +4 -6
  35. data/lib/sisimai/bite/email/kddi.rb +9 -11
  36. data/lib/sisimai/bite/email/mailfoundry.rb +2 -2
  37. data/lib/sisimai/bite/email/mailmarshalsmtp.rb +2 -2
  38. data/lib/sisimai/bite/email/mailru.rb +12 -13
  39. data/lib/sisimai/bite/email/mcafee.rb +31 -25
  40. data/lib/sisimai/bite/email/messagelabs.rb +48 -87
  41. data/lib/sisimai/bite/email/messagingserver.rb +9 -10
  42. data/lib/sisimai/bite/email/mfilter.rb +16 -16
  43. data/lib/sisimai/bite/email/mxlogic.rb +11 -11
  44. data/lib/sisimai/bite/email/notes.rb +5 -6
  45. data/lib/sisimai/bite/email/office365.rb +25 -42
  46. data/lib/sisimai/bite/email/opensmtpd.rb +8 -8
  47. data/lib/sisimai/bite/email/outlook.rb +49 -67
  48. data/lib/sisimai/bite/email/postfix.rb +78 -112
  49. data/lib/sisimai/bite/email/qmail.rb +23 -23
  50. data/lib/sisimai/bite/email/receivingses.rb +53 -86
  51. data/lib/sisimai/bite/email/sendgrid.rb +65 -84
  52. data/lib/sisimai/bite/email/sendmail.rb +89 -117
  53. data/lib/sisimai/bite/email/surfcontrol.rb +15 -18
  54. data/lib/sisimai/bite/email/userdefined.rb +1 -1
  55. data/lib/sisimai/bite/email/v5sendmail.rb +3 -4
  56. data/lib/sisimai/bite/email/verizon.rb +7 -8
  57. data/lib/sisimai/bite/email/x1.rb +2 -2
  58. data/lib/sisimai/bite/email/x2.rb +2 -2
  59. data/lib/sisimai/bite/email/x3.rb +3 -3
  60. data/lib/sisimai/bite/email/x4.rb +22 -22
  61. data/lib/sisimai/bite/email/x5.rb +40 -49
  62. data/lib/sisimai/bite/email/yahoo.rb +3 -3
  63. data/lib/sisimai/bite/email/yandex.rb +54 -82
  64. data/lib/sisimai/bite/email/zoho.rb +6 -6
  65. data/lib/sisimai/bite/json/amazonses.rb +20 -20
  66. data/lib/sisimai/bite/json/sendgrid.rb +2 -2
  67. data/lib/sisimai/data.rb +27 -40
  68. data/lib/sisimai/datetime.rb +146 -162
  69. data/lib/sisimai/mda.rb +30 -31
  70. data/lib/sisimai/message/email.rb +83 -123
  71. data/lib/sisimai/message/json.rb +2 -4
  72. data/lib/sisimai/mime.rb +31 -34
  73. data/lib/sisimai/order/email.rb +23 -22
  74. data/lib/sisimai/reason.rb +61 -61
  75. data/lib/sisimai/reason/blocked.rb +139 -135
  76. data/lib/sisimai/reason/contenterror.rb +11 -10
  77. data/lib/sisimai/reason/exceedlimit.rb +4 -4
  78. data/lib/sisimai/reason/expired.rb +20 -20
  79. data/lib/sisimai/reason/filtered.rb +19 -18
  80. data/lib/sisimai/reason/hasmoved.rb +3 -3
  81. data/lib/sisimai/reason/hostunknown.rb +19 -19
  82. data/lib/sisimai/reason/mailboxfull.rb +49 -49
  83. data/lib/sisimai/reason/mailererror.rb +16 -16
  84. data/lib/sisimai/reason/mesgtoobig.rb +17 -17
  85. data/lib/sisimai/reason/networkerror.rb +19 -19
  86. data/lib/sisimai/reason/norelaying.rb +16 -16
  87. data/lib/sisimai/reason/notaccept.rb +9 -10
  88. data/lib/sisimai/reason/onhold.rb +1 -1
  89. data/lib/sisimai/reason/policyviolation.rb +21 -20
  90. data/lib/sisimai/reason/rejected.rb +53 -53
  91. data/lib/sisimai/reason/securityerror.rb +29 -29
  92. data/lib/sisimai/reason/spamdetected.rb +127 -127
  93. data/lib/sisimai/reason/suspend.rb +17 -17
  94. data/lib/sisimai/reason/systemerror.rb +22 -21
  95. data/lib/sisimai/reason/systemfull.rb +6 -6
  96. data/lib/sisimai/reason/toomanyconn.rb +19 -18
  97. data/lib/sisimai/reason/userunknown.rb +122 -121
  98. data/lib/sisimai/reason/vacation.rb +8 -8
  99. data/lib/sisimai/reason/virusdetected.rb +8 -8
  100. data/lib/sisimai/rfc1894.rb +142 -0
  101. data/lib/sisimai/rfc3464.rb +70 -70
  102. data/lib/sisimai/rfc3834.rb +15 -15
  103. data/lib/sisimai/rfc5322.rb +20 -36
  104. data/lib/sisimai/rhost.rb +1 -0
  105. data/lib/sisimai/rhost/exchangeonline.rb +31 -33
  106. data/lib/sisimai/rhost/franceptt.rb +23 -23
  107. data/lib/sisimai/rhost/godaddy.rb +28 -28
  108. data/lib/sisimai/rhost/googleapps.rb +39 -41
  109. data/lib/sisimai/rhost/kddi.rb +3 -3
  110. data/lib/sisimai/rhost/tencentqq.rb +51 -0
  111. data/lib/sisimai/smtp/error.rb +14 -21
  112. data/lib/sisimai/smtp/reply.rb +14 -13
  113. data/lib/sisimai/smtp/status.rb +178 -179
  114. data/lib/sisimai/string.rb +13 -12
  115. data/lib/sisimai/version.rb +1 -1
  116. data/set-of-emails/README.md +1 -5
  117. data/set-of-emails/maildir/bsd/arf-23.eml +49 -0
  118. data/set-of-emails/maildir/bsd/email-amavis-01.eml +78 -0
  119. data/set-of-emails/maildir/bsd/email-amavis-02.eml +78 -0
  120. data/set-of-emails/maildir/bsd/email-exchange2007-04.eml +146 -0
  121. data/set-of-emails/maildir/bsd/email-exim-60.eml +94 -0
  122. data/set-of-emails/maildir/bsd/email-ezweb-08.eml +49 -0
  123. data/set-of-emails/maildir/bsd/email-google-19.eml +67 -0
  124. data/set-of-emails/maildir/bsd/email-mcafee-05.eml +74 -0
  125. data/set-of-emails/maildir/bsd/email-messagingserver-12.eml +99 -0
  126. data/set-of-emails/maildir/bsd/email-postfix-46.eml +81 -0
  127. data/set-of-emails/maildir/bsd/email-postfix-47.eml +79 -0
  128. data/set-of-emails/maildir/bsd/email-postfix-48.eml +79 -0
  129. data/set-of-emails/maildir/bsd/email-postfix-49.eml +141 -0
  130. data/set-of-emails/maildir/bsd/email-postfix-50.eml +143 -0
  131. data/set-of-emails/maildir/bsd/email-postfix-51.eml +73 -0
  132. data/set-of-emails/maildir/bsd/email-postfix-52.eml +79 -0
  133. data/set-of-emails/maildir/bsd/email-postfix-53.eml +76 -0
  134. data/set-of-emails/maildir/bsd/email-postfix-54.eml +73 -0
  135. data/set-of-emails/maildir/bsd/email-postfix-55.eml +74 -0
  136. data/set-of-emails/maildir/bsd/email-postfix-56.eml +78 -0
  137. data/set-of-emails/maildir/bsd/email-qmail-10.eml +50 -0
  138. data/set-of-emails/maildir/bsd/email-x2-05.eml +38 -0
  139. data/set-of-emails/maildir/bsd/rhost-google-apps-02.eml +88 -0
  140. data/set-of-emails/maildir/bsd/rhost-tencentqq-01.eml +84 -0
  141. data/set-of-emails/maildir/bsd/rhost-tencentqq-02.eml +84 -0
  142. data/set-of-emails/maildir/bsd/rhost-tencentqq-03.eml +81 -0
  143. data/set-of-emails/maildir/dos/email-amavis-01.eml +78 -0
  144. data/set-of-emails/maildir/dos/email-apachejames-01.eml +1 -2
  145. data/set-of-emails/maildir/dos/email-messagelabs-01.eml +67 -50
  146. data/set-of-emails/maildir/dos/email-x4-01.eml +31 -76
  147. data/set-of-emails/maildir/dos/rhost-tencentqq-01.eml +84 -0
  148. data/set-of-emails/maildir/mac/email-amavis-01.eml +1 -4
  149. data/set-of-emails/maildir/mac/email-apachejames-01.eml +1 -9
  150. data/set-of-emails/maildir/mac/email-messagelabs-01.eml +1 -9
  151. data/set-of-emails/maildir/mac/email-x4-01.eml +1 -5
  152. data/set-of-emails/maildir/mac/rhost-tencentqq-01.eml +1 -4
  153. metadata +35 -4
  154. data/set-of-emails/logo/horizontalversions.png +0 -0
  155. data/set-of-emails/logo/icon.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b6e18c24dda8b7ef86cf3636cf29c047d246f66
4
- data.tar.gz: 1be9f5d335e41784268a89d0c3faf6b85e64b731
3
+ metadata.gz: 7aa5cc01306c3b0f700213220f61eb69664fbbe3
4
+ data.tar.gz: 605434fbe0db77535056d60f02fbe09437bd30c7
5
5
  SHA512:
6
- metadata.gz: ceed8b7a6205c853dfec0bd0424890d88cf517261d1096dccff8fe0686383d5ea069441df8478d2e065837c25973bbf4dea75abece7a8dbcff5ef427dff1121c
7
- data.tar.gz: a2365ad31d835a608ef97ac4804edca085ef59cce3fd43214f64f4fa876bd3780d165a5dead4a8aa6e99365db65f69668ad89326ee6ac32b7a830eed2cf551a0
6
+ metadata.gz: b4cad32a42fc61d64af6b20e59e0219e5e43877b1e902e5be98c4e09f3cc9a42441a8023a7e4db588133f47a6e9a2daa7a0216e10bda0b6589290de6c25f6a4e
7
+ data.tar.gz: 34cb8665b9892423a33dc0ba86ed31e7dd5fb3d0b136bd66cdc98e7ce12cb7b641453dec532f7cf6ec3941995a98dc309bf7f12886be049a32242c7713101b50
data/.travis.yml CHANGED
@@ -5,8 +5,9 @@ rvm:
5
5
  - 2.3.0
6
6
  - 2.4.0
7
7
  - 2.5.0
8
- - jruby-9.0.5.0
9
- - jruby-9.1.9.0
8
+ - 2.6.0
9
+ # - jruby-9.0.5.0
10
+ # - jruby-9.1.9.0
10
11
  before_install:
11
12
  script:
12
13
  - rake spec
data/ANALYTICAL-PRECISION CHANGED
@@ -1,18 +1,8 @@
1
- for v in `ls -1 ./lib/Sisimai/Bite/Email/*.pm | grep -v UserDefined`; do \
2
- MTA=`echo $v | cut -d/ -f6 | tr '[A-Z]' '[a-z]' | sed 's/.pm//g'` ;\
3
- mkdir -p tmp/emails-for-precision/email-$MTA ;\
4
- cp set-of-emails/maildir/bsd/email-$MTA-*.eml tmp/emails-for-precision/email-$MTA/ ;\
5
- cp set-of-emails/private/email-$MTA/* tmp/emails-for-precision/email-$MTA/ ;\
6
- done
7
- for v in arf rfc3464 rfc3834; do \
8
- mkdir -p tmp/emails-for-precision/$v ;\
9
- cp set-of-emails/maildir/bsd/$v*.eml tmp/emails-for-precision/$v/ ;\
10
- cp set-of-emails/private/$v/* tmp/emails-for-precision/$v/ ;\
11
- done
12
1
  bounceHammer 2.7.13p3
13
2
  MTA MODULE NAME CAN PARSE RATIO NOTES
14
3
  --------------------------------------------------------------------------------
15
4
  Email::Activehunter ..... 0/0014 0.0000 TransWARE Active!hunter
5
+ Email::Amavis ........... 4/0004 1.0000 amavisd-new: https://www.amavis.org/
16
6
  Email::AmazonSES ........ 40/0049 0.8163 Amazon SES(Sending): http://aws.amazon.com/ses/
17
7
  Email::AmazonWorkMail ... 9/0013 0.6923 Amazon WorkMail: https://aws.amazon.com/workmail/
18
8
  Email::Aol .............. 20/0023 0.8696 Aol Mail: http://www.aol.com
@@ -21,16 +11,16 @@ Email::Bigfoot .......... 3/0003 1.0000 Bigfoot: http://www.bigfoot.com
21
11
  Email::Biglobe .......... 5/0007 0.7143 BIGLOBE: http://www.biglobe.ne.jp
22
12
  Email::Courier .......... 14/0016 0.8750 Courier MTA
23
13
  Email::Domino ........... 9/0018 0.5000 IBM Domino Server
24
- Email::EZweb ............ 131/0124 1.0000 au EZweb: http://www.au.kddi.com/mobile/
14
+ Email::EZweb ............ 133/0126 1.0000 au EZweb: http://www.au.kddi.com/mobile/
25
15
  Email::EinsUndEins ...... 0/0004 0.0000 1&1: http://www.1and1.de
26
16
  Email::Exchange2003 ..... 1/0051 0.0196 Microsoft Exchange Server 2003
27
- Email::Exchange2007 ..... 8/0010 0.8000 Microsoft Exchange Server 2007
28
- Email::Exim ............. 228/0253 0.9012 Exim
17
+ Email::Exchange2007 ..... 10/0012 0.8333 Microsoft Exchange Server 2007
18
+ Email::Exim ............. 230/0255 0.9020 Exim
29
19
  Email::FML .............. 0/0004 0.0000 fml mailing list server/manager
30
20
  Email::Facebook ......... 5/0005 1.0000 Facebook: https://www.facebook.com
31
21
  Email::GMX .............. 0/0010 0.0000 GMX: http://www.gmx.net
32
22
  Email::GSuite ........... 19/0019 1.0000 G Suite: https://gsuite.google.com/
33
- Email::Google ........... 59/0061 0.9672 Google Gmail: https://mail.google.com
23
+ Email::Google ........... 61/0063 0.9683 Google Gmail: https://mail.google.com
34
24
  Email::IMailServer ...... 0/0022 0.0000 IPSWITCH IMail Server
35
25
  Email::InterScanMSS ..... 0/0008 0.0000 Trend Micro InterScan Messaging Security Suite
36
26
  Email::KDDI ............. 6/0006 1.0000 au by KDDI: http://www.au.kddi.com
@@ -38,22 +28,22 @@ Email::MXLogic .......... 0/0014 0.0000 McAfee SaaS
38
28
  Email::MailFoundry ...... 0/0007 0.0000 MailFoundry
39
29
  Email::MailMarshalSMTP .. 0/0004 0.0000 Trustwave Secure Email Gateway
40
30
  Email::MailRu ........... 4/0023 0.1739 @mail.ru: https://mail.ru
41
- Email::McAfee ........... 0/0012 0.0000 McAfee Email Appliance
31
+ Email::McAfee ........... 0/0014 0.0000 McAfee Email Appliance
42
32
  Email::MessageLabs ...... 7/0007 1.0000 Symantec.cloud http://www.messagelabs.com
43
- Email::MessagingServer .. 28/0031 0.9032 Oracle Communications Messaging Server
33
+ Email::MessagingServer .. 30/0033 0.9091 Oracle Communications Messaging Server
44
34
  Email::Notes ............ 0/0013 0.0000 Lotus Notes
45
35
  Email::Office365 ........ 22/0025 0.8800 Microsoft Office 365: http://office.microsoft.com/
46
36
  Email::OpenSMTPD ........ 6/0024 0.2500 OpenSMTPD
47
37
  Email::Outlook .......... 21/0023 0.9130 Microsoft Outlook.com: https://www.outlook.com/
48
- Email::Postfix .......... 222/0238 0.9328 Postfix
38
+ Email::Postfix .......... 248/0264 0.9394 Postfix
49
39
  Email::ReceivingSES ..... 0/0007 0.0000 Amazon SES(Receiving): http://aws.amazon.com/ses/
50
40
  Email::SendGrid ......... 7/0012 0.5833 SendGrid: http://sendgrid.com/
51
- Email::Sendmail ......... 354/0280 1.0000 V8Sendmail: /usr/sbin/sendmail
41
+ Email::Sendmail ......... 354/0279 1.0000 V8Sendmail: /usr/sbin/sendmail
52
42
  Email::SurfControl ...... 6/0008 0.7500 WebSense SurfControl
53
43
  Email::V5sendmail ....... 0/0386 0.0000 Sendmail version 5
54
44
  Email::Verizon .......... 4/0004 1.0000 Verizon Wireless: http://www.verizonwireless.com
55
45
  Email::X1 ............... 0/0007 0.0000 Unknown MTA #1
56
- Email::X2 ............... 0/0068 0.0000 Unknown MTA #2
46
+ Email::X2 ............... 0/0070 0.0000 Unknown MTA #2
57
47
  Email::X3 ............... 0/0012 0.0000 Unknown MTA #3
58
48
  Email::X4 ............... 0/0029 0.0000 Unknown MTA #4 qmail clones
59
49
  Email::X5 ............... 3/0003 1.0000 Unknown MTA #5
@@ -61,11 +51,12 @@ Email::Yahoo ............ 0/0025 0.0000 Yahoo! MAIL: https://www.yahoo.com
61
51
  Email::Yandex ........... 4/0007 0.5714 Yandex.Mail: http://www.yandex.ru
62
52
  Email::Zoho ............. 0/0011 0.0000 Zoho Mail: https://www.zoho.com
63
53
  Email::mFILTER .......... 0/0009 0.0000 Digital Arts m-FILTER
64
- Email::qmail ............ 56/0085 0.6588 qmail
54
+ Email::qmail ............ 58/0087 0.6667 qmail
65
55
  JSON::AmazonSES ......... 40/0049 0.8163 Amazon SES(JSON): http://aws.amazon.com/ses/
66
56
  JSON::SendGrid .......... 7/0012 0.5833 SendGrid(JSON): http://sendgrid.com/
67
- ARF ..................... 8/0037 0.2162 RFC3464 ................. 150/0292 0.5137 Fallback Module for MTAs
68
- RFC3834 ................. 0/0013 0.0000 Detector for auto replied message
57
+ ARF ..................... 8/0038 0.2105 Abuse Feedback Reporting Format
58
+ RFC3464 ................. 151/0290 0.5207 Fallback Module for MTAs
59
+ RFC3834 ................. 0/0014 0.0000 Detector for auto replied message
69
60
  --------------------------------------------------------------------------------
70
- bounceHammer 2.7.13p3 1356/2211 0.6133
71
- Sisimai v4.24.0 2211/2211 1.0000
61
+ bounceHammer 2.7.13p3 1549/2548 0.6079
62
+ Sisimai v4.25.0 2548/2548 1.0000
data/ChangeLog.md CHANGED
@@ -3,6 +3,47 @@ RELEASE NOTES for Ruby version of Sisimai
3
3
  - releases: "https://github.com/sisimai/rb-Sisimai/releases"
4
4
  - download: "https://rubygems.org/gems/sisimai"
5
5
 
6
+ v4.25.0
7
+ --------------------------------------------------------------------------------
8
+ - release: "Tue, 9 Apr 2019 11:22:22 +0900 (JST)"
9
+ - version: "4.25.0"
10
+ - changes:
11
+ - Implement new class `Sisimai::RFC1894` for parsing message/delivery-status
12
+ part. #133
13
+ - Experimental implementation at the following MTA, Rhost modules:
14
+ - `Sisimai::Bite::Email::Amavis`: amavisd-new
15
+ - `Sisimai::Rhost::TencentQQ`: Tencent QQ (mail.qq.com)
16
+ - Remove unused methods and variables
17
+ - `Sisimai::DateTime.hourname`
18
+ - `$Sisimai::DateTime::HourNames`
19
+ - `Sisimai::RFC5322.is_domainpart`
20
+ - Code refactoring: less lines of code and shallower indentation.
21
+ - Build test for JRuby on Travis CI was temporarily disabled. #138
22
+ - Sisimai works on Ruby 2.6.0
23
+ - Fix `Sisimai::ARF.is_arf` method to remove angle brackets:`<` and `>` from
24
+ `From:` header.
25
+ - Fix serious bug (Hash key typo) in `Sisimai::Rhost::Google`
26
+ - Less Symbol, less `String#to_sym`.
27
+ - Remove `set-of-emails/logo` directory because we cannot change the license
28
+ of each file in the directory to The 2-Clause BSD License.
29
+ - Update error message patterns in the following modules:
30
+ - `Sisimai::Reason::Blocked` (hotmail, ntt docomo)
31
+ - `Sisimai::Reason::PolicyViolation` (postfix)
32
+ - `Sisimai::Reason::Rejected` (postfix)
33
+ - `Sisimai::Reason::SystemError` (hotmail)
34
+ - `Sisimai::Reason::TooManyConn` (ntt docomo)
35
+ - `Sisimai::Reason::UserUnknown` (hotmail)
36
+ - `Sisimai::Bite::Email::McAfee` (userunknown)
37
+ - `Sisimai::Bite::Email::Exchange2007` (securityerror)
38
+ - The order of `Sisimai::Bite::Email` modules to be loaded has been changed:
39
+ Load Office365 and Outlook prior to Exchange2007 and Exchange2003.
40
+ - Update the followng MTA modules for improvements and bug fixes:
41
+ - `Sisimai::Bite::Email::Exchange2007`
42
+ - MIME Decoding in `Subject:` header improved.
43
+ - Bug fix in `Sisimai::MIME.is_mimeencoded` method.
44
+ - Make stable the order of MTA modules which have MTA specific email headers
45
+ at `Sisimai::Order::Email.headers` method.
46
+
6
47
  v4.24.1
7
48
  --------------------------------------------------------------------------------
8
49
  - release: "Wed, 14 Nov 2018 11:09:44 +0900 (JST)"
data/Developers.mk CHANGED
@@ -68,13 +68,13 @@ update-other-format-emails:
68
68
  done
69
69
 
70
70
  emails-for-precision:
71
- for v in `$(LS) ./$(MAILCLASSDIR)/*.rb | grep -v userdefined`; do \
71
+ @ for v in `$(LS) ./$(MAILCLASSDIR)/*.rb | grep -v userdefined`; do \
72
72
  MTA=`echo $$v | cut -d/ -f6 | tr '[A-Z]' '[a-z]' | sed 's/.rb//g'` ;\
73
73
  $(MKDIR) $(PRECISIONDIR)/email-$$MTA ;\
74
74
  $(CP) $(PUBLICEMAILS)/email-$$MTA-*.eml $(PRECISIONDIR)/email-$$MTA/ ;\
75
75
  $(CP) $(PRIVATEMAILS)/email-$$MTA/* $(PRECISIONDIR)/email-$$MTA/ ;\
76
76
  done
77
- for v in arf rfc3464 rfc3834; do \
77
+ @ for v in arf rfc3464 rfc3834; do \
78
78
  $(MKDIR) $(PRECISIONDIR)/$$v ;\
79
79
  $(CP) $(PUBLICEMAILS)/$$v*.eml $(PRECISIONDIR)/$$v/ ;\
80
80
  $(CP) $(PRIVATEMAILS)/$$v/* $(PRECISIONDIR)/$$v/ ;\
data/README-JA.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Coverage Status](https://img.shields.io/coveralls/sisimai/rb-Sisimai.svg)](https://coveralls.io/r/sisimai/rb-Sisimai)
5
5
  [![Build Status](https://travis-ci.org/sisimai/rb-Sisimai.svg?branch=master)](https://travis-ci.org/sisimai/rb-Sisimai)
6
6
  [![Codacy Badge](https://api.codacy.com/project/badge/grade/38340177e6284a65be69c0c7c3dc2b58)](https://www.codacy.com/app/azumakuniyuki/rb-Sisimai)
7
- [![Ruby](https://img.shields.io/badge/ruby-v2.1.0--v2.4.0-red.svg)](https://www.ruby-lang.org/)
7
+ [![Ruby](https://img.shields.io/badge/ruby-v2.1.0--v2.6.0-red.svg)](https://www.ruby-lang.org/)
8
8
  [![Gem Version](https://badge.fury.io/rb/sisimai.svg)](https://badge.fury.io/rb/sisimai)
9
9
 
10
10
  - [**README(English)**](README.md)
@@ -54,7 +54,7 @@ Key features
54
54
  * git clone & make
55
55
  * __高い解析精度__
56
56
  * 解析精度はbounceHammerの2倍
57
- * 28種類のMTAに対応
57
+ * 29種類のMTAに対応
58
58
  * 22種類の著名なMSPに対応
59
59
  * 2種類の著名なメール配信クラウドに対応(JSON)
60
60
  * Feedback Loopにも対応
@@ -80,10 +80,10 @@ Install
80
80
 
81
81
  ```shell
82
82
  $ sudo gem install sisimai
83
- Fetching: sisimai-4.23.0.gem (100%)
84
- Successfully installed sisimai-4.23.0
85
- Parsing documentation for sisimai-4.23.0
86
- Installing ri documentation for sisimai-4.23.0
83
+ Fetching: sisimai-4.25.0.gem (100%)
84
+ Successfully installed sisimai-4.25.0
85
+ Parsing documentation for sisimai-4.25.0
86
+ Installing ri documentation for sisimai-4.25.0
87
87
  Done installing documentation for sisimai after 6 seconds
88
88
  1 gem installed
89
89
  ```
@@ -99,8 +99,8 @@ gem install bundle rake rspec coveralls
99
99
  ...
100
100
  4 gems installed
101
101
  bundle exec rake install
102
- sisimai 4.23.0 built to pkg/sisimai-4.23.0.gem.
103
- sisimai (4.23.0) installed.
102
+ sisimai 4.25.0 built to pkg/sisimai-4.25.0.gem.
103
+ sisimai (4.25.0) installed.
104
104
  ```
105
105
 
106
106
  Usage
@@ -238,14 +238,14 @@ Differences between Ruby version and Perl version
238
238
 
239
239
  | 機能 | Ruby version | Perl version |
240
240
  |---------------------------------------------|----------------|---------------|
241
- | 動作環境 | Ruby 2.1 - 2.5 | Perl 5.10 - |
241
+ | 動作環境 | Ruby 2.1 - 2.6 | Perl 5.10 - |
242
242
  | | JRuby 9.0.4.0- | |
243
243
  | 解析精度の割合(2000通のメール)[1] | 1.00 | 1.00 |
244
- | メール解析速度(1000通のメール) | 3.20秒[2] | 1.60秒 |
244
+ | メール解析速度(1000通のメール) | 2.22秒[2] | 1.50秒 |
245
245
  | インストール方法 | gem install | cpanm, cpm |
246
246
  | 依存モジュール数(コアモジュールを除く) | 1モジュール | 2モジュール |
247
- | LOC:ソースコードの行数 | 11700行 | 8600行 |
248
- | テスト件数(spec/,t/,xt/ディレクトリ) | 218000件 | 236600件 |
247
+ | LOC:ソースコードの行数 | 11700行 | 8200行 |
248
+ | テスト件数(spec/,t/,xt/ディレクトリ) | 224000件 | 242000件 |
249
249
  | ライセンス | 二条項BSD | 二条項BSD |
250
250
  | 開発会社によるサポート契約 | 準備中 | 提供中 |
251
251
 
@@ -300,7 +300,7 @@ Author
300
300
 
301
301
  Copyright
302
302
  ===============================================================================
303
- Copyright (C) 2015-2018 azumakuniyuki, All Rights Reserved.
303
+ Copyright (C) 2015-2019 azumakuniyuki, All Rights Reserved.
304
304
 
305
305
  License
306
306
  ===============================================================================
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Coverage Status](https://img.shields.io/coveralls/sisimai/rb-Sisimai.svg)](https://coveralls.io/r/sisimai/rb-Sisimai)
5
5
  [![Build Status](https://travis-ci.org/sisimai/rb-Sisimai.svg?branch=master)](https://travis-ci.org/sisimai/rb-Sisimai)
6
6
  [![Codacy Badge](https://api.codacy.com/project/badge/grade/38340177e6284a65be69c0c7c3dc2b58)](https://www.codacy.com/app/azumakuniyuki/rb-Sisimai)
7
- [![Ruby](https://img.shields.io/badge/ruby-v2.1.0--v2.4.0-red.svg)](https://www.ruby-lang.org/)
7
+ [![Ruby](https://img.shields.io/badge/ruby-v2.1.0--v2.6.0-red.svg)](https://www.ruby-lang.org/)
8
8
  [![Gem Version](https://badge.fury.io/rb/sisimai.svg)](https://badge.fury.io/rb/sisimai)
9
9
 
10
10
  - [**README-JA(日本語)**](README-JA.md)
@@ -53,7 +53,7 @@ Key Features
53
53
  * git clone & make
54
54
  * __High Precision of Analysis__
55
55
  * 2 times higher than bounceHammer
56
- * Support 23 known MTAs and 5 unknown MTAs
56
+ * Support 24 known MTAs and 5 unknown MTAs
57
57
  * Support 22 major MSPs(Mail Service Providers)
58
58
  * Support 2 major Cloud Email Delivery Services(JSON format)
59
59
  * Support Feedback Loop Message(ARF)
@@ -85,10 +85,10 @@ Install
85
85
 
86
86
  ```shell
87
87
  $ sudo gem install sisimai
88
- Fetching: sisimai-4.23.0.gem (100%)
89
- Successfully installed sisimai-4.23.0
90
- Parsing documentation for sisimai-4.23.0
91
- Installing ri documentation for sisimai-4.23.0
88
+ Fetching: sisimai-4.25.0.gem (100%)
89
+ Successfully installed sisimai-4.25.0
90
+ Parsing documentation for sisimai-4.25.0
91
+ Installing ri documentation for sisimai-4.25.0
92
92
  Done installing documentation for sisimai after 6 seconds
93
93
  1 gem installed
94
94
  ```
@@ -104,8 +104,8 @@ gem install bundle rake rspec coveralls
104
104
  ...
105
105
  4 gems installed
106
106
  bundle exec rake install
107
- sisimai 4.23.0 built to pkg/sisimai-4.23.0.gem.
108
- sisimai (4.23.0) installed.
107
+ sisimai 4.25.0 built to pkg/sisimai-4.25.0.gem.
108
+ sisimai (4.25.0) installed.
109
109
  ```
110
110
 
111
111
  Usage
@@ -242,14 +242,14 @@ and bounceHammer are available at
242
242
 
243
243
  | Features | Ruby version | Perl version |
244
244
  |---------------------------------------------|----------------|---------------|
245
- | System requirements | Ruby 2.1 - 2.5 | Perl 5.10 - |
245
+ | System requirements | Ruby 2.1 - 2.6 | Perl 5.10 - |
246
246
  | | JRuby 9.0.4.0- | |
247
247
  | Analytical precision ratio(2000 emails)[1] | 1.00 | 1.00 |
248
- | The speed of parsing email(1000 emails) | 3.20s[2] | 1.60s |
248
+ | The speed of parsing email(1000 emails) | 2.22s[2] | 1.50s |
249
249
  | How to install | gem install | cpanm, cpm |
250
250
  | Dependencies (Except core modules) | 1 module | 2 modules |
251
- | LOC:Source lines of code | 11700 lines | 8600 lines |
252
- | The number of tests(spec/,t/,xt/) directory | 218000 tests | 236600 tests |
251
+ | LOC:Source lines of code | 11700 lines | 8200 lines |
252
+ | The number of tests(spec/,t/,xt/) directory | 224000 tests | 242000 tests |
253
253
  | License | BSD 2-Clause | BSD 2-Clause |
254
254
  | Support Contract provided by Developer | Coming soon | Available |
255
255
 
@@ -306,7 +306,7 @@ Author
306
306
 
307
307
  Copyright
308
308
  ===============================================================================
309
- Copyright (C) 2015-2018 azumakuniyuki, All Rights Reserved.
309
+ Copyright (C) 2015-2019 azumakuniyuki, All Rights Reserved.
310
310
 
311
311
  License
312
312
  ===============================================================================
data/lib/sisimai.rb CHANGED
@@ -51,8 +51,7 @@ module Sisimai
51
51
  if input == 'email'
52
52
  # Path to mailbox or Maildir/, or STDIN: 'input' => 'email'
53
53
  require 'sisimai/mail'
54
- mail = Sisimai::Mail.new(argv0)
55
- return nil unless mail
54
+ return nil unless mail = Sisimai::Mail.new(argv0)
56
55
 
57
56
  while r = mail.read do
58
57
  # Read and parse each mail file
@@ -61,8 +60,7 @@ module Sisimai
61
60
  next if mesg.void
62
61
 
63
62
  methodargv = { data: mesg, hook: hookmethod, input: 'email', delivered: delivered1 }
64
- data = Sisimai::Data.make(methodargv)
65
- next unless data
63
+ next unless data = Sisimai::Data.make(methodargv)
66
64
  bouncedata += data unless data.empty?
67
65
  end
68
66
 
@@ -86,9 +84,7 @@ module Sisimai
86
84
  next if mesg.void
87
85
 
88
86
  methodargv = { data: mesg, hook: hookmethod, input: 'json', delivered: delivered1 }
89
- data = Sisimai::Data.make(methodargv)
90
-
91
- next unless data
87
+ next unless data = Sisimai::Data.make(methodargv)
92
88
  bouncedata += data unless data.empty?
93
89
  end
94
90
  else
@@ -7,8 +7,8 @@ module Sisimai
7
7
  :'email-address' => (1 << 0), # <neko@example.org>
8
8
  :'quoted-string' => (1 << 1), # "Neko, Nyaan"
9
9
  :'comment-block' => (1 << 2), # (neko)
10
- }
11
- @@undisclosed = 'libsisimai.org.invalid'
10
+ }.freeze
11
+ Delimiters = { '<' => 1, '>' => 1, '(' => 1, ')' => 1, '"' => 1, ',' => 1 }.freeze
12
12
 
13
13
  # Return pseudo recipient or sender address
14
14
  # @param [Symbol] argv1 Address type: :r or :s
@@ -16,10 +16,10 @@ module Sisimai
16
16
  # nil when the argv1 is neither :r nor :s
17
17
  def self.undisclosed(argv1)
18
18
  return nil unless argv1
19
- return nil unless %w[r s].index(argv1.to_s)
19
+ return nil unless %w[r s].index(argv1)
20
20
 
21
- local = argv1 == :r ? 'recipient' : 'sender'
22
- return sprintf('undisclosed-%s-in-headers@%s', local, @@undisclosed)
21
+ local = argv1 == 'r' ? 'recipient' : 'sender'
22
+ return sprintf('undisclosed-%s-in-headers@libsisimai.org.invalid', local)
23
23
  end
24
24
 
25
25
  # New constructor of Sisimai::Address
@@ -55,7 +55,6 @@ module Sisimai
55
55
  # #=> [{ address: 'neko@example.org', name: 'Neko', comment: '(nyaan)'}]
56
56
  return nil unless argv1
57
57
 
58
- characters = argv1.gsub(/[\r\n]/, '').split('')
59
58
  emailtable = { address: '', name: '', comment: '' }
60
59
  addrtables = []
61
60
  readbuffer = []
@@ -64,9 +63,13 @@ module Sisimai
64
63
  v = emailtable # temporary buffer
65
64
  p = '' # current position
66
65
 
66
+ argv1.delete!("\r") if argv1.include?("\r")
67
+ argv1.delete!("\n") if argv1.include?("\n")
68
+ characters = argv1.split('')
69
+
67
70
  while e = characters.shift do
68
71
  # Check each characters
69
- if %w[< > ( ) " ,].any? { |r| r == e }
72
+ if Delimiters.key?(e)
70
73
  # The character is a delimiter character
71
74
  if e == ','
72
75
  # Separator of email addresses or not
@@ -185,16 +188,12 @@ module Sisimai
185
188
  # email-address or comment-block
186
189
  v[p] << e
187
190
  else
188
- # Display name
191
+ # Display name like "Neko, Nyaan"
189
192
  v[:name] << e
190
- if readcursor & Indicators[:'quoted-string'] > 0
191
- # "Neko, Nyaan"
192
- unless v[:name].end_with?(%Q|\x5c"|)
193
- # "Neko, Nyaan \"...
194
- readcursor &= ~Indicators[:'quoted-string']
195
- p = ''
196
- end
197
- end
193
+ next unless readcursor & Indicators[:'quoted-string'] > 0
194
+ next if v[:name].end_with?(%Q|\x5c"|) # "Neko, Nyaan \"...
195
+ readcursor &= ~Indicators[:'quoted-string']
196
+ p = ''
198
197
  end
199
198
  next
200
199
  end # End of if('"')
@@ -234,8 +233,7 @@ module Sisimai
234
233
  while e = readbuffer.shift do
235
234
  # The element must not include any character except from 0x20 to 0x7e.
236
235
  next if e[:address] =~ /[^\x20-\x7e]/
237
-
238
- unless e[:address] =~ /\A.+[@].+\z/
236
+ unless e[:address] =~ /\A.+[@].+\z/
239
237
  # Allow if the argument is MAILER-DAEMON
240
238
  next unless Sisimai::RFC5322.is_mailerdaemon(e[:address])
241
239
  end
@@ -284,14 +282,10 @@ module Sisimai
284
282
  # @example Expand VERP address
285
283
  # expand_verp('bounce+neko=example.org@example.org') #=> 'neko@example.org'
286
284
  def self.expand_verp(email)
287
- local = email.split('@', 2).first
288
-
289
- if cv = local.match(/\A[-_\w]+?[+](\w[-._\w]+\w)[=](\w[-.\w]+\w)\z/)
290
- verp0 = cv[1] + '@' + cv[2]
291
- return verp0 if Sisimai::RFC5322.is_emailaddress(verp0)
292
- else
293
- return ''
294
- end
285
+ return nil unless email.is_a? Object::String
286
+ return nil unless cv = email.split('@', 2).first.match(/\A[-_\w]+?[+](\w[-._\w]+\w)[=](\w[-.\w]+\w)\z/)
287
+ verp0 = cv[1] + '@' + cv[2]
288
+ return verp0 if Sisimai::RFC5322.is_emailaddress(verp0)
295
289
  end
296
290
 
297
291
  # Expand alias: remove from '+' to '@'
@@ -300,12 +294,11 @@ module Sisimai
300
294
  # @example Expand alias
301
295
  # expand_alias('neko+straycat@example.org') #=> 'neko@example.org'
302
296
  def self.expand_alias(email)
303
- return '' unless Sisimai::RFC5322.is_emailaddress(email)
297
+ return nil unless Sisimai::RFC5322.is_emailaddress(email)
304
298
 
305
299
  local = email.split('@')
306
- value = ''
307
- if cv = local[0].match(/\A([-_\w]+?)[+].+\z/) then value = cv[1] + '@' + local[1] end
308
- return value
300
+ return nil unless cv = local[0].match(/\A([-_\w]+?)[+].+\z/)
301
+ return cv[1] + '@' + local[1]
309
302
  end
310
303
 
311
304
  @@roaccessors = [
@@ -342,9 +335,9 @@ module Sisimai
342
335
  email = Sisimai::Address.expand_verp(thing[:address])
343
336
  aname = nil
344
337
 
345
- if email.empty?
338
+ unless email
346
339
  # Is not VERP address, try to expand the address as an alias
347
- email = Sisimai::Address.expand_alias(thing[:address])
340
+ email = Sisimai::Address.expand_alias(thing[:address]) || ''
348
341
  aname = true unless email.empty?
349
342
  end
350
343
 
@@ -385,15 +378,6 @@ module Sisimai
385
378
  return false
386
379
  end
387
380
 
388
- # Check the "address" is an undisclosed address or not
389
- # @param [None]
390
- # @return [Boolean] true: Undisclosed address
391
- # false: Is not undisclosed address
392
- def is_undisclosed
393
- return true if self.host == @@undisclosed
394
- return false
395
- end
396
-
397
381
  # Returns the value of address as String
398
382
  # @return [String] Email address
399
383
  def to_json(*)