sisimai 4.16.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.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.rubocop.yml +182 -0
- data/.travis.yml +18 -0
- data/ANALYTICAL-PRECISION +56 -0
- data/Changes +36 -0
- data/Developers.mk +129 -0
- data/Gemfile +15 -0
- data/LICENSE +25 -0
- data/Makefile +70 -0
- data/README.md +361 -0
- data/Rakefile +12 -0
- data/Repository.mk +69 -0
- data/appveyor.yml +23 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/sisimai.rb +95 -0
- data/lib/sisimai/address.rb +224 -0
- data/lib/sisimai/arf.rb +338 -0
- data/lib/sisimai/data.rb +409 -0
- data/lib/sisimai/data/json.rb +40 -0
- data/lib/sisimai/data/yaml.rb +32 -0
- data/lib/sisimai/datetime.rb +511 -0
- data/lib/sisimai/mail.rb +82 -0
- data/lib/sisimai/mail/maildir.rb +82 -0
- data/lib/sisimai/mail/mbox.rb +69 -0
- data/lib/sisimai/mail/stdin.rb +53 -0
- data/lib/sisimai/mda.rb +152 -0
- data/lib/sisimai/message.rb +525 -0
- data/lib/sisimai/mime.rb +127 -0
- data/lib/sisimai/msp.rb +54 -0
- data/lib/sisimai/msp/de/einsundeins.rb +174 -0
- data/lib/sisimai/msp/de/gmx.rb +197 -0
- data/lib/sisimai/msp/jp/biglobe.rb +179 -0
- data/lib/sisimai/msp/jp/ezweb.rb +292 -0
- data/lib/sisimai/msp/jp/kddi.rb +195 -0
- data/lib/sisimai/msp/ru/mailru.rb +306 -0
- data/lib/sisimai/msp/ru/yandex.rb +241 -0
- data/lib/sisimai/msp/uk/messagelabs.rb +250 -0
- data/lib/sisimai/msp/us/amazonses.rb +248 -0
- data/lib/sisimai/msp/us/amazonworkmail.rb +224 -0
- data/lib/sisimai/msp/us/aol.rb +234 -0
- data/lib/sisimai/msp/us/bigfoot.rb +243 -0
- data/lib/sisimai/msp/us/facebook.rb +306 -0
- data/lib/sisimai/msp/us/google.rb +357 -0
- data/lib/sisimai/msp/us/office365.rb +273 -0
- data/lib/sisimai/msp/us/outlook.rb +242 -0
- data/lib/sisimai/msp/us/receivingses.rb +247 -0
- data/lib/sisimai/msp/us/sendgrid.rb +257 -0
- data/lib/sisimai/msp/us/verizon.rb +311 -0
- data/lib/sisimai/msp/us/yahoo.rb +178 -0
- data/lib/sisimai/msp/us/zoho.rb +198 -0
- data/lib/sisimai/mta.rb +54 -0
- data/lib/sisimai/mta/activehunter.rb +155 -0
- data/lib/sisimai/mta/apachejames.rb +194 -0
- data/lib/sisimai/mta/courier.rb +307 -0
- data/lib/sisimai/mta/domino.rb +209 -0
- data/lib/sisimai/mta/exchange.rb +314 -0
- data/lib/sisimai/mta/exim.rb +549 -0
- data/lib/sisimai/mta/imailserver.rb +227 -0
- data/lib/sisimai/mta/interscanmss.rb +167 -0
- data/lib/sisimai/mta/mailfoundry.rb +173 -0
- data/lib/sisimai/mta/mailmarshalsmtp.rb +206 -0
- data/lib/sisimai/mta/mcafee.rb +201 -0
- data/lib/sisimai/mta/messagingserver.rb +241 -0
- data/lib/sisimai/mta/mfilter.rb +190 -0
- data/lib/sisimai/mta/mxlogic.rb +283 -0
- data/lib/sisimai/mta/notes.rb +206 -0
- data/lib/sisimai/mta/opensmtpd.rb +225 -0
- data/lib/sisimai/mta/postfix.rb +306 -0
- data/lib/sisimai/mta/qmail.rb +335 -0
- data/lib/sisimai/mta/sendmail.rb +317 -0
- data/lib/sisimai/mta/surfcontrol.rb +193 -0
- data/lib/sisimai/mta/userdefined.rb +148 -0
- data/lib/sisimai/mta/v5sendmail.rb +232 -0
- data/lib/sisimai/mta/x1.rb +156 -0
- data/lib/sisimai/mta/x2.rb +157 -0
- data/lib/sisimai/mta/x3.rb +171 -0
- data/lib/sisimai/mta/x4.rb +365 -0
- data/lib/sisimai/mta/x5.rb +208 -0
- data/lib/sisimai/order.rb +220 -0
- data/lib/sisimai/reason.rb +234 -0
- data/lib/sisimai/reason/blocked.rb +105 -0
- data/lib/sisimai/reason/contenterror.rb +53 -0
- data/lib/sisimai/reason/exceedlimit.rb +60 -0
- data/lib/sisimai/reason/expired.rb +53 -0
- data/lib/sisimai/reason/filtered.rb +98 -0
- data/lib/sisimai/reason/hasmoved.rb +45 -0
- data/lib/sisimai/reason/hostunknown.rb +79 -0
- data/lib/sisimai/reason/mailboxfull.rb +118 -0
- data/lib/sisimai/reason/mailererror.rb +55 -0
- data/lib/sisimai/reason/mesgtoobig.rb +82 -0
- data/lib/sisimai/reason/networkerror.rb +58 -0
- data/lib/sisimai/reason/norelaying.rb +71 -0
- data/lib/sisimai/reason/notaccept.rb +63 -0
- data/lib/sisimai/reason/onhold.rb +45 -0
- data/lib/sisimai/reason/rejected.rb +101 -0
- data/lib/sisimai/reason/securityerror.rb +72 -0
- data/lib/sisimai/reason/spamdetected.rb +172 -0
- data/lib/sisimai/reason/suspend.rb +58 -0
- data/lib/sisimai/reason/systemerror.rb +69 -0
- data/lib/sisimai/reason/systemfull.rb +45 -0
- data/lib/sisimai/reason/toomanyconn.rb +73 -0
- data/lib/sisimai/reason/userunknown.rb +194 -0
- data/lib/sisimai/rfc2606.rb +24 -0
- data/lib/sisimai/rfc3464.rb +497 -0
- data/lib/sisimai/rfc3834.rb +150 -0
- data/lib/sisimai/rfc5322.rb +204 -0
- data/lib/sisimai/rhost.rb +47 -0
- data/lib/sisimai/rhost/googleapps.rb +237 -0
- data/lib/sisimai/smtp.rb +58 -0
- data/lib/sisimai/smtp/reply.rb +84 -0
- data/lib/sisimai/smtp/status.rb +758 -0
- data/lib/sisimai/string.rb +65 -0
- data/lib/sisimai/time.rb +11 -0
- data/lib/sisimai/version.rb +4 -0
- data/set-of-emails/README.md +35 -0
- data/set-of-emails/mailbox/mbox-0 +2467 -0
- data/set-of-emails/mailbox/mbox-1 +71 -0
- data/set-of-emails/maildir/bsd/README.md +261 -0
- data/set-of-emails/maildir/bsd/activehunter-01.eml +54 -0
- data/set-of-emails/maildir/bsd/activehunter-02.eml +53 -0
- data/set-of-emails/maildir/bsd/apachejames-01.eml +46 -0
- data/set-of-emails/maildir/bsd/arf-01.eml +66 -0
- data/set-of-emails/maildir/bsd/arf-02.eml +68 -0
- data/set-of-emails/maildir/bsd/arf-03.eml +56 -0
- data/set-of-emails/maildir/bsd/arf-04.eml +89 -0
- data/set-of-emails/maildir/bsd/arf-05.eml +82 -0
- data/set-of-emails/maildir/bsd/arf-06.eml +166 -0
- data/set-of-emails/maildir/bsd/arf-07.eml +59 -0
- data/set-of-emails/maildir/bsd/arf-08.eml +103 -0
- data/set-of-emails/maildir/bsd/arf-09.eml +104 -0
- data/set-of-emails/maildir/bsd/arf-10.eml +56 -0
- data/set-of-emails/maildir/bsd/arf-11.eml +37 -0
- data/set-of-emails/maildir/bsd/arf-12.eml +40 -0
- data/set-of-emails/maildir/bsd/arf-13.eml +76 -0
- data/set-of-emails/maildir/bsd/arf-14.eml +333 -0
- data/set-of-emails/maildir/bsd/arf-15.eml +66 -0
- data/set-of-emails/maildir/bsd/courier-01.eml +79 -0
- data/set-of-emails/maildir/bsd/courier-02.eml +83 -0
- data/set-of-emails/maildir/bsd/courier-03.eml +85 -0
- data/set-of-emails/maildir/bsd/courier-04.eml +87 -0
- data/set-of-emails/maildir/bsd/de-einsundeins-01.eml +38 -0
- data/set-of-emails/maildir/bsd/de-gmx-01.eml +52 -0
- data/set-of-emails/maildir/bsd/de-gmx-02.eml +51 -0
- data/set-of-emails/maildir/bsd/de-gmx-03.eml +56 -0
- data/set-of-emails/maildir/bsd/de-gmx-04.eml +51 -0
- data/set-of-emails/maildir/bsd/domino-01.eml +33 -0
- data/set-of-emails/maildir/bsd/domino-02.eml +83 -0
- data/set-of-emails/maildir/bsd/exchange-01.eml +31 -0
- data/set-of-emails/maildir/bsd/exchange-02.eml +67 -0
- data/set-of-emails/maildir/bsd/exchange-03.eml +52 -0
- data/set-of-emails/maildir/bsd/exchange-04.eml +28 -0
- data/set-of-emails/maildir/bsd/exchange-05.eml +56 -0
- data/set-of-emails/maildir/bsd/exchange-06.eml +151 -0
- data/set-of-emails/maildir/bsd/exim-01.eml +46 -0
- data/set-of-emails/maildir/bsd/exim-02.eml +41 -0
- data/set-of-emails/maildir/bsd/exim-03.eml +42 -0
- data/set-of-emails/maildir/bsd/exim-04.eml +46 -0
- data/set-of-emails/maildir/bsd/exim-05.eml +49 -0
- data/set-of-emails/maildir/bsd/exim-06.eml +44 -0
- data/set-of-emails/maildir/bsd/exim-07.eml +28 -0
- data/set-of-emails/maildir/bsd/exim-08.eml +42 -0
- data/set-of-emails/maildir/bsd/exim-09.eml +169 -0
- data/set-of-emails/maildir/bsd/exim-10.eml +718 -0
- data/set-of-emails/maildir/bsd/exim-11.eml +718 -0
- data/set-of-emails/maildir/bsd/exim-12.eml +75 -0
- data/set-of-emails/maildir/bsd/exim-13.eml +145 -0
- data/set-of-emails/maildir/bsd/exim-14.eml +32 -0
- data/set-of-emails/maildir/bsd/exim-15.eml +49 -0
- data/set-of-emails/maildir/bsd/exim-16.eml +98 -0
- data/set-of-emails/maildir/bsd/exim-17.eml +50 -0
- data/set-of-emails/maildir/bsd/exim-18.eml +96 -0
- data/set-of-emails/maildir/bsd/exim-19.eml +52 -0
- data/set-of-emails/maildir/bsd/exim-20.eml +159 -0
- data/set-of-emails/maildir/bsd/exim-21.eml +150 -0
- data/set-of-emails/maildir/bsd/exim-22.eml +50 -0
- data/set-of-emails/maildir/bsd/exim-23.eml +57 -0
- data/set-of-emails/maildir/bsd/exim-24.eml +107 -0
- data/set-of-emails/maildir/bsd/exim-25.eml +18 -0
- data/set-of-emails/maildir/bsd/exim-26.eml +111 -0
- data/set-of-emails/maildir/bsd/exim-27.eml +120 -0
- data/set-of-emails/maildir/bsd/exim-28.eml +148 -0
- data/set-of-emails/maildir/bsd/google-apps-01.eml +66 -0
- data/set-of-emails/maildir/bsd/imailserver-01.eml +27 -0
- data/set-of-emails/maildir/bsd/imailserver-02.eml +36 -0
- data/set-of-emails/maildir/bsd/imailserver-03.eml +28 -0
- data/set-of-emails/maildir/bsd/imailserver-04.eml +15 -0
- data/set-of-emails/maildir/bsd/imailserver-05.eml +92 -0
- data/set-of-emails/maildir/bsd/imailserver-06.eml +29 -0
- data/set-of-emails/maildir/bsd/interscanmss-01.eml +49 -0
- data/set-of-emails/maildir/bsd/interscanmss-02.eml +259 -0
- data/set-of-emails/maildir/bsd/jp-biglobe-01.eml +43 -0
- data/set-of-emails/maildir/bsd/jp-ezweb-01.eml +36 -0
- data/set-of-emails/maildir/bsd/jp-ezweb-02.eml +65 -0
- data/set-of-emails/maildir/bsd/jp-ezweb-03.eml +35 -0
- data/set-of-emails/maildir/bsd/jp-ezweb-04.eml +38 -0
- data/set-of-emails/maildir/bsd/jp-ezweb-05.eml +38 -0
- data/set-of-emails/maildir/bsd/jp-ezweb-06.eml +33 -0
- data/set-of-emails/maildir/bsd/jp-kddi-01.eml +49 -0
- data/set-of-emails/maildir/bsd/jp-kddi-02.eml +54 -0
- data/set-of-emails/maildir/bsd/jp-kddi-03.eml +54 -0
- data/set-of-emails/maildir/bsd/mailfoundry-01.eml +50 -0
- data/set-of-emails/maildir/bsd/mailfoundry-02.eml +49 -0
- data/set-of-emails/maildir/bsd/mailmarshalsmtp-01.eml +43 -0
- data/set-of-emails/maildir/bsd/mcafee-01.eml +63 -0
- data/set-of-emails/maildir/bsd/mcafee-02.eml +65 -0
- data/set-of-emails/maildir/bsd/mcafee-03.eml +59 -0
- data/set-of-emails/maildir/bsd/messagingserver-01.eml +102 -0
- data/set-of-emails/maildir/bsd/messagingserver-02.eml +72 -0
- data/set-of-emails/maildir/bsd/messagingserver-03.eml +70 -0
- data/set-of-emails/maildir/bsd/messagingserver-04.eml +102 -0
- data/set-of-emails/maildir/bsd/messagingserver-05.eml +98 -0
- data/set-of-emails/maildir/bsd/messagingserver-06.eml +101 -0
- data/set-of-emails/maildir/bsd/messagingserver-07.eml +129 -0
- data/set-of-emails/maildir/bsd/mfilter-01.eml +49 -0
- data/set-of-emails/maildir/bsd/mfilter-02.eml +48 -0
- data/set-of-emails/maildir/bsd/mfilter-03.eml +43 -0
- data/set-of-emails/maildir/bsd/mxlogic-01.eml +47 -0
- data/set-of-emails/maildir/bsd/mxlogic-02.eml +44 -0
- data/set-of-emails/maildir/bsd/mxlogic-03.eml +46 -0
- data/set-of-emails/maildir/bsd/notes-01.eml +42 -0
- data/set-of-emails/maildir/bsd/notes-02.eml +42 -0
- data/set-of-emails/maildir/bsd/notes-03.eml +38 -0
- data/set-of-emails/maildir/bsd/notes-04.eml +181 -0
- data/set-of-emails/maildir/bsd/opensmtpd-01.eml +33 -0
- data/set-of-emails/maildir/bsd/opensmtpd-02.eml +33 -0
- data/set-of-emails/maildir/bsd/opensmtpd-03.eml +36 -0
- data/set-of-emails/maildir/bsd/opensmtpd-04.eml +40 -0
- data/set-of-emails/maildir/bsd/opensmtpd-05.eml +36 -0
- data/set-of-emails/maildir/bsd/postfix-01.eml +60 -0
- data/set-of-emails/maildir/bsd/postfix-02.eml +78 -0
- data/set-of-emails/maildir/bsd/postfix-03.eml +71 -0
- data/set-of-emails/maildir/bsd/postfix-04.eml +89 -0
- data/set-of-emails/maildir/bsd/postfix-05.eml +78 -0
- data/set-of-emails/maildir/bsd/postfix-06.eml +72 -0
- data/set-of-emails/maildir/bsd/postfix-07.eml +74 -0
- data/set-of-emails/maildir/bsd/postfix-08.eml +78 -0
- data/set-of-emails/maildir/bsd/postfix-09.eml +76 -0
- data/set-of-emails/maildir/bsd/postfix-10.eml +73 -0
- data/set-of-emails/maildir/bsd/postfix-11.eml +86 -0
- data/set-of-emails/maildir/bsd/postfix-12.eml +71 -0
- data/set-of-emails/maildir/bsd/postfix-13.eml +81 -0
- data/set-of-emails/maildir/bsd/postfix-14.eml +68 -0
- data/set-of-emails/maildir/bsd/postfix-15.eml +69 -0
- data/set-of-emails/maildir/bsd/postfix-16.eml +73 -0
- data/set-of-emails/maildir/bsd/postfix-17.eml +68 -0
- data/set-of-emails/maildir/bsd/postfix-18.eml +121 -0
- data/set-of-emails/maildir/bsd/postfix-19.eml +105 -0
- data/set-of-emails/maildir/bsd/postfix-20.eml +231 -0
- data/set-of-emails/maildir/bsd/postfix-21.eml +60 -0
- data/set-of-emails/maildir/bsd/qmail-01.eml +40 -0
- data/set-of-emails/maildir/bsd/qmail-02.eml +35 -0
- data/set-of-emails/maildir/bsd/qmail-03.eml +22 -0
- data/set-of-emails/maildir/bsd/qmail-04.eml +31 -0
- data/set-of-emails/maildir/bsd/qmail-05.eml +31 -0
- data/set-of-emails/maildir/bsd/qmail-06.eml +39 -0
- data/set-of-emails/maildir/bsd/qmail-07.eml +22 -0
- data/set-of-emails/maildir/bsd/qmail-08.eml +23 -0
- data/set-of-emails/maildir/bsd/qmail-09.eml +103 -0
- data/set-of-emails/maildir/bsd/rfc3464-01.eml +60 -0
- data/set-of-emails/maildir/bsd/rfc3464-02.eml +43 -0
- data/set-of-emails/maildir/bsd/rfc3464-03.eml +40 -0
- data/set-of-emails/maildir/bsd/rfc3464-04.eml +50 -0
- data/set-of-emails/maildir/bsd/rfc3464-05.eml +63 -0
- data/set-of-emails/maildir/bsd/rfc3464-06.eml +48 -0
- data/set-of-emails/maildir/bsd/rfc3464-07.eml +88 -0
- data/set-of-emails/maildir/bsd/rfc3464-08.eml +70 -0
- data/set-of-emails/maildir/bsd/rfc3464-09.eml +93 -0
- data/set-of-emails/maildir/bsd/rfc3464-10.eml +467 -0
- data/set-of-emails/maildir/bsd/rfc3464-11.eml +1171 -0
- data/set-of-emails/maildir/bsd/rfc3464-12.eml +101 -0
- data/set-of-emails/maildir/bsd/rfc3464-13.eml +131 -0
- data/set-of-emails/maildir/bsd/rfc3464-14.eml +121 -0
- data/set-of-emails/maildir/bsd/rfc3464-15.eml +144 -0
- data/set-of-emails/maildir/bsd/rfc3464-16.eml +36 -0
- data/set-of-emails/maildir/bsd/rfc3464-17.eml +109 -0
- data/set-of-emails/maildir/bsd/rfc3464-18.eml +149 -0
- data/set-of-emails/maildir/bsd/rfc3464-19.eml +65 -0
- data/set-of-emails/maildir/bsd/rfc3464-20.eml +145 -0
- data/set-of-emails/maildir/bsd/rfc3464-21.eml +146 -0
- data/set-of-emails/maildir/bsd/rfc3464-22.eml +105 -0
- data/set-of-emails/maildir/bsd/rfc3464-23.eml +21 -0
- data/set-of-emails/maildir/bsd/rfc3464-24.eml +27 -0
- data/set-of-emails/maildir/bsd/rfc3464-25.eml +33 -0
- data/set-of-emails/maildir/bsd/rfc3464-26.eml +98 -0
- data/set-of-emails/maildir/bsd/rfc3464-27.eml +180 -0
- data/set-of-emails/maildir/bsd/rfc3464-28.eml +122 -0
- data/set-of-emails/maildir/bsd/rfc3834-01.eml +37 -0
- data/set-of-emails/maildir/bsd/rfc3834-02.eml +51 -0
- data/set-of-emails/maildir/bsd/rfc3834-03.eml +33 -0
- data/set-of-emails/maildir/bsd/ru-mailru-01.eml +54 -0
- data/set-of-emails/maildir/bsd/ru-mailru-02.eml +54 -0
- data/set-of-emails/maildir/bsd/ru-mailru-03.eml +62 -0
- data/set-of-emails/maildir/bsd/ru-mailru-04.eml +54 -0
- data/set-of-emails/maildir/bsd/ru-yandex-01.eml +102 -0
- data/set-of-emails/maildir/bsd/ru-yandex-02.eml +113 -0
- data/set-of-emails/maildir/bsd/ru-yandex-03.eml +101 -0
- data/set-of-emails/maildir/bsd/sendmail-01.eml +70 -0
- data/set-of-emails/maildir/bsd/sendmail-02.eml +82 -0
- data/set-of-emails/maildir/bsd/sendmail-03.eml +76 -0
- data/set-of-emails/maildir/bsd/sendmail-04.eml +63 -0
- data/set-of-emails/maildir/bsd/sendmail-05.eml +64 -0
- data/set-of-emails/maildir/bsd/sendmail-06.eml +67 -0
- data/set-of-emails/maildir/bsd/sendmail-07.eml +65 -0
- data/set-of-emails/maildir/bsd/sendmail-08.eml +62 -0
- data/set-of-emails/maildir/bsd/sendmail-09.eml +60 -0
- data/set-of-emails/maildir/bsd/sendmail-10.eml +82 -0
- data/set-of-emails/maildir/bsd/sendmail-11.eml +60 -0
- data/set-of-emails/maildir/bsd/sendmail-12.eml +62 -0
- data/set-of-emails/maildir/bsd/sendmail-13.eml +66 -0
- data/set-of-emails/maildir/bsd/sendmail-14.eml +64 -0
- data/set-of-emails/maildir/bsd/sendmail-15.eml +60 -0
- data/set-of-emails/maildir/bsd/sendmail-16.eml +69 -0
- data/set-of-emails/maildir/bsd/sendmail-17.eml +68 -0
- data/set-of-emails/maildir/bsd/sendmail-18.eml +64 -0
- data/set-of-emails/maildir/bsd/sendmail-19.eml +71 -0
- data/set-of-emails/maildir/bsd/sendmail-20.eml +120 -0
- data/set-of-emails/maildir/bsd/sendmail-21.eml +69 -0
- data/set-of-emails/maildir/bsd/sendmail-22.eml +73 -0
- data/set-of-emails/maildir/bsd/sendmail-23.eml +137 -0
- data/set-of-emails/maildir/bsd/sendmail-24.eml +66 -0
- data/set-of-emails/maildir/bsd/sendmail-25.eml +70 -0
- data/set-of-emails/maildir/bsd/sendmail-26.eml +71 -0
- data/set-of-emails/maildir/bsd/sendmail-27.eml +69 -0
- data/set-of-emails/maildir/bsd/sendmail-28.eml +69 -0
- data/set-of-emails/maildir/bsd/sendmail-29.eml +70 -0
- data/set-of-emails/maildir/bsd/sendmail-30.eml +68 -0
- data/set-of-emails/maildir/bsd/sendmail-31.eml +80 -0
- data/set-of-emails/maildir/bsd/sendmail-32.eml +71 -0
- data/set-of-emails/maildir/bsd/sendmail-33.eml +71 -0
- data/set-of-emails/maildir/bsd/sendmail-34.eml +75 -0
- data/set-of-emails/maildir/bsd/sendmail-35.eml +70 -0
- data/set-of-emails/maildir/bsd/sendmail-36.eml +71 -0
- data/set-of-emails/maildir/bsd/sendmail-37.eml +71 -0
- data/set-of-emails/maildir/bsd/sendmail-38.eml +167 -0
- data/set-of-emails/maildir/bsd/surfcontrol-01.eml +79 -0
- data/set-of-emails/maildir/bsd/surfcontrol-02.eml +70 -0
- data/set-of-emails/maildir/bsd/surfcontrol-03.eml +70 -0
- data/set-of-emails/maildir/bsd/uk-messagelabs-01.eml +76 -0
- data/set-of-emails/maildir/bsd/us-amazonses-01.eml +59 -0
- data/set-of-emails/maildir/bsd/us-amazonses-02.eml +177 -0
- data/set-of-emails/maildir/bsd/us-amazonses-03.eml +55 -0
- data/set-of-emails/maildir/bsd/us-amazonses-04.eml +55 -0
- data/set-of-emails/maildir/bsd/us-amazonworkmail-01.eml +156 -0
- data/set-of-emails/maildir/bsd/us-amazonworkmail-02.eml +160 -0
- data/set-of-emails/maildir/bsd/us-amazonworkmail-03.eml +161 -0
- data/set-of-emails/maildir/bsd/us-amazonworkmail-04.eml +156 -0
- data/set-of-emails/maildir/bsd/us-amazonworkmail-05.eml +157 -0
- data/set-of-emails/maildir/bsd/us-aol-01.eml +1258 -0
- data/set-of-emails/maildir/bsd/us-aol-02.eml +1257 -0
- data/set-of-emails/maildir/bsd/us-aol-03.eml +1264 -0
- data/set-of-emails/maildir/bsd/us-aol-04.eml +1260 -0
- data/set-of-emails/maildir/bsd/us-bigfoot-01.eml +64 -0
- data/set-of-emails/maildir/bsd/us-facebook-01.eml +40 -0
- data/set-of-emails/maildir/bsd/us-facebook-02.eml +42 -0
- data/set-of-emails/maildir/bsd/us-google-01.eml +70 -0
- data/set-of-emails/maildir/bsd/us-google-02.eml +50 -0
- data/set-of-emails/maildir/bsd/us-google-03.eml +51 -0
- data/set-of-emails/maildir/bsd/us-google-04.eml +82 -0
- data/set-of-emails/maildir/bsd/us-google-05.eml +50 -0
- data/set-of-emails/maildir/bsd/us-google-06.eml +56 -0
- data/set-of-emails/maildir/bsd/us-google-07.eml +42 -0
- data/set-of-emails/maildir/bsd/us-google-08.eml +59 -0
- data/set-of-emails/maildir/bsd/us-google-09.eml +76 -0
- data/set-of-emails/maildir/bsd/us-google-10.eml +69 -0
- data/set-of-emails/maildir/bsd/us-google-11.eml +68 -0
- data/set-of-emails/maildir/bsd/us-google-12.eml +76 -0
- data/set-of-emails/maildir/bsd/us-google-13.eml +79 -0
- data/set-of-emails/maildir/bsd/us-google-14.eml +304 -0
- data/set-of-emails/maildir/bsd/us-office365-01.eml +102 -0
- data/set-of-emails/maildir/bsd/us-outlook-01.eml +72 -0
- data/set-of-emails/maildir/bsd/us-outlook-02.eml +72 -0
- data/set-of-emails/maildir/bsd/us-outlook-03.eml +72 -0
- data/set-of-emails/maildir/bsd/us-outlook-04.eml +79 -0
- data/set-of-emails/maildir/bsd/us-outlook-05.eml +85 -0
- data/set-of-emails/maildir/bsd/us-outlook-06.eml +75 -0
- data/set-of-emails/maildir/bsd/us-outlook-07.eml +70 -0
- data/set-of-emails/maildir/bsd/us-receivingses-01.eml +74 -0
- data/set-of-emails/maildir/bsd/us-receivingses-02.eml +74 -0
- data/set-of-emails/maildir/bsd/us-receivingses-03.eml +74 -0
- data/set-of-emails/maildir/bsd/us-receivingses-04.eml +74 -0
- data/set-of-emails/maildir/bsd/us-receivingses-05.eml +74 -0
- data/set-of-emails/maildir/bsd/us-receivingses-06.eml +74 -0
- data/set-of-emails/maildir/bsd/us-receivingses-07.eml +74 -0
- data/set-of-emails/maildir/bsd/us-sendgrid-01.eml +95 -0
- data/set-of-emails/maildir/bsd/us-sendgrid-02.eml +98 -0
- data/set-of-emails/maildir/bsd/us-sendgrid-03.eml +100 -0
- data/set-of-emails/maildir/bsd/us-verizon-01.eml +31 -0
- data/set-of-emails/maildir/bsd/us-yahoo-01.eml +78 -0
- data/set-of-emails/maildir/bsd/us-yahoo-02.eml +79 -0
- data/set-of-emails/maildir/bsd/us-yahoo-03.eml +93 -0
- data/set-of-emails/maildir/bsd/us-yahoo-04.eml +94 -0
- data/set-of-emails/maildir/bsd/us-yahoo-05.eml +94 -0
- data/set-of-emails/maildir/bsd/us-zoho-01.eml +40 -0
- data/set-of-emails/maildir/bsd/us-zoho-02.eml +38 -0
- data/set-of-emails/maildir/bsd/us-zoho-03.eml +37 -0
- data/set-of-emails/maildir/bsd/us-zoho-04.eml +47 -0
- data/set-of-emails/maildir/bsd/us-zoho-05.eml +37 -0
- data/set-of-emails/maildir/bsd/v5sendmail-01.eml +24 -0
- data/set-of-emails/maildir/bsd/v5sendmail-02.eml +26 -0
- data/set-of-emails/maildir/bsd/v5sendmail-03.eml +29 -0
- data/set-of-emails/maildir/bsd/v5sendmail-04.eml +29 -0
- data/set-of-emails/maildir/bsd/v5sendmail-05.eml +42 -0
- data/set-of-emails/maildir/bsd/v5sendmail-06.eml +28 -0
- data/set-of-emails/maildir/bsd/v5sendmail-07.eml +35 -0
- data/set-of-emails/maildir/bsd/x1-01.eml +61 -0
- data/set-of-emails/maildir/bsd/x1-02.eml +62 -0
- data/set-of-emails/maildir/bsd/x2-01.eml +41 -0
- data/set-of-emails/maildir/bsd/x2-02.eml +46 -0
- data/set-of-emails/maildir/bsd/x2-03.eml +34 -0
- data/set-of-emails/maildir/bsd/x2-04.eml +0 -0
- data/set-of-emails/maildir/bsd/x2-05.eml +98 -0
- data/set-of-emails/maildir/bsd/x3-01.eml +61 -0
- data/set-of-emails/maildir/bsd/x3-02.eml +64 -0
- data/set-of-emails/maildir/bsd/x3-03.eml +59 -0
- data/set-of-emails/maildir/bsd/x3-04.eml +106 -0
- data/set-of-emails/maildir/bsd/x4-01.eml +92 -0
- data/set-of-emails/maildir/bsd/x4-02.eml +112 -0
- data/set-of-emails/maildir/bsd/x4-03.eml +245 -0
- data/set-of-emails/maildir/bsd/x4-04.eml +81 -0
- data/set-of-emails/maildir/bsd/x4-05.eml +121 -0
- data/set-of-emails/maildir/bsd/x4-06.eml +32 -0
- data/set-of-emails/maildir/bsd/x4-07.eml +153 -0
- data/set-of-emails/maildir/bsd/x5-01.eml +155 -0
- data/set-of-emails/maildir/dos/activehunter-01.eml +54 -0
- data/set-of-emails/maildir/dos/apachejames-01.eml +46 -0
- data/set-of-emails/maildir/dos/arf-01.eml +66 -0
- data/set-of-emails/maildir/dos/courier-01.eml +79 -0
- data/set-of-emails/maildir/dos/de-einsundeins-01.eml +38 -0
- data/set-of-emails/maildir/dos/de-gmx-01.eml +52 -0
- data/set-of-emails/maildir/dos/domino-01.eml +33 -0
- data/set-of-emails/maildir/dos/exchange-01.eml +31 -0
- data/set-of-emails/maildir/dos/exim-01.eml +46 -0
- data/set-of-emails/maildir/dos/google-apps-01.eml +66 -0
- data/set-of-emails/maildir/dos/imailserver-01.eml +27 -0
- data/set-of-emails/maildir/dos/interscanmss-01.eml +49 -0
- data/set-of-emails/maildir/dos/jp-biglobe-01.eml +43 -0
- data/set-of-emails/maildir/dos/jp-ezweb-01.eml +36 -0
- data/set-of-emails/maildir/dos/jp-kddi-01.eml +49 -0
- data/set-of-emails/maildir/dos/mailfoundry-01.eml +50 -0
- data/set-of-emails/maildir/dos/mailmarshalsmtp-01.eml +43 -0
- data/set-of-emails/maildir/dos/mcafee-01.eml +63 -0
- data/set-of-emails/maildir/dos/messagingserver-01.eml +102 -0
- data/set-of-emails/maildir/dos/mfilter-01.eml +49 -0
- data/set-of-emails/maildir/dos/mxlogic-01.eml +47 -0
- data/set-of-emails/maildir/dos/notes-01.eml +42 -0
- data/set-of-emails/maildir/dos/opensmtpd-01.eml +33 -0
- data/set-of-emails/maildir/dos/postfix-01.eml +60 -0
- data/set-of-emails/maildir/dos/qmail-01.eml +40 -0
- data/set-of-emails/maildir/dos/rfc3464-01.eml +59 -0
- data/set-of-emails/maildir/dos/rfc3834-01.eml +37 -0
- data/set-of-emails/maildir/dos/ru-mailru-01.eml +54 -0
- data/set-of-emails/maildir/dos/ru-yandex-01.eml +102 -0
- data/set-of-emails/maildir/dos/sendmail-01.eml +69 -0
- data/set-of-emails/maildir/dos/surfcontrol-01.eml +79 -0
- data/set-of-emails/maildir/dos/uk-messagelabs-01.eml +76 -0
- data/set-of-emails/maildir/dos/us-amazonses-01.eml +59 -0
- data/set-of-emails/maildir/dos/us-aol-01.eml +1258 -0
- data/set-of-emails/maildir/dos/us-bigfoot-01.eml +64 -0
- data/set-of-emails/maildir/dos/us-facebook-01.eml +40 -0
- data/set-of-emails/maildir/dos/us-google-01.eml +70 -0
- data/set-of-emails/maildir/dos/us-outlook-01.eml +72 -0
- data/set-of-emails/maildir/dos/us-receivingses-01.eml +74 -0
- data/set-of-emails/maildir/dos/us-sendgrid-01.eml +95 -0
- data/set-of-emails/maildir/dos/us-verizon-01.eml +31 -0
- data/set-of-emails/maildir/dos/us-yahoo-01.eml +78 -0
- data/set-of-emails/maildir/dos/us-zoho-01.eml +40 -0
- data/set-of-emails/maildir/dos/v5sendmail-01.eml +24 -0
- data/set-of-emails/maildir/dos/x1-01.eml +61 -0
- data/set-of-emails/maildir/dos/x2-01.eml +41 -0
- data/set-of-emails/maildir/dos/x3-01.eml +61 -0
- data/set-of-emails/maildir/dos/x4-01.eml +90 -0
- data/set-of-emails/maildir/dos/x5-01.eml +155 -0
- data/set-of-emails/maildir/err/make-test-01.eml +70 -0
- data/set-of-emails/maildir/err/make-test-02.eml +70 -0
- data/set-of-emails/maildir/err/make-test-03.eml +64 -0
- data/set-of-emails/maildir/err/make-test-04.eml +64 -0
- data/set-of-emails/maildir/err/make-test-05.eml +66 -0
- data/set-of-emails/maildir/err/make-test-06.eml +118 -0
- data/set-of-emails/maildir/err/make-test-07.eml +26 -0
- data/set-of-emails/maildir/err/make-test-08.eml +67 -0
- data/set-of-emails/maildir/err/make-test-09.eml +55 -0
- data/set-of-emails/maildir/err/make-test-10.eml +69 -0
- data/set-of-emails/maildir/err/make-test-11.eml +64 -0
- data/set-of-emails/maildir/err/make-test-12.eml +66 -0
- data/set-of-emails/maildir/err/make-test-13.eml +67 -0
- data/set-of-emails/maildir/err/make-test-14.eml +66 -0
- data/set-of-emails/maildir/err/make-test-15.eml +70 -0
- data/set-of-emails/maildir/err/make-test-16.eml +68 -0
- data/set-of-emails/maildir/err/make-test-17.eml +68 -0
- data/set-of-emails/maildir/err/make-test-18.eml +68 -0
- data/set-of-emails/maildir/err/make-test-19.eml +69 -0
- data/set-of-emails/maildir/err/make-test-20.eml +67 -0
- data/set-of-emails/maildir/err/make-test-21.eml +69 -0
- data/set-of-emails/maildir/err/make-test-22.eml +66 -0
- data/set-of-emails/maildir/err/make-test-23.eml +70 -0
- data/set-of-emails/maildir/err/make-test-24.eml +69 -0
- data/set-of-emails/maildir/err/make-test-25.eml +67 -0
- data/set-of-emails/maildir/err/make-test-26.eml +69 -0
- data/set-of-emails/maildir/err/make-test-27.eml +69 -0
- data/set-of-emails/maildir/err/make-test-28.eml +66 -0
- data/set-of-emails/maildir/err/make-test-29.eml +68 -0
- data/set-of-emails/maildir/err/make-test-30.eml +68 -0
- data/set-of-emails/maildir/err/make-test-31.eml +80 -0
- data/set-of-emails/maildir/err/make-test-32.eml +66 -0
- data/set-of-emails/maildir/err/make-test-33.eml +68 -0
- data/set-of-emails/maildir/err/make-test-34.eml +56 -0
- data/set-of-emails/maildir/err/make-test-35.eml +59 -0
- data/set-of-emails/maildir/err/make-test-36.eml +53 -0
- data/set-of-emails/maildir/err/make-test-37.eml +62 -0
- data/set-of-emails/maildir/mac/activehunter-01.eml +1 -2
- data/set-of-emails/maildir/mac/apachejames-01.eml +1 -4
- data/set-of-emails/maildir/mac/arf-01.eml +1 -3
- data/set-of-emails/maildir/mac/courier-01.eml +1 -6
- data/set-of-emails/maildir/mac/de-einsundeins-01.eml +1 -1
- data/set-of-emails/maildir/mac/de-gmx-01.eml +1 -1
- data/set-of-emails/maildir/mac/domino-01.eml +1 -0
- data/set-of-emails/maildir/mac/exchange-01.eml +1 -0
- data/set-of-emails/maildir/mac/exim-01.eml +1 -1
- data/set-of-emails/maildir/mac/google-apps-01.eml +1 -4
- data/set-of-emails/maildir/mac/imailserver-01.eml +1 -0
- data/set-of-emails/maildir/mac/interscanmss-01.eml +1 -2
- data/set-of-emails/maildir/mac/jp-biglobe-01.eml +1 -2
- data/set-of-emails/maildir/mac/jp-ezweb-01.eml +1 -1
- data/set-of-emails/maildir/mac/jp-kddi-01.eml +1 -2
- data/set-of-emails/maildir/mac/mailfoundry-01.eml +1 -2
- data/set-of-emails/maildir/mac/mailmarshalsmtp-01.eml +1 -2
- data/set-of-emails/maildir/mac/mcafee-01.eml +1 -4
- data/set-of-emails/maildir/mac/messagingserver-01.eml +1 -4
- data/set-of-emails/maildir/mac/mfilter-01.eml +1 -3
- data/set-of-emails/maildir/mac/mxlogic-01.eml +1 -1
- data/set-of-emails/maildir/mac/notes-01.eml +1 -2
- data/set-of-emails/maildir/mac/opensmtpd-01.eml +1 -0
- data/set-of-emails/maildir/mac/postfix-01.eml +1 -3
- data/set-of-emails/maildir/mac/qmail-01.eml +1 -1
- data/set-of-emails/maildir/mac/rfc3464-01.eml +1 -4
- data/set-of-emails/maildir/mac/rfc3834-01.eml +1 -0
- data/set-of-emails/maildir/mac/ru-mailru-01.eml +1 -1
- data/set-of-emails/maildir/mac/ru-yandex-01.eml +1 -4
- data/set-of-emails/maildir/mac/sendmail-01.eml +1 -4
- data/set-of-emails/maildir/mac/surfcontrol-01.eml +1 -5
- data/set-of-emails/maildir/mac/uk-messagelabs-01.eml +1 -4
- data/set-of-emails/maildir/mac/us-amazonses-01.eml +1 -4
- data/set-of-emails/maildir/mac/us-aol-01.eml +1 -15
- data/set-of-emails/maildir/mac/us-bigfoot-01.eml +1 -4
- data/set-of-emails/maildir/mac/us-facebook-01.eml +1 -4
- data/set-of-emails/maildir/mac/us-google-01.eml +1 -1
- data/set-of-emails/maildir/mac/us-outlook-01.eml +1 -4
- data/set-of-emails/maildir/mac/us-receivingses-01.eml +1 -4
- data/set-of-emails/maildir/mac/us-sendgrid-01.eml +1 -3
- data/set-of-emails/maildir/mac/us-verizon-01.eml +1 -2
- data/set-of-emails/maildir/mac/us-yahoo-01.eml +1 -1
- data/set-of-emails/maildir/mac/us-zoho-01.eml +1 -2
- data/set-of-emails/maildir/mac/v5sendmail-01.eml +1 -0
- data/set-of-emails/maildir/mac/x1-01.eml +1 -4
- data/set-of-emails/maildir/mac/x2-01.eml +1 -1
- data/set-of-emails/maildir/mac/x3-01.eml +1 -3
- data/set-of-emails/maildir/mac/x4-01.eml +1 -2
- data/set-of-emails/maildir/mac/x5-01.eml +1 -8
- data/set-of-emails/maildir/not/is-not-bounce-01.eml +25 -0
- data/set-of-emails/to-be-debugged-because/reason-is-onhold/onhold-0001.eml +85 -0
- data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0002.eml +27 -0
- data/set-of-emails/to-be-debugged-because/reason-is-undefined/undefined-0003.eml +78 -0
- data/set-of-emails/to-be-debugged-because/sisimai-cannot-parse-yet/cannot-parse-this-email-0002.eml +25 -0
- data/set-of-emails/to-be-debugged-because/something-is-wrong/issue-106-01.eml +79 -0
- data/set-of-emails/to-be-debugged-because/something-is-wrong/issue-106-02.eml +72 -0
- data/set-of-emails/to-be-debugged-because/something-is-wrong/issue-106-03.eml +68 -0
- data/set-of-emails/to-be-debugged-because/something-is-wrong/no-message-id-from-pr-150.eml +75 -0
- data/set-of-emails/to-be-parsed-for-test/README.md +20 -0
- data/sisimai-java.gemspec +29 -0
- data/sisimai.gemspec +28 -0
- metadata +680 -0
@@ -0,0 +1,190 @@
|
|
1
|
+
module Sisimai
|
2
|
+
module MTA
|
3
|
+
# Sisimai::MTA::mFILTER parses a bounce email which created by Digital Arts
|
4
|
+
# m-FILTER. Methods in the module are called from only Sisimai::Message.
|
5
|
+
module MFILTER
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/MTA/mFILTER.pm
|
7
|
+
class << self
|
8
|
+
require 'sisimai/mta'
|
9
|
+
require 'sisimai/rfc5322'
|
10
|
+
|
11
|
+
Re0 = {
|
12
|
+
:'from' => %r/\AMailer Daemon [<]MAILER-DAEMON[@]/,
|
13
|
+
:'subject' => %r/\Afailure notice\z/,
|
14
|
+
:'x-mailer' => %r/\Am-FILTER\z/,
|
15
|
+
}
|
16
|
+
Re1 = {
|
17
|
+
:begin => %r/\A[^ ]+[@][^ ]+[.][a-zA-Z]+\z/,
|
18
|
+
:error => %r/\A-------server message\z/,
|
19
|
+
:command => %r/\A-------SMTP command\z/,
|
20
|
+
:rfc822 => %r/\A-------original (?:message|mail info)\z/,
|
21
|
+
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
22
|
+
}
|
23
|
+
Indicators = Sisimai::MTA.INDICATORS
|
24
|
+
LongFields = Sisimai::RFC5322.LONGFIELDS
|
25
|
+
RFC822Head = Sisimai::RFC5322.HEADERFIELDS
|
26
|
+
|
27
|
+
def description; return 'Digital Arts m-FILTER'; end
|
28
|
+
def smtpagent; return 'm-FILTER'; end
|
29
|
+
def headerlist; return ['X-Mailer']; end
|
30
|
+
def pattern; return Re0; end
|
31
|
+
|
32
|
+
# Parse bounce messages from Digital Arts m-FILTER
|
33
|
+
# @param [Hash] mhead Message header of a bounce email
|
34
|
+
# @options mhead [String] from From header
|
35
|
+
# @options mhead [String] date Date header
|
36
|
+
# @options mhead [String] subject Subject header
|
37
|
+
# @options mhead [Array] received Received headers
|
38
|
+
# @options mhead [String] others Other required headers
|
39
|
+
# @param [String] mbody Message body of a bounce email
|
40
|
+
# @return [Hash, Nil] Bounce data list and message/rfc822
|
41
|
+
# part or nil if it failed to parse or
|
42
|
+
# the arguments are missing
|
43
|
+
def scan(mhead, mbody)
|
44
|
+
return nil unless mhead
|
45
|
+
return nil unless mbody
|
46
|
+
return nil unless mhead['x-mailer']
|
47
|
+
return nil unless mhead['x-mailer'] =~ Re0[:'x-mailer']
|
48
|
+
return nil unless mhead['subject'] =~ Re0[:'subject']
|
49
|
+
|
50
|
+
dscontents = []; dscontents << Sisimai::MTA.DELIVERYSTATUS
|
51
|
+
hasdivided = mbody.split("\n")
|
52
|
+
rfc822next = { 'from' => false, 'to' => false, 'subject' => false }
|
53
|
+
rfc822part = '' # (String) message/rfc822-headers part
|
54
|
+
previousfn = '' # (String) Previous field name
|
55
|
+
readcursor = 0 # (Integer) Points the current cursor position
|
56
|
+
recipients = 0 # (Integer) The number of 'Final-Recipient' header
|
57
|
+
markingset = { 'diagnosis' => false, 'command' => false }
|
58
|
+
v = nil
|
59
|
+
|
60
|
+
hasdivided.each do |e|
|
61
|
+
if readcursor == 0
|
62
|
+
# Beginning of the bounce message or delivery status part
|
63
|
+
readcursor |= Indicators[:'deliverystatus'] if e =~ Re1[:begin]
|
64
|
+
end
|
65
|
+
|
66
|
+
if readcursor & Indicators[:'message-rfc822'] == 0
|
67
|
+
# Beginning of the original message part
|
68
|
+
if e =~ Re1[:rfc822]
|
69
|
+
readcursor |= Indicators[:'message-rfc822']
|
70
|
+
next
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
if readcursor & Indicators[:'message-rfc822'] > 0
|
75
|
+
# After "message/rfc822"
|
76
|
+
if cv = e.match(/\A([-0-9A-Za-z]+?)[:][ ]*.+\z/)
|
77
|
+
# Get required headers only
|
78
|
+
lhs = cv[1].downcase
|
79
|
+
previousfn = ''
|
80
|
+
next unless RFC822Head.key?(lhs)
|
81
|
+
|
82
|
+
previousfn = lhs
|
83
|
+
rfc822part += e + "\n"
|
84
|
+
|
85
|
+
elsif e =~ /\A[ \t]+/
|
86
|
+
# Continued line from the previous line
|
87
|
+
next if rfc822next[previousfn]
|
88
|
+
rfc822part += e + "\n" if LongFields.key?(previousfn)
|
89
|
+
|
90
|
+
else
|
91
|
+
# Check the end of headers in rfc822 part
|
92
|
+
next unless LongFields.key?(previousfn)
|
93
|
+
next unless e.empty?
|
94
|
+
rfc822next[previousfn] = true
|
95
|
+
end
|
96
|
+
|
97
|
+
else
|
98
|
+
# Before "message/rfc822"
|
99
|
+
next if readcursor & Indicators[:'deliverystatus'] == 0
|
100
|
+
next if e.empty?
|
101
|
+
|
102
|
+
# このメールは「m-FILTER」が自動的に生成して送信しています。
|
103
|
+
# メールサーバーとの通信中、下記の理由により
|
104
|
+
# このメールは送信できませんでした。
|
105
|
+
#
|
106
|
+
# 以下のメールアドレスへの送信に失敗しました。
|
107
|
+
# kijitora@example.jp
|
108
|
+
#
|
109
|
+
#
|
110
|
+
# -------server message
|
111
|
+
# 550 5.1.1 unknown user <kijitora@example.jp>
|
112
|
+
#
|
113
|
+
# -------SMTP command
|
114
|
+
# DATA
|
115
|
+
#
|
116
|
+
# -------original message
|
117
|
+
v = dscontents[-1]
|
118
|
+
|
119
|
+
if cv = e.match(/\A([^ ]+[@][^ ]+)\z/)
|
120
|
+
# 以下のメールアドレスへの送信に失敗しました。
|
121
|
+
# kijitora@example.jp
|
122
|
+
if v['recipient']
|
123
|
+
# There are multiple recipient addresses in the message body.
|
124
|
+
dscontents << Sisimai::MTA.DELIVERYSTATUS
|
125
|
+
v = dscontents[-1]
|
126
|
+
end
|
127
|
+
v['recipient'] = cv[1]
|
128
|
+
recipients += 1
|
129
|
+
|
130
|
+
elsif e =~ /\A[A-Z]{4}/
|
131
|
+
# -------SMTP command
|
132
|
+
# DATA
|
133
|
+
next if v['command']
|
134
|
+
v['command'] = e if markingset['command']
|
135
|
+
|
136
|
+
else
|
137
|
+
# Get error message and SMTP command
|
138
|
+
if e =~ Re1[:error]
|
139
|
+
# -------server message
|
140
|
+
markingset['diagnosis'] = true
|
141
|
+
|
142
|
+
elsif e =~ Re1[:command]
|
143
|
+
# -------SMTP command
|
144
|
+
markingset['command'] = true
|
145
|
+
|
146
|
+
else
|
147
|
+
# 550 5.1.1 unknown user <kijitora@example.jp>
|
148
|
+
next if e =~ /\A[-]+/
|
149
|
+
next if v['diagnosis']
|
150
|
+
v['diagnosis'] = e
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
return nil if recipients == 0
|
157
|
+
require 'sisimai/string'
|
158
|
+
require 'sisimai/smtp/status'
|
159
|
+
|
160
|
+
dscontents.map do |e|
|
161
|
+
e['agent'] = Sisimai::MTA::MFILTER.smtpagent
|
162
|
+
|
163
|
+
if mhead['received'].size > 0
|
164
|
+
# Get localhost and remote host name from Received header.
|
165
|
+
rheads = mhead['received']
|
166
|
+
rhosts = Sisimai::RFC5322.received(rheads[-1])
|
167
|
+
|
168
|
+
e['lhost'] ||= Sisimai::RFC5322.received(rheads[0]).shift
|
169
|
+
rhosts.each do |ee|
|
170
|
+
# Avoid "... by m-FILTER"
|
171
|
+
next unless ee =~ /[.]/
|
172
|
+
e['rhost'] = ee
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
|
177
|
+
e['status'] = Sisimai::SMTP::Status.find(e['diagnosis'])
|
178
|
+
e['spec'] = e['reason'] == 'mailererror' ? 'X-UNIX' : 'SMTP'
|
179
|
+
e['action'] = 'failed' if e['status'] =~ /\A[45]/
|
180
|
+
e.each_key { |a| e[a] ||= '' }
|
181
|
+
end
|
182
|
+
|
183
|
+
return { 'ds' => dscontents, 'rfc822' => rfc822part }
|
184
|
+
end
|
185
|
+
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
@@ -0,0 +1,283 @@
|
|
1
|
+
module Sisimai
|
2
|
+
module MTA
|
3
|
+
# Sisimai::MTA::MXLogic parses a bounce email which created by McAfee SaaS
|
4
|
+
# (formerly MX Logic). Methods in the module are called from only Sisimai::Message.
|
5
|
+
module MXLogic
|
6
|
+
# Imported from p5-Sisimail/lib/Sisimai/MTA/MXLogic.pm
|
7
|
+
class << self
|
8
|
+
require 'sisimai/mta'
|
9
|
+
require 'sisimai/rfc5322'
|
10
|
+
|
11
|
+
# Based on Sisimai::MTA::Exim
|
12
|
+
Re0 = {
|
13
|
+
:'from' => %r/\AMail Delivery System/,
|
14
|
+
:'subject' => %r{(?:
|
15
|
+
Mail[ ]delivery[ ]failed(:[ ]returning[ ]message[ ]to[ ]sender)?
|
16
|
+
|Warning:[ ]message[ ].+[ ]delayed[ ]+
|
17
|
+
|Delivery[ ]Status[ ]Notification
|
18
|
+
)
|
19
|
+
}x,
|
20
|
+
:'message-id' => %r/\A[<]mxl[~][0-9a-f]+/,
|
21
|
+
}
|
22
|
+
Re1 = {
|
23
|
+
:rfc822 => %r/\AIncluded is a copy of the message header:\z/,
|
24
|
+
:begin => %r/\AThis message was created automatically by mail delivery software[.]\z/,
|
25
|
+
:endof => %r/\A__END_OF_EMAIL_MESSAGE__\z/,
|
26
|
+
}
|
27
|
+
ReCommand = [
|
28
|
+
%r/SMTP error from remote (?:mail server|mailer) after ([A-Za-z]{4})/,
|
29
|
+
%r/SMTP error from remote (?:mail server|mailer) after end of ([A-Za-z]{4})/,
|
30
|
+
]
|
31
|
+
|
32
|
+
ReFailure = {
|
33
|
+
'userunknown' => %r{
|
34
|
+
user[ ]not[ ]found
|
35
|
+
}x,
|
36
|
+
'hostunknown' => %r{(?>
|
37
|
+
all[ ](?:
|
38
|
+
host[ ]address[ ]lookups[ ]failed[ ]permanently
|
39
|
+
|relevant[ ]MX[ ]records[ ]point[ ]to[ ]non[-]existent[ ]hosts
|
40
|
+
)
|
41
|
+
|Unrouteable[ ]address
|
42
|
+
)
|
43
|
+
}x,
|
44
|
+
'mailboxfull' => %r{(?:
|
45
|
+
mailbox[ ]is[ ]full:?
|
46
|
+
|error:[ ]quota[ ]exceed
|
47
|
+
)
|
48
|
+
}x,
|
49
|
+
'notaccept' => %r{(?:
|
50
|
+
an[ ]MX[ ]or[ ]SRV[ ]record[ ]indicated[ ]no[ ]SMTP[ ]service
|
51
|
+
|no[ ]host[ ]found[ ]for[ ]existing[ ]SMTP[ ]connection
|
52
|
+
)
|
53
|
+
}x,
|
54
|
+
'systemerror' => %r{(?>
|
55
|
+
delivery[ ]to[ ](?:file|pipe)[ ]forbidden
|
56
|
+
|local[ ]delivery[ ]failed
|
57
|
+
|LMTP[ ]error[ ]after[ ]
|
58
|
+
)
|
59
|
+
}x,
|
60
|
+
'contenterror' => %r{
|
61
|
+
Too[ ]many[ ]["]Received["][ ]headers
|
62
|
+
}x,
|
63
|
+
}
|
64
|
+
|
65
|
+
ReDelayed = %r{(?:
|
66
|
+
retry[ ]timeout[ ]exceeded
|
67
|
+
|No[ ]action[ ]is[ ]required[ ]on[ ]your[ ]part
|
68
|
+
|retry[ ]time[ ]not[ ]reached[ ]for[ ]any[ ]host[ ]after[ ]a[ ]long[ ]failure[ ]period
|
69
|
+
|all[ ]hosts[ ]have[ ]been[ ]failing[ ]for[ ]a[ ]long[ ]time[ ]and[ ]were[ ]last[ ]tried
|
70
|
+
|Delay[ ]reason:[ ]
|
71
|
+
|Message[ ].+[ ](?:has[ ]been[ ]frozen|was[ ]frozen[ ]on[ ]arrival[ ]by[ ])
|
72
|
+
)
|
73
|
+
}x
|
74
|
+
Indicators = Sisimai::MTA.INDICATORS
|
75
|
+
LongFields = Sisimai::RFC5322.LONGFIELDS
|
76
|
+
RFC822Head = Sisimai::RFC5322.HEADERFIELDS
|
77
|
+
|
78
|
+
def description; return 'McAfee SaaS'; end
|
79
|
+
def smtpagent; return 'MXLogic'; end
|
80
|
+
# X-MX-Bounce: mta/src/queue/bounce
|
81
|
+
# X-MXL-NoteHash: ffffffffffffffff-0000000000000000000000000000000000000000
|
82
|
+
# X-MXL-Hash: 4c9d4d411993da17-bbd4212b6c887f6c23bab7db4bd87ef5edc00758
|
83
|
+
def headerlist; return ['X-MXL-NoteHash', 'X-MXL-Hash', 'X-MX-Bounce']; end
|
84
|
+
def pattern; return Re0; end
|
85
|
+
|
86
|
+
# Parse bounce messages from MXLogic
|
87
|
+
# @param [Hash] mhead Message header of a bounce email
|
88
|
+
# @options mhead [String] from From header
|
89
|
+
# @options mhead [String] date Date header
|
90
|
+
# @options mhead [String] subject Subject header
|
91
|
+
# @options mhead [Array] received Received headers
|
92
|
+
# @options mhead [String] others Other required headers
|
93
|
+
# @param [String] mbody Message body of a bounce email
|
94
|
+
# @return [Hash, Nil] Bounce data list and message/rfc822
|
95
|
+
# part or nil if it failed to parse or
|
96
|
+
# the arguments are missing
|
97
|
+
def scan(mhead, mbody)
|
98
|
+
return nil unless mhead
|
99
|
+
return nil unless mbody
|
100
|
+
|
101
|
+
match = 0
|
102
|
+
match += 1 if mhead['x-mx-bounce']
|
103
|
+
match += 1 if mhead['x-mxl-hash']
|
104
|
+
match += 1 if mhead['x-mxl-notehash']
|
105
|
+
match += 1 if mhead['subject'] =~ Re0[:subject]
|
106
|
+
match += 1 if mhead['from'] =~ Re0[:from]
|
107
|
+
return nil if match == 0
|
108
|
+
|
109
|
+
dscontents = []; dscontents << Sisimai::MTA.DELIVERYSTATUS
|
110
|
+
hasdivided = mbody.split("\n")
|
111
|
+
rfc822next = { 'from' => false, 'to' => false, 'subject' => false }
|
112
|
+
rfc822part = '' # (String) message/rfc822-headers part
|
113
|
+
previousfn = '' # (String) Previous field name
|
114
|
+
readcursor = 0 # (Integer) Points the current cursor position
|
115
|
+
recipients = 0 # (Integer) The number of 'Final-Recipient' header
|
116
|
+
localhost0 = '' # (String) Local MTA
|
117
|
+
v = nil
|
118
|
+
|
119
|
+
hasdivided.each do |e|
|
120
|
+
if readcursor == 0
|
121
|
+
# Beginning of the bounce message or delivery status part
|
122
|
+
if e =~ Re1[:begin]
|
123
|
+
readcursor |= Indicators[:'deliverystatus']
|
124
|
+
next
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
if readcursor & Indicators[:'message-rfc822'] == 0
|
129
|
+
# Beginning of the original message part
|
130
|
+
if e =~ Re1[:rfc822]
|
131
|
+
readcursor |= Indicators[:'message-rfc822']
|
132
|
+
next
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
if readcursor & Indicators[:'message-rfc822'] > 0
|
137
|
+
# After "message/rfc822"
|
138
|
+
if cv = e.match(/\A([-0-9A-Za-z]+?)[:][ ]*.+\z/)
|
139
|
+
# Get required headers only
|
140
|
+
lhs = cv[1].downcase
|
141
|
+
previousfn = ''
|
142
|
+
next unless RFC822Head.key?(lhs)
|
143
|
+
|
144
|
+
previousfn = lhs
|
145
|
+
rfc822part += e + "\n"
|
146
|
+
|
147
|
+
elsif e =~ /\A[ \t]+/
|
148
|
+
# Continued line from the previous line
|
149
|
+
next if rfc822next[previousfn]
|
150
|
+
rfc822part += e + "\n" if LongFields.key?(previousfn)
|
151
|
+
|
152
|
+
else
|
153
|
+
# Check the end of headers in rfc822 part
|
154
|
+
next unless LongFields.key?(previousfn)
|
155
|
+
next unless e.empty?
|
156
|
+
rfc822next[previousfn] = true
|
157
|
+
end
|
158
|
+
|
159
|
+
else
|
160
|
+
# Before "message/rfc822"
|
161
|
+
next if readcursor & Indicators[:'deliverystatus'] == 0
|
162
|
+
next if e.empty?
|
163
|
+
|
164
|
+
# This message was created automatically by mail delivery software.
|
165
|
+
#
|
166
|
+
# A message that you sent could not be delivered to one or more of its
|
167
|
+
# recipients. This is a permanent error. The following address(es) failed:
|
168
|
+
#
|
169
|
+
# kijitora@example.jp
|
170
|
+
# SMTP error from remote mail server after RCPT TO:<kijitora@example.jp>:
|
171
|
+
# host neko.example.jp [192.0.2.222]: 550 5.1.1 <kijitora@example.jp>... User Unknown
|
172
|
+
v = dscontents[-1]
|
173
|
+
|
174
|
+
if e =~ /[ \t]*This is a permanent error[.][ \t]*/
|
175
|
+
# deliver.c:6811| "recipients. This is a permanent error. The following address(es) failed:\n");
|
176
|
+
v['softbounce'] = 0
|
177
|
+
|
178
|
+
elsif cv = e.match(/\A[ \t]*[<]([^ ]+[@][^ ]+)[>]:(.+)\z/)
|
179
|
+
# A message that you have sent could not be delivered to one or more
|
180
|
+
# recipients. This is a permanent error. The following address failed:
|
181
|
+
#
|
182
|
+
# <kijitora@example.co.jp>: 550 5.1.1 ...
|
183
|
+
if v['recipient']
|
184
|
+
# There are multiple recipient addresses in the message body.
|
185
|
+
dscontents << Sisimai::MTA.DELIVERYSTATUS
|
186
|
+
v = dscontents[-1]
|
187
|
+
end
|
188
|
+
v['recipient'] = cv[1]
|
189
|
+
v['diagnosis'] = cv[2]
|
190
|
+
recipients += 1
|
191
|
+
|
192
|
+
elsif dscontents.size == recipients
|
193
|
+
# Error message
|
194
|
+
next if e.empty?
|
195
|
+
v['diagnosis'] ||= ''
|
196
|
+
v['diagnosis'] += e + ' '
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
return nil if recipients == 0
|
201
|
+
|
202
|
+
if mhead['received'].size > 0
|
203
|
+
# Get the name of local MTA
|
204
|
+
# Received: from marutamachi.example.org (c192128.example.net [192.0.2.128])
|
205
|
+
if cv = mhead['received'][-1].match(/from[ ]([^ ]+) /)
|
206
|
+
localhost0 = cv[1]
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
require 'sisimai/string'
|
211
|
+
require 'sisimai/smtp/status'
|
212
|
+
|
213
|
+
dscontents.map do |e|
|
214
|
+
e['agent'] = Sisimai::MTA::MXLogic.smtpagent
|
215
|
+
e['lhost'] = localhost0
|
216
|
+
|
217
|
+
e['diagnosis'] = e['diagnosis'].gsub(/[-]{2}.*\z/, '')
|
218
|
+
e['diagnosis'] = Sisimai::String.sweep(e['diagnosis'])
|
219
|
+
|
220
|
+
unless e['rhost']
|
221
|
+
# Get the remote host name
|
222
|
+
if cv = e['diagnosis'].match(/host[ ]+([^ \t]+)[ ]\[.+\]:[ ]/)
|
223
|
+
# host neko.example.jp [192.0.2.222]: 550 5.1.1 <kijitora@example.jp>... User Unknown
|
224
|
+
e['rhost'] = cv[1]
|
225
|
+
end
|
226
|
+
|
227
|
+
unless e['rhost']
|
228
|
+
if mhead['received'].size > 0
|
229
|
+
# Get localhost and remote host name from Received header.
|
230
|
+
e['rhost'] = Sisimai::RFC5322.received(mhead['received'][-1]).pop
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
unless e['command']
|
236
|
+
# Get the SMTP command name for the session
|
237
|
+
ReCommand.each do |r|
|
238
|
+
# Verify each regular expression of SMTP commands
|
239
|
+
if cv = e['diagnosis'].match(r)
|
240
|
+
e['command'] = cv[1].upcase
|
241
|
+
break
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
# Detect the reason of bounce
|
246
|
+
if e['command'] == 'MAIL'
|
247
|
+
# MAIL | Connected to 192.0.2.135 but sender was rejected.
|
248
|
+
e['reason'] = 'rejected'
|
249
|
+
|
250
|
+
elsif e['command'] =~ /\A(?:HELO|EHLO)\z/
|
251
|
+
# HELO | Connected to 192.0.2.135 but my name was rejected.
|
252
|
+
e['reason'] = 'blocked'
|
253
|
+
|
254
|
+
else
|
255
|
+
# Verify each regular expression of session errors
|
256
|
+
ReFailure.each_key do |r|
|
257
|
+
# Check each regular expression
|
258
|
+
next unless e['diagnosis'] =~ ReFailure[r]
|
259
|
+
e['reason'] = r
|
260
|
+
break
|
261
|
+
end
|
262
|
+
|
263
|
+
unless e['reason']
|
264
|
+
# The reason "expired"
|
265
|
+
e['reason'] = 'expired' if e['diagnosis'] =~ ReDelayed
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
e['status'] = Sisimai::SMTP::Status.find(e['diagnosis'])
|
271
|
+
e['spec'] = e['reason'] == 'mailererror' ? 'X-UNIX' : 'SMTP'
|
272
|
+
e['action'] = 'failed' if e['status'] =~ /\A[45]/
|
273
|
+
e.each_key { |a| e[a] ||= '' }
|
274
|
+
end
|
275
|
+
|
276
|
+
return { 'ds' => dscontents, 'rfc822' => rfc822part }
|
277
|
+
end
|
278
|
+
|
279
|
+
end
|
280
|
+
end
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|