tmail 1.2.3.1 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. data/README +10 -0
  2. data/ext/tmailscanner/tmail/tmailscanner.c +39 -8
  3. data/lib/tmail.rb +1 -0
  4. data/lib/tmail/address.rb +6 -40
  5. data/lib/tmail/attachments.rb +41 -22
  6. data/lib/tmail/encode.rb +9 -0
  7. data/lib/tmail/header.rb +5 -3
  8. data/lib/tmail/interface.rb +40 -3
  9. data/lib/tmail/mail.rb +3 -3
  10. data/lib/tmail/mailbox.rb +3 -2
  11. data/lib/tmail/net.rb +3 -1
  12. data/lib/tmail/parser.rb +204 -620
  13. data/lib/tmail/parser.y +38 -3
  14. data/lib/tmail/quoting.rb +38 -1
  15. data/lib/tmail/utils.rb +28 -4
  16. data/lib/tmail/vendor/rchardet-1.3/COPYING +504 -0
  17. data/lib/tmail/vendor/rchardet-1.3/README +12 -0
  18. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet.rb +67 -0
  19. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/big5freq.rb +927 -0
  20. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/big5prober.rb +42 -0
  21. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb +237 -0
  22. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/charsetgroupprober.rb +112 -0
  23. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/charsetprober.rb +75 -0
  24. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/codingstatemachine.rb +64 -0
  25. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/constants.rb +42 -0
  26. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb +90 -0
  27. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/escsm.rb +244 -0
  28. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/eucjpprober.rb +88 -0
  29. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euckrfreq.rb +596 -0
  30. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euckrprober.rb +42 -0
  31. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euctwfreq.rb +430 -0
  32. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euctwprober.rb +42 -0
  33. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312freq.rb +474 -0
  34. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312prober.rb +42 -0
  35. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/hebrewprober.rb +289 -0
  36. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/jisfreq.rb +570 -0
  37. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/jpcntx.rb +229 -0
  38. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langbulgarianmodel.rb +229 -0
  39. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langcyrillicmodel.rb +330 -0
  40. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langgreekmodel.rb +227 -0
  41. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langhebrewmodel.rb +202 -0
  42. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langhungarianmodel.rb +226 -0
  43. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langthaimodel.rb +201 -0
  44. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/latin1prober.rb +147 -0
  45. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/mbcharsetprober.rb +89 -0
  46. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/mbcsgroupprober.rb +47 -0
  47. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/mbcssm.rb +542 -0
  48. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/sbcharsetprober.rb +124 -0
  49. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/sbcsgroupprober.rb +58 -0
  50. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/sjisprober.rb +88 -0
  51. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/universaldetector.rb +166 -0
  52. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/utf8prober.rb +87 -0
  53. data/lib/tmail/version.rb +1 -1
  54. data/setup.rb +2 -2
  55. data/test/fixtures/apple_unquoted_content_type +44 -0
  56. data/test/fixtures/inline_attachment.txt +2095 -0
  57. data/test/fixtures/iso_8859_1_email_without_encoding_and_message_id.txt +16 -0
  58. data/test/fixtures/mailbox.zip +0 -0
  59. data/test/fixtures/marked_as_iso_8859_1_but_it_is_utf_8.txt +33 -0
  60. data/test/fixtures/marked_as_utf_8_but_it_is_iso_8859_1.txt +56 -0
  61. data/test/fixtures/raw_email_bad_time +62 -0
  62. data/test/fixtures/raw_email_double_at_in_header +14 -0
  63. data/test/fixtures/raw_email_only_attachment +17 -0
  64. data/test/fixtures/raw_email_string_in_date_field +17 -0
  65. data/test/fixtures/raw_email_trailing_dot +21 -0
  66. data/test/fixtures/raw_email_with_quoted_attachment_filename +60 -0
  67. data/test/fixtures/raw_email_with_wrong_splitted_multibyte_encoded_word_subject +15 -0
  68. data/test/fixtures/the_only_part_is_a_word_document.txt +425 -0
  69. data/test/fixtures/unquoted_filename_in_attachment +177 -0
  70. data/test/test_address.rb +114 -92
  71. data/test/test_attachments.rb +84 -1
  72. data/test/test_encode.rb +54 -0
  73. data/test/test_header.rb +60 -2
  74. data/test/test_mail.rb +22 -15
  75. data/test/test_mbox.rb +12 -3
  76. data/test/test_port.rb +13 -9
  77. data/test/test_quote.rb +9 -0
  78. data/tmail.gemspec +34 -0
  79. metadata +68 -167
  80. data/MANIFEST +0 -191
  81. data/log/BugTrackingLog.txt +0 -1231
  82. data/log/Changelog.txt +0 -534
  83. data/log/Fixme.txt +0 -6
  84. data/log/Testlog.txt +0 -2340
  85. data/log/Todo.txt +0 -30
  86. data/log/fixme.rdoc +0 -6
  87. data/meta/MANIFEST +0 -128
  88. data/meta/VERSION +0 -1
  89. data/meta/project.yaml +0 -30
  90. data/meta/unixname +0 -1
  91. data/sample/bench_base64.rb +0 -48
  92. data/sample/data/multipart +0 -23
  93. data/sample/data/normal +0 -29
  94. data/sample/data/sendtest +0 -5
  95. data/sample/data/simple +0 -14
  96. data/sample/data/test +0 -27
  97. data/sample/extract-attachements.rb +0 -33
  98. data/sample/from-check.rb +0 -26
  99. data/sample/multipart.rb +0 -26
  100. data/sample/parse-bench.rb +0 -68
  101. data/sample/parse-test.rb +0 -19
  102. data/sample/sendmail.rb +0 -94
  103. data/site/contributing/index.html +0 -183
  104. data/site/css/clean.css +0 -27
  105. data/site/css/layout.css +0 -31
  106. data/site/css/style.css +0 -60
  107. data/site/download/index.html +0 -61
  108. data/site/img/envelope.jpg +0 -0
  109. data/site/img/mailman.gif +0 -0
  110. data/site/img/stamp-sm.jpg +0 -0
  111. data/site/img/stamp.jpg +0 -0
  112. data/site/img/stampborder.jpg +0 -0
  113. data/site/img/tfire.jpg +0 -0
  114. data/site/img/tmail.png +0 -0
  115. data/site/index.html +0 -270
  116. data/site/js/jquery.js +0 -31
  117. data/site/log/Changelog.xsl +0 -33
  118. data/site/log/changelog.xml +0 -1677
  119. data/site/outdated/BUGS +0 -3
  120. data/site/outdated/DEPENDS +0 -1
  121. data/site/outdated/Incompatibilities +0 -89
  122. data/site/outdated/Incompatibilities.ja +0 -102
  123. data/site/outdated/NEWS +0 -9
  124. data/site/outdated/README.ja +0 -73
  125. data/site/outdated/doc.ja/address.html +0 -275
  126. data/site/outdated/doc.ja/basics.html +0 -405
  127. data/site/outdated/doc.ja/config.html +0 -49
  128. data/site/outdated/doc.ja/details.html +0 -146
  129. data/site/outdated/doc.ja/index.html +0 -39
  130. data/site/outdated/doc.ja/mail.html +0 -793
  131. data/site/outdated/doc.ja/mailbox.html +0 -265
  132. data/site/outdated/doc.ja/port.html +0 -95
  133. data/site/outdated/doc.ja/tmail.html +0 -58
  134. data/site/outdated/doc.ja/usage.html +0 -202
  135. data/site/outdated/rdd/address.rrd.m +0 -229
  136. data/site/outdated/rdd/basics.rd.m +0 -275
  137. data/site/outdated/rdd/config.rrd.m +0 -26
  138. data/site/outdated/rdd/details.rd.m +0 -117
  139. data/site/outdated/rdd/index.rhtml.m +0 -54
  140. data/site/outdated/rdd/mail.rrd.m +0 -701
  141. data/site/outdated/rdd/mailbox.rrd.m +0 -228
  142. data/site/outdated/rdd/port.rrd.m +0 -69
  143. data/site/outdated/rdd/tmail.rrd.m +0 -33
  144. data/site/outdated/rdd/usage.rd.m +0 -247
  145. data/site/quickstart/index.html +0 -69
  146. data/site/quickstart/quickstart.html +0 -52
  147. data/site/quickstart/usage.html +0 -193
  148. data/site/reference/address.html +0 -247
  149. data/site/reference/config.html +0 -30
  150. data/site/reference/index.html +0 -101
  151. data/site/reference/mail.html +0 -726
  152. data/site/reference/mailbox.html +0 -245
  153. data/site/reference/port.html +0 -75
  154. data/site/reference/tmail.html +0 -35
  155. data/work/script/make +0 -26
  156. data/work/script/rdoc +0 -39
  157. data/work/script/setup +0 -1616
  158. data/work/script/test +0 -30
