mailparser 0.4.22a

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY ADDED
@@ -0,0 +1,141 @@
1
+ == 0.4.22 2010-06-11 ==
2
+ * 添付ファイルの末尾の改行コードを削除してしまっていたバグを修正
3
+
4
+ == 0.4.21 2010-06-03 ==
5
+ * :use_file オプション追加
6
+ * 省メモリ化
7
+ * Content-Type が text の時にだけ charset 変換するように修正
8
+
9
+ == 0.4.20 2010-05-04 ==
10
+ * ヘッダが8bit文字を含む場合に MailParser::Header#each が落ちることがあるバグを修正
11
+
12
+ == 0.4.19 2009-05-12 ==
13
+ * Received に \v が含まれていると無限ループになっていたバグを修正
14
+ cf. http://redmine.ruby-lang.org/issues/show/1196
15
+
16
+ == 0.4.18 2009-01-27 ==
17
+ * トークンが非常に多い文字列のパースに時間がかかっていた
18
+
19
+ == 0.4.17 2008-11-26 ==
20
+ * 閏秒が 23:59:60 しか考慮されていなかったバグを修正
21
+
22
+ == 0.4.16 2008-07-28 ==
23
+ * uuencode エンコーディングに対応
24
+
25
+ == 0.4.15 2008-06-25 ==
26
+ * 「group:, hoge@example.com;」の形式で落ちていたバグを修正
27
+
28
+ == 0.4.14 2008-04-03 ==
29
+ * 値がない Received ヘッダで落ちるバグを修正
30
+ * Header#[] で nil 値は返さないように修正
31
+ * Content-Type の subtype がない場合、type が text 以外でも plain になっていた。"" を返すように修正
32
+ * 値がない Keywords ヘッダが [nil] を返していた。[] を返すように修正
33
+
34
+ == 0.4.13 2008-03-09 ==
35
+ * Quoted-Printable のデコード時に、= の後に改行が連続していると行が結合してしまっていたバグを修正
36
+
37
+ == 0.4.12 2008-01-24 ==
38
+ * Message-Id が不正な形式の場合、空白文字を含んだIDを返していた
39
+
40
+ == 0.4.11 2008-01-15 ==
41
+ * 日付の判定を厳密にした
42
+
43
+ == 0.4.10 2007-11-06 ==
44
+ * Content-Transfer-Encoding が空の場合に落ちるバグを修正
45
+
46
+ == 0.4.9 2007-10-04 ==
47
+ * :charset_converter 追加
48
+
49
+ == 0.4.8 2007-09-17 ==
50
+ * < > がない Message-Id で落ちていた
51
+ * Message#body_preconv 追加
52
+
53
+ == 0.4.7 2007-08-29 ==
54
+ * boundary 文字列の直前の行の改行コードを無視しないといけなかった (RFC2046)
55
+ * Message.new の第一引数に渡すオブジェクトに必要なメソッドを each_line から gets に変更
56
+ * Content-Type ヘッダがない場合/charset パラメータがない場合、Message#charset が nil を返すように変更
57
+ * racc コンパイル済み .rb ファイルを同梱
58
+ * MailSuite::Message が String も受け付けるようにした
59
+
60
+ == 0.4.6 2007-08-09 ==
61
+ * :keep_raw 指定時、ヘッダの継続行が二重になっていた
62
+
63
+ == 0.4.5 2007-08-07 ==
64
+ * :decode_mime_filename 指定時、Content-Type も Content-Disposition もない場合に、落ちていたバグを修正
65
+ * 空の Content-Type, Content-Disposition でエラーになっていた
66
+ * ヘッダ行のみで区切りの空行がないパートを正しく扱えてなかった
67
+ * Message#raw の効率化
68
+ * Obsolete: RFC2231形式の添付ファイル名が正しく取得できないことがあった
69
+
70
+ == 0.4.4 2007-08-06 ==
71
+ * :keep_raw オプション追加。
72
+ * Message#raw メソッド追加。
73
+
74
+ == 0.4.3 2007-06-01 ==
75
+ * ヘッダと本文の間の区切りの空行が無い場合にエラーになっていたバグを修正
76
+ * RFC2231 パラメータが不正な時、strict=false でも ParseError になっていた
77
+ * In-Reply-To, References ヘッダを正しくパースできなかったバグを修正
78
+
79
+ == 0.4.2 2007-03-20 ==
80
+ * 添付ファイルがネストされていた場合、その次の添付ファイルを取り出せなかったバグを修正。
81
+
82
+ == 0.4.1a 2007-03-06 ==
83
+ * 64bit環境や非JST環境でもテストが通るようにテストコードを変更。
84
+
85
+ == 0.4.1 2007-03-03 ==
86
+ * ドキュメントの誤記修正。
87
+ * パース結果オブジェクトに raw メソッド追加。
88
+ * :extract_message_type を :text_body_only, :skip_body よりも優先するように変更。
89
+ * :output_charset 指定時にRFC2232形式のファイル名の charset が変換されていなかった
90
+ * Content-Type, Content-Disposition のパラメータが未知の charset でエンコーディングされていた場合に落ちていたバグを修正。
91
+
92
+ == 0.4 2007-01-16 ==
93
+ * イチから作りなおした。0.3 とは互換なし。
94
+
95
+ == 0.3.9 2006-07-10 ==
96
+ * text_body_only が true で Content-Type ヘッダがない場合に、メールの本文をないものとして扱っていたバグを修正。
97
+
98
+ == 0.3.8 2006-03-30 ==
99
+ * RFC 2231 に対応。
100
+
101
+ == 0.3.7 2006-03-11 ==
102
+ * From, To, Cc の行末が「\」の時に無限ループしていたバグを修正。
103
+
104
+ == 0.3.6 2005-10-14 ==
105
+ * phrase内に「&lt;」「&gt;」「(」「)」があった時にメールアドレスの取得に失敗するバグを修正。
106
+ * 「(」「)」「\(」「\)」が多く存在する行のパースに長時間かかるバグを修正。
107
+ * quoted-string内の「(~)」を除去してしまうバグを修正。
108
+
109
+ == 0.3.5 2005-06-08 ==
110
+ * 本文がHTMLで添付ファイルがついている場合に、添付ファイルが認識されないバグを修正。
111
+
112
+ == 0.3.4 2005-05-02 ==
113
+ * Date へッダの日付が UNIX 時刻の範囲外の時に落ちるバグを修正。
114
+
115
+ == 0.3.3 2005-03-31 ==
116
+ * output_charset に nil を指定した時にコード変換しないようにした。
117
+
118
+ == 0.3.2 2005-03-01 ==
119
+ * From,To,Ccへッダに奇数個の「"」があると無限ループになるバグを修正。
120
+
121
+ == 0.3.1 2005-02-21 ==
122
+ * extract_message_type=() を追加。
123
+
124
+ == 0.3 2005-01-28 ==
125
+ * 最初の text/* を :body にするのをやめた。
126
+ * :header を Hash に変更。
127
+ * :rawheader 追加。
128
+ * Uconv ではなく NKF を使用するようにした。
129
+
130
+ == 0.2.1 2005-01-28 ==
131
+ * 添付ファイルの Content-Type: が multipart/* の時に処理していなかったバグを修正。
132
+ * Content-Type が message/* の時、:body が nil ではなく "" になっていたバグを修正。
133
+ * 最初の行が空白で始まっていると落ちるバグを修正。
134
+
135
+ == 0.2 2005-01-06 ==
136
+ * UTF-8対応
137
+ * output_charset=(), text_body_only=() を追加
138
+ * Test::Unit を使用
139
+
140
+ == 0.1 2004/11/02 ==
141
+ * 公開
data/README.txt ADDED
@@ -0,0 +1,501 @@
1
+ = MailParser =
2
+
3
+ メールメッセージを解析する。
4
+
5
+ == 作者 ==
6
+
7
+ とみたまさひろ <tommy@tmtm.org>
8
+
9
+ == ライセンス ==
10
+
11
+ Ruby ライセンス http://www.ruby-lang.org/ja/LICENSE.txt と同等。
12
+
13
+ == 機能 ==
14
+
15
+ * メールファイルをパースした結果を返す。
16
+ * メール構造による例外は発生しない(例外を発生させることも可能)。
17
+ 不正な構造のメッセージがあった場合は適当に処理する。
18
+
19
+ * 0.4 でイチから作りなおしたので、0.3 とは互換がない。
20
+ require "mailparser/obsolete" すれば 0.3 と同じ機能が使用可能。
21
+
22
+ == ダウンロード ==
23
+
24
+ * http://github.com/tmtm/mailparser
25
+
26
+ == インストール ==
27
+
28
+ インストールには racc が必要。
29
+
30
+ {{{
31
+ $ make
32
+ $ make test
33
+ # make install
34
+ }}}
35
+
36
+ == 使用例 ==
37
+
38
+ {{{
39
+ require "mailparser"
40
+ File.open("/tmp/hoge.eml") do |f|
41
+ m = MailParser::Message.new(f, :decode_mime_header=>true)
42
+ m.from # => From ヘッダ (MailParser::RFC2822::Mailbox)
43
+ m.to # => To ヘッダ (MailParser::RFC2822::Mailbox の配列)
44
+ m.subject # => Subject 文字列 (String)
45
+ m.body # => 本文文字列 (String)
46
+ m.charset # => 本文文字コード (String)
47
+ m.part # => 添付ファイル (MailParser::Message の配列)
48
+ m.part[0].filename # => 1つめの添付ファイルのファイル名 (String)
49
+ m.part[0].body # => 1つめの添付ファイルの本文 (String)
50
+ end
51
+ }}}
52
+
53
+ == MailParser::Message ==
54
+
55
+ === self.new(io, [opt]) ===
56
+
57
+ io から MailParser::Message オブジェクトを生成する。
58
+
59
+ io には IO または StringIO オブジェクトを指定する。実際には1行毎の文
60
+ 字列を返す gets イテレータを持ち、処理した位置を覚えていて次回実
61
+ 行時に続きから実行できるオブジェクトであれば何でも良い。
62
+ String オブジェクトも指定可能。内部で StringIO が生成されて使用される。
63
+
64
+ opt は Hash オブジェクトで次の値を指定できる。
65
+
66
+ :skip_body => true
67
+ 本文をスキップする。デフォルトは false。
68
+
69
+ :text_body_only => true
70
+ text/* type 以外の本文をスキップする。デフォルトは false。
71
+
72
+ :extract_message_type => true
73
+ message/* type を展開する。デフォルトは false。
74
+
75
+ :decode_mime_header => true
76
+ MIMEヘッダをデコードする。デフォルトは false。
77
+
78
+ :decode_mime_filename => true
79
+ MIME エンコードされたファイル名をデコードする。デフォルトは false。
80
+
81
+ :output_charset => charsetname
82
+ 出力文字コード。デフォルトは nil で無変換。
83
+
84
+ :charset_converter => proc{|f,t,s| ...}
85
+ 文字コード変換時に呼び出される Proc オブジェクト。引数は、元charset,新charset,元文字列。デフォルトは MailParser::ConvCharset.conv_charset が呼ばれる。
86
+
87
+ :strict => true
88
+ RFC違反時に ParseError 例外を発生する。デフォルトは false。
89
+
90
+ :keep_raw => true
91
+ 生メッセージ文字列を保持する。デフォルトは false。
92
+
93
+ :use_file => bytes
94
+ raw が指定したサイズを超えたら、メモリではなくファイルを使う。nil 指定時は無制限にメモリを使う。デフォルトは nil。
95
+
96
+ === from ===
97
+
98
+ From ヘッダのパース結果の最初のアドレスを MailParser::Mailbox オブジェクトで返す。
99
+ {{{
100
+ m = MailParser::Message.new(StringIO.new(<<EOS))
101
+ From: TOMITA Masahiro <tommy@tmtm.org>
102
+ EOS
103
+ m.from.display_name # => "TOMITA Masahiro"
104
+ m.from.addr_spec.to_s # => "tommy@tmtm.org"
105
+ }}}
106
+
107
+ === to ===
108
+
109
+ To ヘッダのパース結果を MailParser::Mailbox オブジェクトの配列で返す。
110
+ {{{
111
+ m = MailParser::Message.new(StringIO.new(<<EOS))
112
+ To: TOMITA Masahiro <tommy@tmtm.org>, foo@example.com
113
+ EOS
114
+ m.to[0].to_s # => "TOMITA Masahiro <tommy@tmt.morg>"
115
+ m.to[1].to_s # => "<foo@example.com>"
116
+ }}}
117
+
118
+ === cc ===
119
+
120
+ Cc ヘッダのパース結果を MailParser::Mailbox オブジェクトの配列で返す。
121
+
122
+ === subject ===
123
+
124
+ Subject ヘッダの値を文字列で返す。
125
+ {{{
126
+ m = MailParser::Message.new(StringIO.new(<<EOS), :decode_mime_header=>true, :output_charset=>"utf-8")
127
+ Subject: =?iso-2022-jp?b?GyRCJEgkXyQ/JEckORsoQg==?=
128
+ EOS
129
+ m.subject # => "とみたです"
130
+ }}}
131
+
132
+ === type ===
133
+
134
+ Content-Type ヘッダのタイプを小文字の文字列で返す。
135
+ Content-Type がない場合は "text" を返す。
136
+ {{{
137
+ m = MailParser::Message.new(StringIO.new(<<EOS), :decode_mime_header=>true, :output_charset=>"utf-8")
138
+ Content-Type: Text/Plain; charset=ISO-2022-JP
139
+ EOS
140
+ m.type # => "text"
141
+ m.subtype # => "plain"
142
+ m.charset # => "iso-2022-jp"
143
+ }}}
144
+
145
+ === subtype ===
146
+
147
+ Content-Type ヘッダのサブタイプを小文字の文字列で返す。
148
+ Content-Type がない場合またはサブタイプがない場合は "plain" を返す。
149
+
150
+ === charset ===
151
+
152
+ Content-Type ヘッダの charset 属性を小文字の文字列で返す。
153
+ Content-Type がない場合または charset がない場合は nil を返す。
154
+
155
+ === multipart? ===
156
+
157
+ マルチパートメッセージの場合 true を返す。
158
+
159
+ === filename ===
160
+
161
+ ファイル名を返す。
162
+ ファイル名は、Content-Disposition ヘッダの filename 属性または Content-Type ヘッダの name 属性から取得する(Content-Disposition ヘッダが優先)。
163
+ {{{
164
+ m = MailParser::Message.new(StringIO.new(<<EOS))
165
+ Content-Disposition: attachment; filename="hogehoge.txt"
166
+ EOS
167
+ m.filename # => "hogehoge.txt"
168
+ }}}
169
+
170
+ {{{
171
+ m = MailParser::Message.new(StringIO.new(<<EOS))
172
+ Content-Disposition: attachment; filename*=utf-8''%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E5%90%8D.txt
173
+ EOS
174
+ m.filename # => "ファイル名.txt"
175
+ }}}
176
+
177
+ RFC的には正しくない(でも一般に使われている)ダブルクォートで括られてMIMEエンコードされた文字列を MIMEデコードしたい場合は、:decode_mime_filename=>true を指定する必要がある。
178
+
179
+ {{{
180
+ m = MailParser::Message.new(StringIO.new(<<EOS), :decode_mime_filename=>true)
181
+ Content-Disposition: attachment; filename="=?utf-8?b?44OV44Kh44Kk44Or5ZCNLnR4dA==?="
182
+ EOS
183
+ m.filename # => "ファイル名"
184
+ }}}
185
+
186
+ === header ===
187
+
188
+ ヘッダを表す MailParser::Header オブジェクトを返す。
189
+ MailParser::Header はハッシュのように使用できる。
190
+ キーは小文字のヘッダ名文字列で、値はヘッダオブジェクトの配列(複数存在する場合があるので配列)。
191
+ {{{
192
+ m = MailParser::Message.new(StringIO.new(<<EOS))
193
+ From: TOMITA Masahiro <tommy@tmtm.org>
194
+ To: foo@example.com
195
+ Subject: test subject
196
+ EOS
197
+ m.header["from"][0] # => MailParser::Mailbox の配列
198
+ m.header["to"][0] # => MailParser::Mailbox の配列
199
+ m.header["subject"][0] # => String
200
+ }}}
201
+
202
+ ヘッダとパース結果のクラスの対応は次の通り。
203
+
204
+ || Date || MailParser::DateTime
205
+ || From || MailParser::Mailbox の配列
206
+ || Sender || MailParser::Mailbox
207
+ || Reply-To || MailParser::Mailbox または MailParser::Group の配列
208
+ || To || MailParser::Mailbox または MailParser::Group の配列
209
+ || Cc || MailParser::Mailbox または MailParser::Group の配列
210
+ || Bcc || MailParser::Mailbox または MailParser::Group の配列
211
+ || Message-Id || MailParser::MsgId
212
+ || In-Reply-To || 文字列または MailParser::MsgId の配列
213
+ || References || 文字列または MailParser::MsgId の配列
214
+ || Keywords || 文字列の配列
215
+ || Resent-Date || MailParser::DateTime
216
+ || Resent-From || MailParser::Mailbox の配列
217
+ || Resent-To || MailParser::Mailbox または MailParser::Group の配列
218
+ || Resent-Cc || MailParser::Mailbox または MailParser::Group の配列
219
+ || Resent-Bcc || MailParser::Mailbox または MailParser::Group の配列
220
+ || Resent-Message-Id || MailParser::MsgId
221
+ || Return-Path || MailParser::Mailbox または nil (<> の場合)
222
+ || Received || MailParser::Received
223
+ || Content-Type || MailParser::ContentType
224
+ || Content-Transfer-Encoding || MailParser::ContentTransferEncoding
225
+ || Content-Id || MailParser::MsgId
226
+ || Mime-Version || 文字列
227
+ || Content-Disposition || MailParser::ContentDisposition
228
+
229
+ === body ===
230
+
231
+ 本文文字列を返す。
232
+ {{{
233
+ m = MailParser::Message.new(StringIO.new(<<EOS))
234
+ From: TOMITA Masahiro <tommy@tmtm.org>
235
+ Content-Type: text/plain; charset=utf-8
236
+
237
+ これは本文です。
238
+ EOS
239
+ m.body # => "これは本文です。\n"
240
+ }}}
241
+
242
+ === body_preconv ===
243
+
244
+ 本文の charset変換前文字列を返す。
245
+ {{{
246
+ m = MailParser::Message.new(<<EOS)
247
+ From: TOMITA Masahiro <tommy@tmtm.org>
248
+ Content-Type: text/plain; charset=iso-2022-jp
249
+
250
+ \e$B$3$l$OK\\J8$G$9\e(B
251
+ EOS
252
+ m.body # => "これは本文です\n"
253
+ m.body_preconv # => "\e$B$3$l$OK\\J8$G$9\e(B\n"
254
+ }}}
255
+
256
+ === part ===
257
+
258
+ マルチパートメッセージの場合、各パートを表す MailParser::Message オブジェクトの配列を返す。
259
+ マルチパートメッセージでない場合は空配列を返す。
260
+ {{{
261
+ m = MailParser::Message.new(StringIO.new(<<EOS, :output_charset=>"utf8"))
262
+ Content-Type: multipart/mixed; boundary="abcdefg"
263
+
264
+ --abcdefg
265
+ Content-Type: text/plain
266
+
267
+ first part.
268
+ --abcdefg
269
+ Content-Type: text/plain
270
+
271
+ second part.
272
+ --abcdefg--
273
+ EOS
274
+ m.part.size # => 2
275
+ m.part[0] # => 最初のパートの MailParser::Message オブジェクト
276
+ m.part[1] # => 2番目のパートの MailParser::Message オブジェクト
277
+ }}}
278
+
279
+ === message ===
280
+
281
+ :extract_message_type=>true で message タイプのメッセージの場合、本文が示すメッセージの Mailparser::Message オブジェクトを返す。
282
+ :extract_message_type=>false または message タイプでない場合は nil を返す。
283
+ {{{
284
+ m = MailParser::Message.new(StringIO.new(<<EOS), :extract_message_type=>true)
285
+ Content-Type: message/rfc822
286
+
287
+ Subject: message subject
288
+
289
+ message body
290
+ EOS
291
+ m.message.subject # => "message subject"
292
+ }}}
293
+
294
+ === rawheader ===
295
+
296
+ ヘッダ部文字列をパースせずにそのまま返す。
297
+ {{{
298
+ m = MailParser::Message.new(StringIO.new(<<EOS))
299
+ From: TOMITA Masahiro <tommy@tmtm.org>
300
+ To: foo@example.com
301
+ Subject: subject
302
+
303
+ body message
304
+ EOS
305
+ m.rawheader # => "From: TOMITA Masahiro <tommy@tmtm.org>\nTo: foo@example.com\nSubject: subject\n"
306
+ }}}
307
+
308
+ === raw ===
309
+
310
+ 生メッセージ文字列を返す。:keep_raw=>true である必要がある。
311
+ :keep_raw=>false の場合は空文字列が返る。
312
+ {{{
313
+ m = MailParser::Message.new(StringIO.new(<<EOS), :keep_raw=>true)
314
+ From: TOMITA Masahiro <tommy@tmtm.org>
315
+ To: foo@example.com
316
+ Subject: subject
317
+
318
+ body message
319
+ EOS
320
+ m.rawheader # => "From: TOMITA Masahiro <tommy@tmtm.org>\nTo: foo@example.com\nSubject: subject\n"
321
+ }}}
322
+
323
+ == MailParser::Header ==
324
+
325
+ 同じ名前を持つヘッダを表すクラス。
326
+
327
+ === add(name, body) ===
328
+ name ヘッダの値として body を追加する。
329
+
330
+ === [](name) ===
331
+ name ヘッダの値をパースした結果オブジェクトの配列を返す。
332
+ パース結果オブジェクトは raw メソッドを持ち、パース前文字列を取り出すことができる。
333
+
334
+ === raw(name) ===
335
+ name ヘッダの値のパース前の文字列の配列を返す。
336
+
337
+ === keys ===
338
+ ヘッダ名文字列の一覧を返す。
339
+
340
+ === key?(name) ===
341
+ name ヘッダがあれば真。
342
+
343
+ === each {|n,v| } ===
344
+ 各ヘッダについてブロックを繰り返す。
345
+ ブロック引数は、1番目がヘッダ名文字列、2番目がパース結果オブジェクトの配列。
346
+
347
+ == MailParser::DateTime ==
348
+
349
+ Date ヘッダを表すクラス。
350
+
351
+ === year ===
352
+
353
+ 年を表す整数。
354
+
355
+ === month ===
356
+
357
+ 月を表す整数。
358
+
359
+ === day ===
360
+
361
+ 日を表す整数。
362
+
363
+ === hour ===
364
+
365
+ 時を表す整数。
366
+
367
+ === min ===
368
+
369
+ 分を表す整数。
370
+
371
+ === sec ===
372
+
373
+ 秒を表す整数。
374
+
375
+ === zone ===
376
+
377
+ タイムゾーンを表す文字列。「+9999」または「-9999」の形式。
378
+
379
+ === time ===
380
+
381
+ Time オブジェクトを返す。範囲外の日付の場合は :strict が false でも ArgumentError 例外が発生するので注意。
382
+
383
+ == MailParser::Mailbox ==
384
+
385
+ メールアドレスを表すクラス。
386
+
387
+ === addr_spec ===
388
+
389
+ メールアドレスを表す MailParser::AddrSpec を返す。
390
+
391
+ === local_part ===
392
+
393
+ ローカルパートを表す文字列。
394
+ MailParser::Mailbox#addr_spec.local_part と同じ。
395
+
396
+ === domain ===
397
+
398
+ ドメインを表す文字列。
399
+ addr_spec.domain と同じ。
400
+
401
+ === display_name ===
402
+
403
+ 表示名を表す文字列。
404
+
405
+ === phrase ===
406
+
407
+ display_name と同じ。
408
+
409
+ == MailParser::Group ==
410
+
411
+ グループアドレスを表すクラス。
412
+
413
+ === mailbox_list ===
414
+
415
+ MailParser::Mailbox の配列。
416
+
417
+ === display_name ===
418
+
419
+ 表示名を表す文字列。
420
+
421
+ === phrase ===
422
+
423
+ display_name と同じ。
424
+
425
+ == MailParser::MsgId ==
426
+
427
+ === msg_id ===
428
+
429
+ メッセージID文字列。先頭と末尾の < > は含まない。
430
+
431
+ == MailParser::Received ==
432
+
433
+ Received ヘッダを表すクラス。
434
+
435
+ === name_val ===
436
+
437
+ Received ヘッダ中の名前(小文字の文字列)と値(文字列)の組を表す Hash を返す。
438
+ {{{
439
+ m = MailParser::Message.new(StringIO.new(<<EOS))
440
+ Received: from mx1.tmtm.org (localhost [127.0.0.1])
441
+ by mx2.tmtm.org (Postfix) with ESMTP id 3ED69108383
442
+ for <tommy@tmtm.org>; Tue, 16 Jan 2007 14:20:23 +0900 (JST)
443
+ EOS
444
+ r = m.header["received"][0]
445
+ r.name_val["from"] # => "mx1.tmtm.org"
446
+ r.name_val["by"] # => "mx2.tmtm.org"
447
+ r.name_val["with"] # => "ESMTP"
448
+ r.name_val["for"] # => "tommy@tmtm.org"
449
+ }}}
450
+
451
+ === date_time ===
452
+
453
+ Received ヘッダ中の日時を表す MailParser::DateTime オブジェクトを返す。
454
+
455
+ == MailParser::ContentType ==
456
+
457
+ Content-Type ヘッダのパラメータを表すクラス。
458
+
459
+ === type ===
460
+
461
+ Content-Type ヘッダのタイプを表す小文字の文字列を返す。
462
+
463
+ === subtype ===
464
+
465
+ Content-Type ヘッダのサブタイプを表す小文字の文字列を返す。
466
+
467
+ === params ===
468
+
469
+ Content-Type ヘッダのパラメータを表す Hash を返す。
470
+ Hash のキーは小文字の文字列。値は文字列。
471
+
472
+ == MailParser::ContentTransferEncoding ==
473
+
474
+ Content-Transfer-Encoding ヘッダを表すクラス。
475
+
476
+ === mechanism ===
477
+
478
+ Content-Transfer-Encoding ヘッダの値を小文字の文字列で返す。
479
+
480
+ == MailParser::ContentDisposition ==
481
+
482
+ === type ===
483
+
484
+ Content-Disposition ヘッダのタイプを表す小文字の文字列を返す。
485
+
486
+ === params ===
487
+
488
+ Content-Disposition ヘッダのパラメータを表す Hash を返す。
489
+ Hash のキーは小文字の文字列。値は文字列。
490
+
491
+ == MailParser::AddrSpec ==
492
+
493
+ メールアドレスを表すクラス。
494
+
495
+ === local_part ===
496
+
497
+ メールアドレスのローカルパート文字列を返す。
498
+
499
+ === domain ===
500
+
501
+ メールアドレスのドメイン部文字列を返す。