tmail 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/CHANGES +5 -0
  2. data/NOTES +84 -0
  3. data/README +6 -1
  4. data/ext/Makefile +20 -0
  5. data/ext/{tmail/base64 → mailscanner/tmail}/MANIFEST +1 -1
  6. data/ext/mailscanner/tmail/depend +1 -0
  7. data/ext/mailscanner/tmail/extconf.rb +24 -0
  8. data/ext/{tmail/scanner_c/scanner_c.c → mailscanner/tmail/mailscanner.c} +8 -7
  9. data/lib/tmail/base64.rb +29 -52
  10. data/lib/tmail/encode.rb +37 -38
  11. data/lib/tmail/interface.rb +632 -49
  12. data/lib/tmail/main.rb +4 -0
  13. data/lib/tmail/net.rb +0 -35
  14. data/lib/tmail/quoting.rb +8 -8
  15. data/lib/tmail/scanner.rb +10 -6
  16. data/lib/tmail/scanner_r.rb +3 -5
  17. data/lib/tmail/version.rb +2 -2
  18. data/log/ChangeLog.txt +1131 -0
  19. data/log/History.txt +40 -0
  20. data/log/Todo.txt +32 -0
  21. data/meta/MANIFEST +118 -0
  22. data/meta/ROLLRC +3 -0
  23. data/meta/icli.yaml +2 -2
  24. data/meta/{tmail-1.1.1.roll → project.yaml} +3 -7
  25. data/sample/bench_base64.rb +48 -0
  26. data/{bat → script}/changelog +0 -0
  27. data/script/clobber/distclean +8 -0
  28. data/{bat → script}/clobber/package +0 -0
  29. data/script/compile +32 -0
  30. data/{bat → script}/config.yaml +2 -2
  31. data/{bat → script}/prepare +4 -2
  32. data/{bat → script}/publish +0 -0
  33. data/{bat → script}/release +0 -0
  34. data/{bat → script}/setup +0 -0
  35. data/{bat → script}/stats +0 -0
  36. data/{bat → script}/tag +0 -0
  37. data/script/test +36 -0
  38. data/test/fixtures/raw_email_reply +32 -0
  39. data/test/fixtures/raw_email_with_bad_date +48 -0
  40. data/test/test_address.rb +1 -3
  41. data/test/test_attachments.rb +1 -2
  42. data/test/test_base64.rb +3 -2
  43. data/test/test_encode.rb +1 -0
  44. data/test/test_header.rb +2 -3
  45. data/test/test_helper.rb +8 -2
  46. data/test/test_mail.rb +45 -16
  47. data/test/test_mbox.rb +1 -1
  48. data/test/test_port.rb +1 -1
  49. data/test/test_scanner.rb +1 -1
  50. data/test/test_utils.rb +1 -2
  51. metadata +82 -76
  52. data/bat/compile +0 -42
  53. data/bat/rdoc +0 -42
  54. data/bat/test +0 -25
  55. data/ext/tmail/Makefile +0 -25
  56. data/ext/tmail/base64/base64.c +0 -264
  57. data/ext/tmail/base64/depend +0 -1
  58. data/ext/tmail/base64/extconf.rb +0 -38
  59. data/ext/tmail/scanner_c/MANIFEST +0 -4
  60. data/ext/tmail/scanner_c/depend +0 -1
  61. data/ext/tmail/scanner_c/extconf.rb +0 -38
  62. data/lib/tmail/tmail.rb +0 -1
