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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/ANALYTICAL-PRECISION +16 -25
- data/ChangeLog.md +41 -0
- data/Developers.mk +2 -2
- data/README-JA.md +13 -13
- data/README.md +13 -13
- data/lib/sisimai.rb +3 -7
- data/lib/sisimai/address.rb +25 -41
- data/lib/sisimai/arf.rb +58 -59
- data/lib/sisimai/bite.rb +0 -1
- data/lib/sisimai/bite/email.rb +7 -7
- data/lib/sisimai/bite/email/activehunter.rb +4 -3
- data/lib/sisimai/bite/email/amavis.rb +133 -0
- data/lib/sisimai/bite/email/amazonses.rb +53 -87
- data/lib/sisimai/bite/email/amazonworkmail.rb +51 -57
- data/lib/sisimai/bite/email/aol.rb +50 -76
- data/lib/sisimai/bite/email/apachejames.rb +2 -2
- data/lib/sisimai/bite/email/bigfoot.rb +47 -74
- data/lib/sisimai/bite/email/biglobe.rb +8 -9
- data/lib/sisimai/bite/email/courier.rb +56 -101
- data/lib/sisimai/bite/email/domino.rb +7 -8
- data/lib/sisimai/bite/email/einsundeins.rb +4 -5
- data/lib/sisimai/bite/email/exchange2003.rb +21 -22
- data/lib/sisimai/bite/email/exchange2007.rb +26 -28
- data/lib/sisimai/bite/email/exim.rb +48 -47
- data/lib/sisimai/bite/email/ezweb.rb +24 -36
- data/lib/sisimai/bite/email/facebook.rb +54 -79
- data/lib/sisimai/bite/email/fml.rb +10 -10
- data/lib/sisimai/bite/email/gmx.rb +6 -6
- data/lib/sisimai/bite/email/google.rb +12 -13
- data/lib/sisimai/bite/email/gsuite.rb +80 -108
- data/lib/sisimai/bite/email/imailserver.rb +16 -16
- data/lib/sisimai/bite/email/interscanmss.rb +4 -6
- data/lib/sisimai/bite/email/kddi.rb +9 -11
- data/lib/sisimai/bite/email/mailfoundry.rb +2 -2
- data/lib/sisimai/bite/email/mailmarshalsmtp.rb +2 -2
- data/lib/sisimai/bite/email/mailru.rb +12 -13
- data/lib/sisimai/bite/email/mcafee.rb +31 -25
- data/lib/sisimai/bite/email/messagelabs.rb +48 -87
- data/lib/sisimai/bite/email/messagingserver.rb +9 -10
- data/lib/sisimai/bite/email/mfilter.rb +16 -16
- data/lib/sisimai/bite/email/mxlogic.rb +11 -11
- data/lib/sisimai/bite/email/notes.rb +5 -6
- data/lib/sisimai/bite/email/office365.rb +25 -42
- data/lib/sisimai/bite/email/opensmtpd.rb +8 -8
- data/lib/sisimai/bite/email/outlook.rb +49 -67
- data/lib/sisimai/bite/email/postfix.rb +78 -112
- data/lib/sisimai/bite/email/qmail.rb +23 -23
- data/lib/sisimai/bite/email/receivingses.rb +53 -86
- data/lib/sisimai/bite/email/sendgrid.rb +65 -84
- data/lib/sisimai/bite/email/sendmail.rb +89 -117
- data/lib/sisimai/bite/email/surfcontrol.rb +15 -18
- data/lib/sisimai/bite/email/userdefined.rb +1 -1
- data/lib/sisimai/bite/email/v5sendmail.rb +3 -4
- data/lib/sisimai/bite/email/verizon.rb +7 -8
- data/lib/sisimai/bite/email/x1.rb +2 -2
- data/lib/sisimai/bite/email/x2.rb +2 -2
- data/lib/sisimai/bite/email/x3.rb +3 -3
- data/lib/sisimai/bite/email/x4.rb +22 -22
- data/lib/sisimai/bite/email/x5.rb +40 -49
- data/lib/sisimai/bite/email/yahoo.rb +3 -3
- data/lib/sisimai/bite/email/yandex.rb +54 -82
- data/lib/sisimai/bite/email/zoho.rb +6 -6
- data/lib/sisimai/bite/json/amazonses.rb +20 -20
- data/lib/sisimai/bite/json/sendgrid.rb +2 -2
- data/lib/sisimai/data.rb +27 -40
- data/lib/sisimai/datetime.rb +146 -162
- data/lib/sisimai/mda.rb +30 -31
- data/lib/sisimai/message/email.rb +83 -123
- data/lib/sisimai/message/json.rb +2 -4
- data/lib/sisimai/mime.rb +31 -34
- data/lib/sisimai/order/email.rb +23 -22
- data/lib/sisimai/reason.rb +61 -61
- data/lib/sisimai/reason/blocked.rb +139 -135
- data/lib/sisimai/reason/contenterror.rb +11 -10
- data/lib/sisimai/reason/exceedlimit.rb +4 -4
- data/lib/sisimai/reason/expired.rb +20 -20
- data/lib/sisimai/reason/filtered.rb +19 -18
- data/lib/sisimai/reason/hasmoved.rb +3 -3
- data/lib/sisimai/reason/hostunknown.rb +19 -19
- data/lib/sisimai/reason/mailboxfull.rb +49 -49
- data/lib/sisimai/reason/mailererror.rb +16 -16
- data/lib/sisimai/reason/mesgtoobig.rb +17 -17
- data/lib/sisimai/reason/networkerror.rb +19 -19
- data/lib/sisimai/reason/norelaying.rb +16 -16
- data/lib/sisimai/reason/notaccept.rb +9 -10
- data/lib/sisimai/reason/onhold.rb +1 -1
- data/lib/sisimai/reason/policyviolation.rb +21 -20
- data/lib/sisimai/reason/rejected.rb +53 -53
- data/lib/sisimai/reason/securityerror.rb +29 -29
- data/lib/sisimai/reason/spamdetected.rb +127 -127
- data/lib/sisimai/reason/suspend.rb +17 -17
- data/lib/sisimai/reason/systemerror.rb +22 -21
- data/lib/sisimai/reason/systemfull.rb +6 -6
- data/lib/sisimai/reason/toomanyconn.rb +19 -18
- data/lib/sisimai/reason/userunknown.rb +122 -121
- data/lib/sisimai/reason/vacation.rb +8 -8
- data/lib/sisimai/reason/virusdetected.rb +8 -8
- data/lib/sisimai/rfc1894.rb +142 -0
- data/lib/sisimai/rfc3464.rb +70 -70
- data/lib/sisimai/rfc3834.rb +15 -15
- data/lib/sisimai/rfc5322.rb +20 -36
- data/lib/sisimai/rhost.rb +1 -0
- data/lib/sisimai/rhost/exchangeonline.rb +31 -33
- data/lib/sisimai/rhost/franceptt.rb +23 -23
- data/lib/sisimai/rhost/godaddy.rb +28 -28
- data/lib/sisimai/rhost/googleapps.rb +39 -41
- data/lib/sisimai/rhost/kddi.rb +3 -3
- data/lib/sisimai/rhost/tencentqq.rb +51 -0
- data/lib/sisimai/smtp/error.rb +14 -21
- data/lib/sisimai/smtp/reply.rb +14 -13
- data/lib/sisimai/smtp/status.rb +178 -179
- data/lib/sisimai/string.rb +13 -12
- data/lib/sisimai/version.rb +1 -1
- data/set-of-emails/README.md +1 -5
- data/set-of-emails/maildir/bsd/arf-23.eml +49 -0
- data/set-of-emails/maildir/bsd/email-amavis-01.eml +78 -0
- data/set-of-emails/maildir/bsd/email-amavis-02.eml +78 -0
- data/set-of-emails/maildir/bsd/email-exchange2007-04.eml +146 -0
- data/set-of-emails/maildir/bsd/email-exim-60.eml +94 -0
- data/set-of-emails/maildir/bsd/email-ezweb-08.eml +49 -0
- data/set-of-emails/maildir/bsd/email-google-19.eml +67 -0
- data/set-of-emails/maildir/bsd/email-mcafee-05.eml +74 -0
- data/set-of-emails/maildir/bsd/email-messagingserver-12.eml +99 -0
- data/set-of-emails/maildir/bsd/email-postfix-46.eml +81 -0
- data/set-of-emails/maildir/bsd/email-postfix-47.eml +79 -0
- data/set-of-emails/maildir/bsd/email-postfix-48.eml +79 -0
- data/set-of-emails/maildir/bsd/email-postfix-49.eml +141 -0
- data/set-of-emails/maildir/bsd/email-postfix-50.eml +143 -0
- data/set-of-emails/maildir/bsd/email-postfix-51.eml +73 -0
- data/set-of-emails/maildir/bsd/email-postfix-52.eml +79 -0
- data/set-of-emails/maildir/bsd/email-postfix-53.eml +76 -0
- data/set-of-emails/maildir/bsd/email-postfix-54.eml +73 -0
- data/set-of-emails/maildir/bsd/email-postfix-55.eml +74 -0
- data/set-of-emails/maildir/bsd/email-postfix-56.eml +78 -0
- data/set-of-emails/maildir/bsd/email-qmail-10.eml +50 -0
- data/set-of-emails/maildir/bsd/email-x2-05.eml +38 -0
- data/set-of-emails/maildir/bsd/rhost-google-apps-02.eml +88 -0
- data/set-of-emails/maildir/bsd/rhost-tencentqq-01.eml +84 -0
- data/set-of-emails/maildir/bsd/rhost-tencentqq-02.eml +84 -0
- data/set-of-emails/maildir/bsd/rhost-tencentqq-03.eml +81 -0
- data/set-of-emails/maildir/dos/email-amavis-01.eml +78 -0
- data/set-of-emails/maildir/dos/email-apachejames-01.eml +1 -2
- data/set-of-emails/maildir/dos/email-messagelabs-01.eml +67 -50
- data/set-of-emails/maildir/dos/email-x4-01.eml +31 -76
- data/set-of-emails/maildir/dos/rhost-tencentqq-01.eml +84 -0
- data/set-of-emails/maildir/mac/email-amavis-01.eml +1 -4
- data/set-of-emails/maildir/mac/email-apachejames-01.eml +1 -9
- data/set-of-emails/maildir/mac/email-messagelabs-01.eml +1 -9
- data/set-of-emails/maildir/mac/email-x4-01.eml +1 -5
- data/set-of-emails/maildir/mac/rhost-tencentqq-01.eml +1 -4
- metadata +35 -4
- data/set-of-emails/logo/horizontalversions.png +0 -0
- data/set-of-emails/logo/icon.png +0 -0
data/lib/sisimai/datetime.rb
CHANGED
@@ -14,23 +14,23 @@ module Sisimai
|
|
14
14
|
TZ_OFFSET = 54000 # Max time zone offset, 54000 seconds
|
15
15
|
|
16
16
|
TimeUnit = {
|
17
|
-
o
|
18
|
-
y
|
19
|
-
q
|
20
|
-
l
|
21
|
-
f
|
22
|
-
w
|
23
|
-
d
|
24
|
-
h
|
25
|
-
b
|
26
|
-
m
|
27
|
-
s
|
17
|
+
'o' => (BASE_D * BASE_Y * 4), # Olympiad, 4 years
|
18
|
+
'y' => (BASE_D * BASE_Y), # Year, Gregorian Calendar
|
19
|
+
'q' => (BASE_D * BASE_Y / 4), # Quarter, year/4
|
20
|
+
'l' => (BASE_D * BASE_L), # Lunar month
|
21
|
+
'f' => (BASE_D * 14), # Fortnight, 2 weeks
|
22
|
+
'w' => (BASE_D * 7), # Week, 604800 seconds
|
23
|
+
'd' => BASE_D, # Day
|
24
|
+
'h' => 3600, # Hour
|
25
|
+
'b' => 86.4, # Beat, Swatch internet time: 1000b = 1d
|
26
|
+
'm' => 60, # Minute,
|
27
|
+
's' => 1, # Second
|
28
28
|
}.freeze
|
29
29
|
|
30
30
|
MathematicalConstant = {
|
31
|
-
e
|
32
|
-
p
|
33
|
-
g
|
31
|
+
'e' => CONST_E,
|
32
|
+
'p' => CONST_P,
|
33
|
+
'g' => CONST_E**CONST_P,
|
34
34
|
}.freeze
|
35
35
|
|
36
36
|
MonthName = {
|
@@ -43,138 +43,133 @@ module Sisimai
|
|
43
43
|
abbr: %w[Sun Mon Tue Wed Thu Fri Sat],
|
44
44
|
}.freeze
|
45
45
|
|
46
|
-
HourName = {
|
47
|
-
full: %w[Midnight 1 2 3 4 5 Morning 7 8 9 10 11 Noon 13 14 15 16 17 Evening 19 20 21 22 23],
|
48
|
-
abbr: [0..23],
|
49
|
-
}.freeze
|
50
|
-
|
51
46
|
TimeZoneAbbr = {
|
52
47
|
# http://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
ADT
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
AKDT
|
61
|
-
AKST
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
AST
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
CDT
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
CST
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
# DST
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
EDT
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
EST
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
GMT
|
118
|
-
#
|
119
|
-
#
|
120
|
-
HADT
|
121
|
-
HAST
|
122
|
-
#
|
123
|
-
#
|
124
|
-
HST
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
JST
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
MDT
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
MST
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
PDT
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
PST
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
UT
|
167
|
-
UTC
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
#
|
48
|
+
#'ACDT' => '+1030', # Australian Central Daylight Time UTC+10:30
|
49
|
+
#'ACST' => '+0930', # Australian Central Standard Time UTC+09:30
|
50
|
+
#'ACT' => '+0800', # ASEAN Common Time UTC+08:00
|
51
|
+
'ADT' => '-0300', # Atlantic Daylight Time UTC-03:00
|
52
|
+
#'AEDT' => '+1100', # Australian Eastern Daylight Time UTC+11:00
|
53
|
+
#'AEST' => '+1000', # Australian Eastern Standard Time UTC+10:00
|
54
|
+
#'AFT' => '+0430', # Afghanistan Time UTC+04:30
|
55
|
+
'AKDT' => '-0800', # Alaska Daylight Time UTC-08:00
|
56
|
+
'AKST' => '-0900', # Alaska Standard Time UTC-09:00
|
57
|
+
#'AMST' => '+0500', # Armenia Summer Time UTC+05:00
|
58
|
+
#'AMT' => '+0400', # Armenia Time UTC+04:00
|
59
|
+
#'ART' => '-0300', # Argentina Time UTC+03:00
|
60
|
+
#'AST' => '+0300', # Arab Standard Time (Kuwait, Riyadh) UTC+03:00
|
61
|
+
#'AST' => '+0400', # Arabian Standard Time (Abu Dhabi, Muscat) UTC+04:00
|
62
|
+
#'AST' => '+0300', # Arabic Standard Time (Baghdad) UTC+03:00
|
63
|
+
'AST' => '-0400', # Atlantic Standard Time UTC-04:00
|
64
|
+
#'AWDT' => '+0900', # Australian Western Daylight Time UTC+09:00
|
65
|
+
#'AWST' => '+0800', # Australian Western Standard Time UTC+08:00
|
66
|
+
#'AZOST'=> '-0100', # Azores Standard Time UTC-01:00
|
67
|
+
#'AZT' => '+0400', # Azerbaijan Time UTC+04:00
|
68
|
+
#'BDT' => '+0800', # Brunei Time UTC+08:00
|
69
|
+
#'BIOT' => '+0600', # British Indian Ocean Time UTC+06:00
|
70
|
+
#'BIT' => '-1200', # Baker Island Time UTC-12:00
|
71
|
+
#'BOT' => '-0400', # Bolivia Time UTC-04:00
|
72
|
+
#'BRT' => '-0300', # Brasilia Time UTC-03:00
|
73
|
+
#'BST' => '+0600', # Bangladesh Standard Time UTC+06:00
|
74
|
+
#'BST' => '+0100', # British Summer Time (British Standard Time from Feb 1968 to Oct 1971) UTC+01:00
|
75
|
+
#'BTT' => '+0600', # Bhutan Time UTC+06:00
|
76
|
+
#'CAT' => '+0200', # Central Africa Time UTC+02:00
|
77
|
+
#'CCT' => '+0630', # Cocos Islands Time UTC+06:30
|
78
|
+
'CDT' => '-0500', # Central Daylight Time (North America) UTC-05:00
|
79
|
+
#'CEDT' => '+0200', # Central European Daylight Time UTC+02:00
|
80
|
+
#'CEST' => '+0200', # Central European Summer Time UTC+02:00
|
81
|
+
#'CET' => '+0100', # Central European Time UTC+01:00
|
82
|
+
#'CHAST'=> '+1245', # Chatham Standard Time UTC+12:45
|
83
|
+
#'CIST' => '-0800', # Clipperton Island Standard Time UTC-08:00
|
84
|
+
#'CKT' => '-1000', # Cook Island Time UTC-10:00
|
85
|
+
#'CLST' => '-0300', # Chile Summer Time UTC-03:00
|
86
|
+
#'CLT' => '-0400', # Chile Standard Time UTC-04:00
|
87
|
+
#'COST' => '-0400', # Colombia Summer Time UTC-04:00
|
88
|
+
#'COT' => '-0500', # Colombia Time UTC-05:00
|
89
|
+
'CST' => '-0600', # Central Standard Time (North America) UTC-06:00
|
90
|
+
#'CST' => '+0800', # China Standard Time UTC+08:00
|
91
|
+
#'CVT' => '-0100', # Cape Verde Time UTC-01:00
|
92
|
+
#'CXT' => '+0700', # Christmas Island Time UTC+07:00
|
93
|
+
#'ChST' => '+1000', # Chamorro Standard Time UTC+10:00
|
94
|
+
# 'DST' => '' # Daylight saving time Depending
|
95
|
+
#'DFT' => '+0100', # AIX specific equivalent of Central European Time UTC+01:00
|
96
|
+
#'EAST' => '-0600', # Easter Island Standard Time UTC-06:00
|
97
|
+
#'EAT' => '+0300', # East Africa Time UTC+03:00
|
98
|
+
#'ECT' => '-0400', # Eastern Caribbean Time (does not recognise DST) UTC-04:00
|
99
|
+
#'ECT' => '-0500', # Ecuador Time UTC-05:00
|
100
|
+
'EDT' => '-0400', # Eastern Daylight Time (North America) UTC-04:00
|
101
|
+
#'EEDT' => '+0300', # Eastern European Daylight Time UTC+03:00
|
102
|
+
#'EEST' => '+0300', # Eastern European Summer Time UTC+03:00
|
103
|
+
#'EET' => '+0200', # Eastern European Time UTC+02:00
|
104
|
+
'EST' => '+0500', # Eastern Standard Time (North America) UTC-05:00
|
105
|
+
#'FJT' => '+1200', # Fiji Time UTC+12:00
|
106
|
+
#'FKST' => '-0400', # Falkland Islands Standard Time UTC-04:00
|
107
|
+
#'GALT' => '-0600', # Galapagos Time UTC-06:00
|
108
|
+
#'GET' => '+0400', # Georgia Standard Time UTC+04:00
|
109
|
+
#'GFT' => '-0300', # French Guiana Time UTC-03:00
|
110
|
+
#'GILT' => '+1200', # Gilbert Island Time UTC+12:00
|
111
|
+
#'GIT' => '-0900', # Gambier Island Time UTC-09:00
|
112
|
+
'GMT' => '+0000', # Greenwich Mean Time UTC
|
113
|
+
#'GST' => '-0200', # South Georgia and the South Sandwich Islands UTC-02:00
|
114
|
+
#'GYT' => '-0400', # Guyana Time UTC-04:00
|
115
|
+
'HADT' => '-0900', # Hawaii-Aleutian Daylight Time UTC-09:00
|
116
|
+
'HAST' => '-1000', # Hawaii-Aleutian Standard Time UTC-10:00
|
117
|
+
#'HKT' => '+0800', # Hong Kong Time UTC+08:00
|
118
|
+
#'HMT' => '+0500', # Heard and McDonald Islands Time UTC+05:00
|
119
|
+
'HST' => '-1000', # Hawaii Standard Time UTC-10:00
|
120
|
+
#'IRKT' => '+0800', # Irkutsk Time UTC+08:00
|
121
|
+
#'IRST' => '+0330', # Iran Standard Time UTC+03:30
|
122
|
+
#'IST' => '+0530', # Indian Standard Time UTC+05:30
|
123
|
+
#'IST' => '+0100', # Irish Summer Time UTC+01:00
|
124
|
+
#'IST' => '+0200', # Israel Standard Time UTC+02:00
|
125
|
+
'JST' => '+0900', # Japan Standard Time UTC+09:00
|
126
|
+
#'KRAT' => '+0700', # Krasnoyarsk Time UTC+07:00
|
127
|
+
#'KST' => '+0900', # Korea Standard Time UTC+09:00
|
128
|
+
#'LHST' => '+1030', # Lord Howe Standard Time UTC+10:30
|
129
|
+
#'LINT' => '+1400', # Line Islands Time UTC+14:00
|
130
|
+
#'MAGT' => '+1100', # Magadan Time UTC+11:00
|
131
|
+
'MDT' => '-0600', # Mountain Daylight Time(North America) UTC-06:00
|
132
|
+
#'MIT' => '-0930', # Marquesas Islands Time UTC-09:30
|
133
|
+
#'MSD' => '+0400', # Moscow Summer Time UTC+04:00
|
134
|
+
#'MSK' => '+0300', # Moscow Standard Time UTC+03:00
|
135
|
+
#'MST' => '+0800', # Malaysian Standard Time UTC+08:00
|
136
|
+
'MST' => '-0700', # Mountain Standard Time(North America) UTC-07:00
|
137
|
+
#'MST' => '+0630', # Myanmar Standard Time UTC+06:30
|
138
|
+
#'MUT' => '+0400', # Mauritius Time UTC+04:00
|
139
|
+
#'NDT' => '-0230', # Newfoundland Daylight Time UTC-02:30
|
140
|
+
#'NFT' => '+1130', # Norfolk Time[1] UTC+11:30
|
141
|
+
#'NPT' => '+0545', # Nepal Time UTC+05:45
|
142
|
+
#'NST' => '-0330', # Newfoundland Standard Time UTC-03:30
|
143
|
+
#'NT' => '-0330', # Newfoundland Time UTC-03:30
|
144
|
+
#'OMST' => '+0600', # Omsk Time UTC+06:00
|
145
|
+
'PDT' => '-0700', # Pacific Daylight Time(North America) UTC-07:00
|
146
|
+
#'PETT' => '+1200', # Kamchatka Time UTC+12:00
|
147
|
+
#'PHOT' => '+1300', # Phoenix Island Time UTC+13:00
|
148
|
+
#'PKT' => '+0500', # Pakistan Standard Time UTC+05:00
|
149
|
+
'PST' => '-0800', # Pacific Standard Time (North America) UTC-08:00
|
150
|
+
#'PST' => '+0800', # Philippine Standard Time UTC+08:00
|
151
|
+
#'RET' => '+0400', # Reunion Time UTC+04:00
|
152
|
+
#'SAMT' => '+0400', # Samara Time UTC+04:00
|
153
|
+
#'SAST' => '+0200', # South African Standard Time UTC+02:00
|
154
|
+
#'SBT' => '+1100', # Solomon Islands Time UTC+11:00
|
155
|
+
#'SCT' => '+0400', # Seychelles Time UTC+04:00
|
156
|
+
#'SLT' => '+0530', # Sri Lanka Time UTC+05:30
|
157
|
+
#'SST' => '-1100', # Samoa Standard Time UTC-11:00
|
158
|
+
#'SST' => '+0800', # Singapore Standard Time UTC+08:00
|
159
|
+
#'TAHT' => '-1000', # Tahiti Time UTC-10:00
|
160
|
+
#'THA' => '+0700', # Thailand Standard Time UTC+07:00
|
161
|
+
'UT' => '-0000', # Coordinated Universal Time UTC
|
162
|
+
'UTC' => '-0000', # Coordinated Universal Time UTC
|
163
|
+
#'UYST' => '-0200', # Uruguay Summer Time UTC-02:00
|
164
|
+
#'UYT' => '-0300', # Uruguay Standard Time UTC-03:00
|
165
|
+
#'VET' => '-0430', # Venezuelan Standard Time UTC-04:30
|
166
|
+
#'VLAT' => '+1000', # Vladivostok Time UTC+10:00
|
167
|
+
#'WAT' => '+0100', # West Africa Time UTC+01:00
|
168
|
+
#'WEDT' => '+0100', # Western European Daylight Time UTC+01:00
|
169
|
+
#'WEST' => '+0100', # Western European Summer Time UTC+01:00
|
170
|
+
#'WET' => '-0000', # Western European Time UTC
|
171
|
+
#'YAKT' => '+0900', # Yakutsk Time UTC+09:00
|
172
|
+
#'YEKT' => '+0500', # Yekaterinburg Time UTC+05:00
|
178
173
|
}.freeze
|
179
174
|
|
180
175
|
# Convert to second
|
@@ -195,15 +190,15 @@ module Sisimai
|
|
195
190
|
# 1d, 1.5w
|
196
191
|
n = cr[1].to_f
|
197
192
|
u = cr[2] || 'd'
|
198
|
-
getseconds = n * TimeUnit[u
|
193
|
+
getseconds = n * TimeUnit[u].to_f
|
199
194
|
|
200
195
|
elsif cr = argv1.match(/\A(\d+|\d+[.]\d+)?([#{mathconsts}])([#{unitoftime}])?\z/)
|
201
196
|
# 1pd, 1.5pw
|
202
197
|
n = cr[1].to_f || 1
|
203
198
|
n = 1 if n.to_i == 0
|
204
|
-
m = MathematicalConstant[cr[2]
|
199
|
+
m = MathematicalConstant[cr[2]].to_f
|
205
200
|
u = cr[3] || 'd'
|
206
|
-
getseconds = n * m * TimeUnit[u
|
201
|
+
getseconds = n * m * TimeUnit[u].to_f
|
207
202
|
else
|
208
203
|
getseconds = 0
|
209
204
|
end
|
@@ -233,17 +228,6 @@ module Sisimai
|
|
233
228
|
return DayOfWeek[value]
|
234
229
|
end
|
235
230
|
|
236
|
-
# Hour name list
|
237
|
-
# @param [Integer] argv1 Require full name
|
238
|
-
# @return [Array, String] Month name
|
239
|
-
# @example Get the names of each hour
|
240
|
-
# hourname() #=> [ 0, 1, 2, ... 23 ]
|
241
|
-
# hourname(1) #=> [ 'Midnight', 1, 2, ... 'Morning', 7, ... 'Noon', ... 23 ]
|
242
|
-
def hourname(argv1 = 1)
|
243
|
-
value = argv1 > 0 ? :full : :abbr
|
244
|
-
return HourName[value]
|
245
|
-
end
|
246
|
-
|
247
231
|
# Parse date string; strptime() wrapper
|
248
232
|
# @param [String] argv1 Date string
|
249
233
|
# @return [String] Converted date string
|
@@ -415,7 +399,7 @@ module Sisimai
|
|
415
399
|
# abbr2tz('JST') #=> '+0900'
|
416
400
|
def abbr2tz(argv1)
|
417
401
|
return nil unless argv1.is_a?(::String)
|
418
|
-
return TimeZoneAbbr[argv1
|
402
|
+
return TimeZoneAbbr[argv1]
|
419
403
|
end
|
420
404
|
|
421
405
|
# Convert to second
|
@@ -444,7 +428,7 @@ module Sisimai
|
|
444
428
|
return ztime
|
445
429
|
|
446
430
|
elsif argv1 =~ /\A[A-Za-z]+\z/
|
447
|
-
return tz2second(TimeZoneAbbr[argv1
|
431
|
+
return tz2second(TimeZoneAbbr[argv1])
|
448
432
|
else
|
449
433
|
return nil
|
450
434
|
end
|
@@ -458,9 +442,9 @@ module Sisimai
|
|
458
442
|
# second2tz(12345) #=> '+0325'
|
459
443
|
def second2tz(argv1)
|
460
444
|
return '+0000' unless argv1.is_a?(Number)
|
461
|
-
|
445
|
+
return nil if argv1.abs > TZ_OFFSET # UTC+14 + 1(DST?)
|
462
446
|
|
463
|
-
|
447
|
+
digit = { :operator => '+' }
|
464
448
|
digit[:operator] = '-' if argv1 < 0
|
465
449
|
digit[:hours] = (argv1.abs / 3600).to_i
|
466
450
|
digit[:minutes] = ((argv1.abs % 3600) / 60).to_i
|
data/lib/sisimai/mda.rb
CHANGED
@@ -7,12 +7,12 @@ module Sisimai
|
|
7
7
|
# dovecot/src/deliver/deliver.c
|
8
8
|
# 11: #define DEFAULT_MAIL_REJECTION_HUMAN_REASON \
|
9
9
|
# 12: "Your message to <%t> was automatically rejected:%n%r"
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
'dovecot' => %r/\AYour message to .+ was automatically rejected:\z/,
|
11
|
+
'mail.local' => %r/\Amail[.]local: /,
|
12
|
+
'procmail' => %r/\Aprocmail: /,
|
13
|
+
'maildrop' => %r/\Amaildrop: /,
|
14
|
+
'vpopmail' => %r/\Avdelivermail: /,
|
15
|
+
'vmailmgr' => %r/\Avdeliver: /,
|
16
16
|
}.freeze
|
17
17
|
MarkingsOf = {
|
18
18
|
message: %r{\A(?>
|
@@ -24,53 +24,53 @@ module Sisimai
|
|
24
24
|
|
25
25
|
# dovecot/src/deliver/mail-send.c:94
|
26
26
|
MessagesOf = {
|
27
|
-
|
28
|
-
userunknown
|
29
|
-
mailboxfull
|
27
|
+
'dovecot' => {
|
28
|
+
'userunknown' => ["mailbox doesn't exist: "],
|
29
|
+
'mailboxfull' => [
|
30
30
|
'quota exceeded', # Dovecot 1.2 dovecot/src/plugins/quota/quota.c
|
31
31
|
'quota exceeded (mailbox for user is full)', # dovecot/src/plugins/quota/quota.c
|
32
32
|
'not enough disk space',
|
33
33
|
],
|
34
34
|
},
|
35
|
-
|
36
|
-
userunknown
|
35
|
+
'mail.local' => {
|
36
|
+
'userunknown' => [
|
37
37
|
': unknown user:',
|
38
38
|
': user unknown',
|
39
39
|
': invalid mailbox path',
|
40
40
|
': user missing home directory',
|
41
41
|
],
|
42
|
-
mailboxfull
|
42
|
+
'mailboxfull' => [
|
43
43
|
'disc quota exceeded',
|
44
44
|
'mailbox full or quota exceeded',
|
45
45
|
],
|
46
|
-
systemerror
|
46
|
+
'systemerror' => ['temporary file write error'],
|
47
47
|
},
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
'procmail' => {
|
49
|
+
'mailboxfull' => ['quota exceeded while writing'],
|
50
|
+
'systemfull' => ['no space left to finish writing'],
|
51
51
|
},
|
52
|
-
|
53
|
-
|
52
|
+
'maildrop' => {
|
53
|
+
'userunknown' => [
|
54
54
|
'invalid user specified.',
|
55
55
|
'Cannot find system user',
|
56
56
|
],
|
57
|
-
|
57
|
+
'mailboxfull' => ['maildir over quota.'],
|
58
58
|
},
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
'vpopmail' => {
|
60
|
+
'userunknown' => ['sorry, no mailbox here by that name.'],
|
61
|
+
'filtered' => [
|
62
62
|
'account is locked email bounced',
|
63
63
|
'user does not exist, but will deliver to '
|
64
64
|
],
|
65
|
-
|
65
|
+
'mailboxfull' => ['domain is over quota', 'user is over quota'],
|
66
66
|
},
|
67
|
-
|
68
|
-
|
67
|
+
'vmailmgr' => {
|
68
|
+
'userunknown' => [
|
69
69
|
'invalid or unknown base user or domain',
|
70
70
|
'invalid or unknown virtual user',
|
71
71
|
'user name does not refer to a virtual user'
|
72
72
|
],
|
73
|
-
mailboxfull
|
73
|
+
'mailboxfull' => ['delivery failed due to system quota violation'],
|
74
74
|
},
|
75
75
|
}.freeze
|
76
76
|
|
@@ -104,7 +104,7 @@ module Sisimai
|
|
104
104
|
AgentNames.each_key do |f|
|
105
105
|
# Detect the agent name from the line
|
106
106
|
next unless e =~ AgentNames[f]
|
107
|
-
agentname0 = f
|
107
|
+
agentname0 = f
|
108
108
|
break
|
109
109
|
end
|
110
110
|
end
|
@@ -116,14 +116,13 @@ module Sisimai
|
|
116
116
|
return nil if agentname0.empty?
|
117
117
|
return nil if linebuffer.empty?
|
118
118
|
|
119
|
-
MessagesOf[agentname0
|
119
|
+
MessagesOf[agentname0].each_key do |e|
|
120
120
|
# Detect an error reason from message patterns of the MDA.
|
121
121
|
duplicated = linebuffer.dup
|
122
122
|
while f = duplicated.shift do
|
123
123
|
# Whether the error message include each message defined in $MessagesOf
|
124
|
-
|
125
|
-
|
126
|
-
reasonname = e.to_s
|
124
|
+
next unless MessagesOf[agentname0][e].any? { |a| f.downcase.include?(a) }
|
125
|
+
reasonname = e
|
127
126
|
bouncemesg = f
|
128
127
|
break
|
129
128
|
end
|