@@ -1,30 +0,0 @@
1
- == TODO List
2
-
3
- * NORUBYEXT should probbly be renamed to TMAIL_NORUBYEXT or something to that effect.
4
-
5
- This is the original list left over from the 2004 version.
6
-
7
- Please refer to the website (http://tmail.rubyforge.org/) for the current TODO list.
8
-
9
- * RFC2231 decode
10
- * delete File*Stream
11
- * simplify field.rb
12
- * allow raw JIS string in quoted word
13
- * unify character encoding of japanese strings in header
14
- * Loader -> Mailbox
15
- * RFC2231 encode
16
- * allow illegal MIME param value encoding (key="=?iso-2022-jp?B?....")
17
- * purpose-oriented policy switching
18
- * rewrite samples.
19
- * address/address-group common handling scheme
20
- * correct handling of Content-Type: message/*
21
- * methods for mail creation, replying, forwarding
22
- * tmail/net
23
- * mail thread generator
24
-
25
- === Bugs
26
-
27
- * mails may be deleted if other precesses are touching mailbox.
28
- * mails may be corrupted if other precesses are touching mailbox.
29
- * not thread safe
30
-
@@ -1,6 +0,0 @@
1
-
2
- = FIXME
3
-
4
- == file://lib/tmail/encode.rb
5
- * FIXME: This class can handle only (euc-jp/shift_jis -> iso-2022-jp). (198)
6
- * FIXME: implement line folding (317)
@@ -1,128 +0,0 @@
1
- # -x doc -x pkg -x log
2
- CHANGES
3
- LICENSE
4
- NOTES
5
- README
6
- ext
7
- ext/Makefile
8
- ext/tmailscanner
9
- ext/tmailscanner/tmail
10
- ext/tmailscanner/tmail/MANIFEST
11
- ext/tmailscanner/tmail/depend
12
- ext/tmailscanner/tmail/extconf.rb
13
- ext/tmailscanner/tmail/tmailscanner.c
14
- lib
15
- lib/tmail
16
- lib/tmail/Makefile
17
- lib/tmail/address.rb
18
- lib/tmail/attachments.rb
19
- lib/tmail/base64.rb
20
- lib/tmail/compat.rb
21
- lib/tmail/config.rb
22
- lib/tmail/core_extensions.rb
23
- lib/tmail/encode.rb
24
- lib/tmail/header.rb
25
- lib/tmail/index.rb
26
- lib/tmail/interface.rb
27
- lib/tmail/loader.rb
28
- lib/tmail/mail.rb
29
- lib/tmail/mailbox.rb
30
- lib/tmail/main.rb
31
- lib/tmail/mbox.rb
32
- lib/tmail/net.rb
33
- lib/tmail/obsolete.rb
34
- lib/tmail/parser.rb
35
- lib/tmail/parser.y
36
- lib/tmail/port.rb
37
- lib/tmail/quoting.rb
38
- lib/tmail/require_arch.rb
39
- lib/tmail/scanner.rb
40
- lib/tmail/scanner_r.rb
41
- lib/tmail/stringio.rb
42
- lib/tmail/utils.rb
43
- lib/tmail/version.rb
44
- lib/tmail.rb
45
- meta
46
- meta/MANIFEST
47
- meta/config.yaml
48
- meta/icli.yaml
49
- meta/project.yaml
50
- meta/tmail.roll
51
- sample
52
- sample/bench_base64.rb
53
- sample/data
54
- sample/data/multipart
55
- sample/data/normal
56
- sample/data/sendtest
57
- sample/data/simple
58
- sample/data/test
59
- sample/extract-attachements.rb
60
- sample/from-check.rb
61
- sample/multipart.rb
62
- sample/parse-bench.rb
63
- sample/parse-test.rb
64
- sample/sendmail.rb
65
- script
66
- script/changelog
67
- script/clobber
68
- script/clobber/distclean
69
- script/clobber/package
70
- script/compile
71
- script/pack
72
- script/pack/gem
73
- script/pack/tgz
74
- script/pack/zip
75
- script/prepare
76
- script/publish
77
- script/rdoc
78
- script/release
79
- script/setup
80
- script/stamp
81
- script/stats
82
- script/tag
83
- script/test
84
- test
85
- test/extctrl.rb
86
- test/fixtures
87
- test/fixtures/mailbox
88
- test/fixtures/mailbox_without_any_from_or_sender
89
- test/fixtures/mailbox_without_from
90
- test/fixtures/mailbox_without_return_path
91
- test/fixtures/raw_base64_decoded_string
92
- test/fixtures/raw_base64_email
93
- test/fixtures/raw_base64_encoded_string
94
- test/fixtures/raw_email
95
- test/fixtures/raw_email10
96
- test/fixtures/raw_email11
97
- test/fixtures/raw_email12
98
- test/fixtures/raw_email13
99
- test/fixtures/raw_email2
100
- test/fixtures/raw_email3
101
- test/fixtures/raw_email4
102
- test/fixtures/raw_email5
103
- test/fixtures/raw_email6
104
- test/fixtures/raw_email7
105
- test/fixtures/raw_email8
106
- test/fixtures/raw_email9
107
- test/fixtures/raw_email_quoted_with_0d0a
108
- test/fixtures/raw_email_reply
109
- test/fixtures/raw_email_simple
110
- test/fixtures/raw_email_with_bad_date
111
- test/fixtures/raw_email_with_illegal_boundary
112
- test/fixtures/raw_email_with_multipart_mixed_quoted_boundary
113
- test/fixtures/raw_email_with_nested_attachment
114
- test/fixtures/raw_email_with_partially_quoted_subject
115
- test/fixtures/raw_email_with_quoted_illegal_boundary
116
- test/kcode.rb
117
- test/test_address.rb
118
- test/test_attachments.rb
119
- test/test_base64.rb
120
- test/test_encode.rb
121
- test/test_header.rb
122
- test/test_helper.rb
123
- test/test_mail.rb
124
- test/test_mbox.rb
125
- test/test_port.rb
126
- test/test_quote.rb
127
- test/test_scanner.rb
128
- test/test_utils.rb
@@ -1 +0,0 @@
1
- 1.2.3.1 stable (2008-04-11)
@@ -1,30 +0,0 @@
1
- ---
2
- project : tmail
3
- version : 1.2.3.1
4
- status : production
5
- title : TMail
6
- brief : Ruby Mail Handler
7
- contact : Mikel Lindsaar <raasdnil AT gmail.com>
8
- email : tmail-talk@rubyforge.org
9
- homepage: http://tmail.rubyforge.org
10
- authors :
11
- - Minero Aoki
12
- - Mikel Lindsaar
13
-
14
- description:
15
- TMail is a Ruby-based mail handler. It allows you
16
- to compose stadards compliant emails in a
17
- very Ruby-way.
18
-
19
- loadpath:
20
- - lib
21
- - ext/tmailscanner
22
-
23
- exclude: [doc,work]
24
-
25
- hosts:
26
- rubyforge:
27
- type: rubyforge
28
- rubytalk:
29
- type: rubytalk
30
-
@@ -1 +0,0 @@
1
- tmail
@@ -1,48 +0,0 @@
1
- # base64 benchmark
2
- #
3
- # pass 'c' as first argument to bench c lib.
4
-
5
- require 'benchmark'
6
-
7
- module TMail
8
- module Base64
9
- end
10
- end
11
-
12
- $lib = ARGV[0]
13
- $count = 10000
14
- $size = 5000
15
-
16
- def make_random_string(len)
17
- buf = ''
18
- len.times do
19
- buf << rand(255)
20
- end
21
- buf
22
- end
23
-
24
- def encode_and_decode(orig)
25
- #ok = [orig].pack('m').delete("\r\n")
26
- end
27
-
28
- if $lib == "c"
29
- $lib = " c"
30
- require 'ext/base64_c/tmail/base64_c.bundle'
31
- else
32
- $lib = "ruby"
33
- require 'lib/tmail/base64_r.rb'
34
- end
35
-
36
- def benchmark!
37
- Benchmark.bm do |x|
38
- x.report("#{$lib} #{$count.to_s}/#{$size}: ") do
39
- $count.times do
40
- orig = make_random_string($size)
41
- result = TMail::Base64.encode(orig)
42
- TMail::Base64.decode(result)
43
- end
44
- end
45
- end
46
- end
47
-
48
- benchmark!
@@ -1,23 +0,0 @@
1
- Date: Tue, 26 Jan 1999 23:17:34 +0900
2
- From: aamine@dp.u-netsurf.ne.jp
3
- To: ruby-list@netlab.co.jp
4
- Mime-Version: 1.0
5
- Content-Type: multipart/mixed;
6
- boundary="Multipart_Tue_Jan_26_23:14:41_1999-1"
7
- Content-Transfer-Encoding: 7bit
8
-
9
- this is preamble
10
-
11
- --Multipart_Tue_Jan_26_23:14:41_1999-1
12
- Content-Type: text/plain; charset=iso-2022-jp
13
-
14
- this is multi part body 1
15
-
16
- --Multipart_Tue_Jan_26_23:14:41_1999-1
17
- Content-Type: text/plain; charset=iso-2022-jp
18
-
19
- multi part body, 2
20
-
21
- --Multipart_Tue_Jan_26_23:14:41_1999-1--
22
-
23
- epilogue
@@ -1,29 +0,0 @@
1
- Received: from hoyogw.netlab.co.jp (daemon@hoyogw.netlab.co.jp [202.218.249.220])
2
- by serv1.u-netsurf.ne.jp (8.8.8/3.6W-2.66(99/03/09)) with ESMTP id RAA10692
3
- for <aamine@dp.u-netsurf.ne.jp>; Thu, 18 Mar 1999 17:35:23 +0900 (JST)
4
- Received: from hoyogw.netlab.co.jp (matz@localhost [127.0.0.1])
5
- by hoyogw.netlab.co.jp (8.9.1a+3.1W/3.7W/1.3) with SMTP id RAA13204;
6
- Thu, 18 Mar 1999 17:21:58 +0900
7
- Received: from blade.nagaokaut.ac.jp (sinara@blade.nagaokaut.ac.jp [133.44.36.60])
8
- by hoyogw.netlab.co.jp (8.9.1a+3.1W/3.7W/1.3) with ESMTP id RAA13036
9
- for <ruby-list@netlab.co.jp>; Thu, 18 Mar 1999 17:20:28 +0900
10
- Received: (from sinara@localhost)
11
- by blade.nagaokaut.ac.jp (8.8.8/8.8.8/Debian/GNU) id RAA22078;
12
- Thu, 18 Mar 1999 17:20:49 +0900
13
- Posted: Thu, 18 Mar 1999 17:20:49 +0900
14
- Reply-To: ruby-list@netlab.co.jp
15
- Subject: [ruby-list:12994] Re: Sieve of Eratosthenes (Re: [ruby-dev:6094])
16
- Message-Id: <199903180820.RAA22078@blade.nagaokaut.ac.jp>
17
- In-Reply-To: message of "Wed, 17 Mar 1999 18:42:07 +0900"
18
- <199903170941.SAA12014@blade.nagaokaut.ac.jp>
19
- Mime-Version: 1.0
20
- Content-Type: text/plain; charset = iso-2022-jp
21
- Content-Transfer-Encoding: 7bit
22
- Date: Thu, 18 Mar 1999 17:21:54 +0900
23
- To: ruby-list@netlab.co.jp (ruby mailing list)
24
- From: (this is comment) local@dom1.dom2
25
- Subject: this is a test subject
26
-
27
- line 1
28
- line 2
29
- line 3
@@ -1,5 +0,0 @@
1
- To: Minero Aoki <aamine@harmony.softica.or.jp>
2
- From: Minero Aoki <aamine@harmony.softica.or.jp>
3
- Subject: Sendmail test by tmail
4
-
5
- This is mail sent by tmail.
@@ -1,14 +0,0 @@
1
- To: これはデコード済 <aamine@dp.u-netsurf.ne.jp>
2
- From: =?iso-2022-jp?B?GyRCJDMkbCRPJSglcyUzITwlSSQ1JGwkRiQkJD8bKEI=?=
3
- <myself@softica.or.jp>
4
- Received: from fromdom.fromdom by bydom.bydom
5
- via VIAPATH with SMTP id <msgid@tmail> for addr@spec
6
- ; 23 Mar 1999 22:05:33 +0900
7
- Mime-Version: 1.0
8
- Content-Type: text/plain; charset=iso-2022-jp
9
- Content-Transfer-Encoding: 7bit
10
- Subject: this is a test subject
11
-
12
- body line 1
13
- body line 2
14
- body line 3
@@ -1,27 +0,0 @@
1
- Received: from hoyogw.netlab.co.jp (matz@localhost [127.0.0.1])
2
- by hoyogw.netlab.co.jp (8.9.1a+3.1W/3.7W/1.3)
3
- with SMTP id RAA13204;
4
- Thu, 18 Mar 1999 17:21:58 +0900
5
- Received: from fromdom.fromdom by bydom.bydom
6
- via VIAPATH with SMTP id <msgid@tmail> for addr@spec;
7
- 23 Mar 1999 22:05:33 +0900
8
- Date: Thu, 18 Mar 1999 17:21:54 +0900
9
- To: ����ϥǥ����ɺ� <"aamine@"@dp.u-netsurf.ne.jp> (Minero Aoki)
10
- Cc:
11
- Bcc: =?iso-2022-jp?B?GyRCJDMkbCRPJUclMyE8JUk6URsoQg==?=
12
- =?iso-2022-jp?B?PGFhbWluZUBkcC51LW5ldHN1cmYubmUuanA+?=
13
- From: =?iso-2022-jp?B?GyRCJDMkbCRPJSglcyUzITwlSSQ1JGwkRiQkJD8bKEI=?=
14
- (From comment) (comment2) <myself@softica.or.jp>
15
- Posted: Thu, 18 Mar 1999 17:20:49 +0900
16
- Reply-To: ruby-list@netlab.co.jp
17
- Subject: [ruby-list:12994] Re: Sieve of Eratosthenes
18
- Message-Id: <199903180820.RAA22078@blade.nagaokaut.ac.jp>
19
- In-Reply-To: "Wed, 17 Mar 1999 18:42:07 +0900"
20
- <199903170941.SAA12014@blade.nagaokaut.ac.jp>
21
- Mime-Version: 1.0
22
- Content-Type: text/plain; charset=iso-2022-jp
23
- Content-Transfer-Encoding: 7bit
24
-
25
- line 1
26
- line 2
27
- line 3
@@ -1,33 +0,0 @@
1
- #
2
- # extract-attachments.rb -- Extracts attachment(s) from the message.
3
- #
4
- # Usage: ruby extract-attachments.rb mail mail...
5
- #
6
-
7
- require 'tmail'
8
-
9
- def main
10
- idx = 1
11
- ARGV.each do |fname|
12
- TMail::Mail.load(fname).parts.each do |m|
13
- m.base64_decode
14
- File.open("#{idx}.#{ext(m)}", 'w') {|f|
15
- f.write m.body
16
- }
17
- idx += 1
18
- end
19
- end
20
- end
21
-
22
- CTYPE_TO_EXT = {
23
- 'image/jpeg' => 'jpeg',
24
- 'image/gif' => 'gif',
25
- 'image/png' => 'png',
26
- 'image/tiff' => 'tiff'
27
- }
28
-
29
- def ext( mail )
30
- CTYPE_TO_EXT[mail.content_type] || 'txt'
31
- end
32
-
33
- main
@@ -1,26 +0,0 @@
1
- #
2
- # checking mail From: header
3
- #
4
-
5
- require 'tmail'
6
-
7
- unless ARGV[0] then
8
- $stderr.puts "usage: ruby fromcheck.rb <mhdir>"
9
- exit 1
10
- end
11
-
12
- table = {} # from-addr-spec => [count, friendly-from]
13
- ld = TMail::MhLoader.new( ARGV[0] )
14
- ld.each_port do |port|
15
- mail = TMail::Mail.new( port )
16
- addr, = mail.from_addrs
17
- if addr then
18
- (table[addr.spec] ||= [0, mail.friendly_from])[0] += 1
19
- end
20
- end
21
-
22
- table.to_a.sort {|a,b|
23
- b[1][0] <=> a[1][0]
24
- }.each_with_index do |(spec,(n,from)), i|
25
- printf "%3d %-33s %d\n", i+1, from, n
26
- end
@@ -1,26 +0,0 @@
1
- #
2
- # MIME multipart parsing test
3
- #
4
-
5
- require 'tmail'
6
-
7
- mail = TMail::Mail.load( ARGV[0] || 'data/multipart' )
8
-
9
- puts '========= preamble =============='
10
- puts mail.body
11
- puts
12
-
13
- puts '========== parts ================'
14
- mail.parts.each_with_index do |i,idx|
15
- puts "<#{idx+1}>"
16
- puts i
17
- puts
18
- end
19
-
20
- puts '========= epilogue =============='
21
- puts mail.epilogue
22
- puts
23
-
24
- puts "========= re-struct ============="
25
- puts mail.decoded
26
- puts