@@ -0,0 +1,40 @@
1
+ === 1.2.0 / 2007-11-29
2
+
3
+ * 5 major enhancements:
4
+ * Extensive documentation work. (mikel)
5
+ * Removed base64 c extension. It's speed benefit was negligable (only 0.2 sec over 10000 sizable encode/decode runs) (trans)
6
+ * Closed 15445 - TMail::Mail#create_forward now returns a new Mail object that has the original mail as an encoded 7 bit multipart attachment. Also moved create_forward and create_reply from tmail/net into tmail/interface as it makes more sense to have it there. (mikel)
7
+ * Closed 15643 - TMail::Mail#reply_addresses was returning an empty array if reply_to was set to nil (ie, the header field existed but was empty) instead of returning the from address or default. (mikel)
8
+ * Closed 16025 - TMail scanner.rb would not parse ATOM chars correctly making it fail tests where the C version passed them. Fixed this by updating the Scanner.rb version to be in step with the C version (there was an extra @ symbol in the ATOM CHARS definition that was not in the C version.) (mikel)
9
+ * Fixed scanner.rb so that it would pass the same tests that the C version does - had a sundry @ symbol inside of the ATOM CHARS
10
+ * 3 minor enhancements:
11
+ * Renamed scanner_c.c to mailscanner.c (trans)
12
+ * Changed TMail::Mail#sender to have a default "default" value of nil to be in alignment with all the other interface methods (mikel)
13
+ * Made base64_decode and base64_encode into ! versions as they are destructive on the mail body (encodes the body to base64 or decodes it), made aliases for base64_decode and base64_encode to point back to the bang versions. Doing this with a view to change base64_encode to a non destructive version (returns the encoded body) in future versions. (mikel)
14
+
15
+ === 1.1.1 / 2007-11-05
16
+
17
+ * 3 major enhancement:
18
+ * Created unified package, for installation in any platform.
19
+ * Added require_arch.rb to facilitate multi-platform support.
20
+ * If compilation fails, set NORUBYEXT="true" and reinstall.
21
+ * 3 minor enhancement:
22
+ * Fixed line wrapping of long header fields so that they wrap at the correct whitespace points.
23
+ * Fixed bug where re-assigning the mail.body to existing mail object that already had a parsed body would not re-parse the body.
24
+ * Started documenting the source code... lots more to do.
25
+
26
+ === 1.1.0 / 2007-10-28
27
+
28
+ * 1 minor enhancements:
29
+ * Changed the quoting of paramaters in the header fields to wrap double quotes around fields that are needed to be quoted.
30
+ * Removed keeping double quotes around a filename that does not need double quotes per RFC 1521
31
+ * More clean up and getting tests passing. Now standing at 2 failures out of 3366 assertions. One is the incorrect handling of "@"@test.com (returns @@test.com) and the other is a japanese encoding issue.
32
+
33
+ === 1.0.0 / 2007-10-28
34
+
35
+ * 1 major enhancement:
36
+ * TMail is now released as a GEM!
37
+ * 2 minor enhancements:
38
+ * Fixed bug 15077 - TMail now recognizes attachments as soon as they are added to the body.
39
+ * Refactored handling of quotations in header fields - now cleaner
40
+
@@ -0,0 +1,32 @@
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
+ * allow this type of header: "To: Minero A. <aamine@loveruby.net>"
16
+ * write tests of Base64 module
17
+ * RFC2231 encode
18
+ * allow illegal MIME param value encoding (key="=?iso-2022-jp?B?....")
19
+ * purpose-oriented policy switching
20
+ * rewrite samples.
21
+ * address/address-group common handling scheme
22
+ * correct handling of Content-Type: message/*
23
+ * methods for mail creation, replying, forwarding
24
+ * tmail/net
25
+ * mail thread generator
26
+
27
+ === Bugs
28
+
29
+ * mails may be deleted if other precesses are touching mailbox.
30
+ * mails may be corrupted if other precesses are touching mailbox.
31
+ * not thread safe
32
+
@@ -0,0 +1,118 @@
1
+ # -x doc -x pkg -x log
2
+ CHANGES
3
+ LICENSE
4
+ NOTES
5
+ README
6
+ ext
7
+ ext/Makefile
8
+ ext/mailscanner
9
+ ext/mailscanner/tmail
10
+ ext/mailscanner/tmail/MANIFEST
11
+ ext/mailscanner/tmail/depend
12
+ ext/mailscanner/tmail/extconf.rb
13
+ ext/mailscanner/tmail/mailscanner.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/ROLLRC
48
+ meta/icli.yaml
49
+ meta/project.yaml
50
+ sample
51
+ sample/bench_base64.rb
52
+ sample/data
53
+ sample/data/multipart
54
+ sample/data/normal
55
+ sample/data/sendtest
56
+ sample/data/simple
57
+ sample/data/test
58
+ sample/extract-attachements.rb
59
+ sample/from-check.rb
60
+ sample/multipart.rb
61
+ sample/parse-bench.rb
62
+ sample/parse-test.rb
63
+ sample/sendmail.rb
64
+ script
65
+ script/changelog
66
+ script/clobber
67
+ script/clobber/distclean
68
+ script/clobber/package
69
+ script/compile
70
+ script/config.yaml
71
+ script/prepare
72
+ script/publish
73
+ script/rdoc
74
+ script/release
75
+ script/setup
76
+ script/stats
77
+ script/tag
78
+ script/test
79
+ test
80
+ test/extctrl.rb
81
+ test/fixtures
82
+ test/fixtures/raw_base64_decoded_string
83
+ test/fixtures/raw_base64_email
84
+ test/fixtures/raw_base64_encoded_string
85
+ test/fixtures/raw_email
86
+ test/fixtures/raw_email10
87
+ test/fixtures/raw_email11
88
+ test/fixtures/raw_email12
89
+ test/fixtures/raw_email13
90
+ test/fixtures/raw_email2
91
+ test/fixtures/raw_email3
92
+ test/fixtures/raw_email4
93
+ test/fixtures/raw_email5
94
+ test/fixtures/raw_email6
95
+ test/fixtures/raw_email7
96
+ test/fixtures/raw_email8
97
+ test/fixtures/raw_email9
98
+ test/fixtures/raw_email_quoted_with_0d0a
99
+ test/fixtures/raw_email_reply
100
+ test/fixtures/raw_email_simple
101
+ test/fixtures/raw_email_with_bad_date
102
+ test/fixtures/raw_email_with_illegal_boundary
103
+ test/fixtures/raw_email_with_multipart_mixed_quoted_boundary
104
+ test/fixtures/raw_email_with_nested_attachment
105
+ test/fixtures/raw_email_with_partially_quoted_subject
106
+ test/fixtures/raw_email_with_quoted_illegal_boundary
107
+ test/kcode.rb
108
+ test/test_address.rb
109
+ test/test_attachments.rb
110
+ test/test_base64.rb
111
+ test/test_encode.rb
112
+ test/test_header.rb
113
+ test/test_helper.rb
114
+ test/test_mail.rb
115
+ test/test_mbox.rb
116
+ test/test_port.rb
117
+ test/test_scanner.rb
118
+ test/test_utils.rb
@@ -0,0 +1,3 @@
1
+ tmail 1.2.0 beta (2007-11-28)
2
+ lib/tmail
3
+ ext/mailscanner/tmail
@@ -6,8 +6,8 @@ rubyforge:
6
6
  release:
7
7
  store : pkg
8
8
  package : tmail
9
- notelog : log/Note.txt
10
- changelog : log/Release.txt
9
+ notelog : NOTES
10
+ changelog : CHANGES
11
11
 
12
12
  publish: {}
13
13
 
@@ -12,13 +12,9 @@ description:
12
12
  to compose stadards compliant emails in a
13
13
  very Ruby-way.
14
14
 
15
- formats: [tgz, gem]
16
-
17
- #platforms: [ruby, unix, mswin32]
18
-
19
- lib_path:
20
- - lib/tmail
15
+ formats: [zip, tgz, gem]
16
+ exclude: [pkg, doc]
21
17
 
22
18
  gem_path:
19
+ - ext/tmail
23
20
  - lib
24
-
@@ -0,0 +1,48 @@
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!
File without changes
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ratch
2
+
3
+ main :distclean do
4
+ cd 'ext/mailscanner/tmail' do
5
+ make 'distclean'
6
+ end
7
+ end
8
+
File without changes
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ratch
2
+
3
+ # compile extensions
4
+
5
+ main :compile => [:compile_scanner] do
6
+ puts "Compile complete."
7
+ end
8
+
9
+ task :compile_scanner do
10
+ file = nil
11
+ cd("ext/mailscanner/tmail") do
12
+ ruby "extconf.rb"
13
+ make
14
+
15
+ #file = glob("mailscanner.#{dlext}").first
16
+ #file = File.expand_path(file) if file
17
+ end
18
+
19
+ #if file
20
+ # mkdir_p("lib/tmail/#{arch}")
21
+ # mv(file, "lib/tmail/#{arch}/")
22
+ #end
23
+ end
24
+
25
+ def dlext
26
+ Config::CONFIG['DLEXT']
27
+ end
28
+
29
+ def arch
30
+ Config::CONFIG['arch']
31
+ end
32
+
@@ -1,8 +1,8 @@
1
1
  publish:
2
2
  project: tmail
3
- source: www
3
+ source: doc
4
4
 
5
5
  rdoc:
6
- output: www/rdoc
6
+ output: doc/rdoc
7
7
  main: README.txt
8
8
 
@@ -3,6 +3,8 @@
3
3
  # This updates the manifest file
4
4
  # and generates the packages.
5
5
 
6
- manifest -u MANIFEST
7
- box
6
+ main :prepare do
7
+ manifest "up"
8
+ box "up"
9
+ end
8
10
 
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ratch
2
+
3
+ # Run unit tests
4
+
5
+ main :test do
6
+ $LOAD_PATH.unshift('test')
7
+
8
+ find = commandline[0]
9
+ live = commandline.flag?('--live')
10
+ pure = commandline.flag?('--pure') # pure won't work if live.
11
+
12
+ ARGV.replace([]) # ???
13
+
14
+ unless live
15
+ $LOAD_PATH.unshift(File.expand_path('lib'))
16
+ $LOAD_PATH.unshift(File.expand_path('ext/mailscanner')) unless pure
17
+ end
18
+
19
+ if find
20
+ unless file?(find)
21
+ find = File.join(find, '**', 'test_*.rb')
22
+ end
23
+ else
24
+ find = 'test/**/test_*.rb'
25
+ end
26
+
27
+ files = Dir.glob(find) #.map{ |f| File.join('..', f) }
28
+
29
+ #chdir('test') do
30
+ files.each do |file|
31
+ next unless file?(file)
32
+ load file
33
+ end
34
+ #end
35
+ end
36
+
@@ -0,0 +1,32 @@
1
+ Return-Path: <xxxxxxxx@xxx.org>
2
+ Received: from me ([unix socket])
3
+ by xxxxx1.xxxx.net (Cyrus v2.2.12) with LMTPA;
4
+ Sun, 18 Nov 2007 00:56:33 -0800
5
+ Received: from smtp.xxxx.org (unknown [127.0.0.1])
6
+ by xxxxx1.xxxx.net (Postfix) with ESMTP id F128477EB5;
7
+ Sun, 18 Nov 2007 00:56:32 -0800 (PST)
8
+ Received: from omta02sl.mx.bigpond.com (omta02sl.mx.bigpond.com [144.140.93.154])
9
+ by smtp.xxxx.org (Postfix) with ESMTP id 2D567ACC08;
10
+ Sun, 18 Nov 2007 00:56:28 -0800 (PST)
11
+ Received: from oaamta05sl.mx.bigpond.com ([124.183.219.10])
12
+ by omta02sl.mx.bigpond.com with ESMTP
13
+ id <20071118085627.YVPI22254.omta02sl.mx.bigpond.com@oaamta05sl.mx.bigpond.com>;
14
+ Sun, 18 Nov 2007 08:56:27 +0000
15
+ Received: from [10.0.0.1] (really [124.183.219.10])
16
+ by oaamta05sl.mx.bigpond.com with ESMTP
17
+ id <20071118085627.TQWF6995.oaamta05sl.mx.bigpond.com@[10.0.0.1]>;
18
+ Sun, 18 Nov 2007 08:56:27 +0000
19
+ Message-ID: <473FFE27.20003@xxx.org>
20
+ Date: Sun, 18 Nov 2007 19:56:07 +1100
21
+ From: Testing <xxxxxxxx@xxx.org>
22
+ User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
23
+ X-Accept-Language: en-us, en
24
+ MIME-Version: 1.0
25
+ To: Mikel Lindsaar <mikel@xxxx.net>
26
+ Subject: Re: Test reply email
27
+ References: <473FF3B8.9020707@xxx.org> <348F04F142D69C21-291E56D292BC@xxxx.net>
28
+ In-Reply-To: <348F04F142D69C21-291E56D292BC@xxxx.net>
29
+ Content-Type: text/plain; charset=US-ASCII; format=flowed
30
+ Content-Transfer-Encoding: 7bit
31
+
32
+ Message body
@@ -0,0 +1,48 @@
1
+ Return-Path: <me@xxx.xxxxxxxx.xxx.xx>
2
+ X-Original-To: external@xxx.xxxxxxxx.xxx.xx
3
+ Delivered-To: external@xxx.xxxxxxxx.xxx.xx
4
+ Received: from server.xxx.xxxxxxxx.xxx.xx (localhost.xxxxxxxx.xxx.xx [127.0.0.1])
5
+ by server.xxx.xxxxxxxx.xxx.xx (Postfix) with ESMTP id 0173828456
6
+ for <external@xxx.xxxxxxxx.xxx.xx>; Mon, 5 Nov 2007 20:17:37 +1100 (EST)
7
+ Received: from server.xxx.xxxxxxxx.xxx.xx (server.xxx.xxxxxxxx.xxx.xx [10.130.1.250])
8
+ by localhost (FormatMessage) with SMTP id d7be4d19ed6d330c
9
+ for <sydney@xxxxxxxx.xxx>; Mon, 05 Nov 2007 20:17:37 +1100 (EST)
10
+ Received: from server.sydney.xxxxxxxx.xxx.xx (unknown [10.130.2.6])
11
+ by server.xxx.xxxxxxxx.xxx.xx (Postfix) with ESMTP id BB00328442
12
+ for <sydney@xxxxxxxx.xxx>; Mon, 5 Nov 2007 20:17:37 +1100 (EST)
13
+ Received: from dircomm (unknown [10.130.2.8])
14
+ by server.sydney.xxxxxxxx.xxx.xx (Postfix) with ESMTP id 20A692841F
15
+ for <sydney@xxxxxxxx.xxx>; Mon, 5 Nov 2007 20:18:24 +1100 (EST)
16
+ X-Mailbox-Line: From subventive@vodtravel.com
17
+ Message-ID: <000001c81a67$a4450700$0100007f@localhost>
18
+ From: "Darrell Shaw" <subventive@vodtravel.com>
19
+ To: <sydney@xxxxxxxx.xxx>
20
+ Subject: Microsoft Vlsta & Office2007, Just released for 79$ Save 1599.95$ 0ff Retai|
21
+ Date: Pn, 29 paX 2007 21:13:00 +0100
22
+ Content-Type: text/plain;
23
+ charset="us-ascii"
24
+ Content-Transfer-Encoding: 7bit
25
+ X-Priority: 3 (Normal)
26
+ X-MSMail-Priority: Normal
27
+ X-Mailer: Microsoft Outlook, Build 10.0.3416
28
+ Importance: Normal
29
+ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.150
30
+ X-CSI-MailScanner-Information: Please contact the ISP for more information
31
+ X-CSI-MailScanner: Found to be clean
32
+ X-CSI-MailScanner-SpamCheck: not spam, SpamAssassin (score=1.87, required 4,
33
+ autolearn=disabled, INVALID_DATE 0.23, RAZOR2_CF_RANGE_51_100 1.49,
34
+ RAZOR2_CHECK 0.15)
35
+ X-CSI-MailScanner-SpamScore: s
36
+ X-MailScanner-From: subventive@vodtravel.com
37
+ Resent-Date: Mon, 05 Nov 2007 20:17:37 +1100 (EST)
38
+ Resent-From: <mail_dump@ns1.xxxxxxxx.xxx.xx>
39
+ Resent-To: <mikel@xxxxxxxx.xxx>
40
+ Resent-Message-ID: <d7be4d19ed6d330c.1194254257@xxxxxxxx.xxx.xx>
41
+ X-UID: 4702
42
+ Status: RO
43
+
44
+ hotnewsoft . com
45
+
46
+
47
+
48
+