valodzka-tmail 1.2.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +74 -0
- data/LICENSE +21 -0
- data/NOTES +7 -0
- data/README +169 -0
- data/Rakefile +2 -0
- data/ext/Makefile +20 -0
- data/ext/tmailscanner/tmail/MANIFEST +4 -0
- data/ext/tmailscanner/tmail/depend +1 -0
- data/ext/tmailscanner/tmail/extconf.rb +33 -0
- data/ext/tmailscanner/tmail/tmailscanner.c +583 -0
- data/lib/tmail/Makefile +18 -0
- data/lib/tmail/address.rb +392 -0
- data/lib/tmail/attachments.rb +46 -0
- data/lib/tmail/base64.rb +46 -0
- data/lib/tmail/compat.rb +41 -0
- data/lib/tmail/config.rb +67 -0
- data/lib/tmail/core_extensions.rb +63 -0
- data/lib/tmail/encode.rb +590 -0
- data/lib/tmail/header.rb +960 -0
- data/lib/tmail/index.rb +9 -0
- data/lib/tmail/interface.rb +1152 -0
- data/lib/tmail/loader.rb +3 -0
- data/lib/tmail/mail.rb +582 -0
- data/lib/tmail/mailbox.rb +496 -0
- data/lib/tmail/main.rb +6 -0
- data/lib/tmail/mbox.rb +3 -0
- data/lib/tmail/net.rb +250 -0
- data/lib/tmail/obsolete.rb +132 -0
- data/lib/tmail/parser.rb +1060 -0
- data/lib/tmail/parser.y +416 -0
- data/lib/tmail/port.rb +379 -0
- data/lib/tmail/quoting.rb +125 -0
- data/lib/tmail/require_arch.rb +58 -0
- data/lib/tmail/scanner.rb +49 -0
- data/lib/tmail/scanner_r.rb +261 -0
- data/lib/tmail/stringio.rb +280 -0
- data/lib/tmail/utils.rb +337 -0
- data/lib/tmail/version.rb +39 -0
- data/lib/tmail.rb +5 -0
- data/log/BugTrackingLog.txt +1245 -0
- data/log/Changelog.txt +534 -0
- data/log/Testlog.txt +2340 -0
- data/log/Todo.txt +30 -0
- data/meta/MANIFEST +128 -0
- data/meta/VERSION +1 -0
- data/meta/project.yaml +30 -0
- data/meta/unixname +1 -0
- data/sample/bench_base64.rb +48 -0
- data/sample/data/multipart +23 -0
- data/sample/data/normal +29 -0
- data/sample/data/sendtest +5 -0
- data/sample/data/simple +14 -0
- data/sample/data/test +27 -0
- data/sample/extract-attachements.rb +33 -0
- data/sample/from-check.rb +26 -0
- data/sample/multipart.rb +26 -0
- data/sample/parse-bench.rb +68 -0
- data/sample/parse-test.rb +19 -0
- data/sample/sendmail.rb +94 -0
- data/setup.rb +1482 -0
- data/site/contributing/index.html +183 -0
- data/site/css/clean.css +27 -0
- data/site/css/layout.css +31 -0
- data/site/css/style.css +60 -0
- data/site/download/index.html +61 -0
- data/site/img/envelope.jpg +0 -0
- data/site/img/mailman.gif +0 -0
- data/site/img/stamp-sm.jpg +0 -0
- data/site/img/stamp.jpg +0 -0
- data/site/img/stampborder.jpg +0 -0
- data/site/img/tfire.jpg +0 -0
- data/site/img/tmail.png +0 -0
- data/site/index.html +270 -0
- data/site/js/jquery.js +31 -0
- data/site/log/Changelog.xsl +33 -0
- data/site/log/changelog.xml +1677 -0
- data/site/outdated/BUGS +3 -0
- data/site/outdated/DEPENDS +1 -0
- data/site/outdated/Incompatibilities +89 -0
- data/site/outdated/Incompatibilities.ja +102 -0
- data/site/outdated/NEWS +9 -0
- data/site/outdated/README.ja +73 -0
- data/site/outdated/doc.ja/address.html +275 -0
- data/site/outdated/doc.ja/basics.html +405 -0
- data/site/outdated/doc.ja/config.html +49 -0
- data/site/outdated/doc.ja/details.html +146 -0
- data/site/outdated/doc.ja/index.html +39 -0
- data/site/outdated/doc.ja/mail.html +793 -0
- data/site/outdated/doc.ja/mailbox.html +265 -0
- data/site/outdated/doc.ja/port.html +95 -0
- data/site/outdated/doc.ja/tmail.html +58 -0
- data/site/outdated/doc.ja/usage.html +202 -0
- data/site/outdated/rdd/address.rrd.m +229 -0
- data/site/outdated/rdd/basics.rd.m +275 -0
- data/site/outdated/rdd/config.rrd.m +26 -0
- data/site/outdated/rdd/details.rd.m +117 -0
- data/site/outdated/rdd/index.rhtml.m +54 -0
- data/site/outdated/rdd/mail.rrd.m +701 -0
- data/site/outdated/rdd/mailbox.rrd.m +228 -0
- data/site/outdated/rdd/port.rrd.m +69 -0
- data/site/outdated/rdd/tmail.rrd.m +33 -0
- data/site/outdated/rdd/usage.rd.m +247 -0
- data/site/quickstart/index.html +69 -0
- data/site/quickstart/quickstart.html +52 -0
- data/site/quickstart/usage.html +193 -0
- data/site/reference/address.html +247 -0
- data/site/reference/config.html +30 -0
- data/site/reference/index.html +101 -0
- data/site/reference/mail.html +726 -0
- data/site/reference/mailbox.html +245 -0
- data/site/reference/port.html +75 -0
- data/site/reference/tmail.html +35 -0
- data/test/extctrl.rb +6 -0
- data/test/fixtures/mailbox +414 -0
- data/test/fixtures/mailbox_without_any_from_or_sender +10 -0
- data/test/fixtures/mailbox_without_from +11 -0
- data/test/fixtures/mailbox_without_return_path +12 -0
- data/test/fixtures/raw_attack_email_with_zero_length_whitespace +29 -0
- data/test/fixtures/raw_base64_decoded_string +0 -0
- data/test/fixtures/raw_base64_email +83 -0
- data/test/fixtures/raw_base64_encoded_string +1 -0
- data/test/fixtures/raw_email +14 -0
- data/test/fixtures/raw_email10 +20 -0
- data/test/fixtures/raw_email11 +34 -0
- data/test/fixtures/raw_email12 +32 -0
- data/test/fixtures/raw_email13 +29 -0
- data/test/fixtures/raw_email2 +114 -0
- data/test/fixtures/raw_email3 +70 -0
- data/test/fixtures/raw_email4 +59 -0
- data/test/fixtures/raw_email5 +19 -0
- data/test/fixtures/raw_email6 +20 -0
- data/test/fixtures/raw_email7 +66 -0
- data/test/fixtures/raw_email8 +47 -0
- data/test/fixtures/raw_email9 +28 -0
- data/test/fixtures/raw_email_multiple_from +30 -0
- data/test/fixtures/raw_email_quoted_with_0d0a +14 -0
- data/test/fixtures/raw_email_reply +32 -0
- data/test/fixtures/raw_email_simple +11 -0
- data/test/fixtures/raw_email_with_bad_date +48 -0
- data/test/fixtures/raw_email_with_double_carriage_return +179 -0
- data/test/fixtures/raw_email_with_illegal_boundary +58 -0
- data/test/fixtures/raw_email_with_mimepart_without_content_type +94 -0
- data/test/fixtures/raw_email_with_multipart_mixed_quoted_boundary +50 -0
- data/test/fixtures/raw_email_with_nested_attachment +100 -0
- data/test/fixtures/raw_email_with_partially_quoted_subject +14 -0
- data/test/fixtures/raw_email_with_quoted_illegal_boundary +58 -0
- data/test/kcode.rb +14 -0
- data/test/temp_test_one.rb +46 -0
- data/test/test_address.rb +1214 -0
- data/test/test_attachments.rb +73 -0
- data/test/test_base64.rb +64 -0
- data/test/test_encode.rb +85 -0
- data/test/test_header.rb +1002 -0
- data/test/test_helper.rb +9 -0
- data/test/test_mail.rb +761 -0
- data/test/test_mbox.rb +184 -0
- data/test/test_port.rb +436 -0
- data/test/test_quote.rb +107 -0
- data/test/test_scanner.rb +209 -0
- data/test/test_utils.rb +36 -0
- data/work/script/make +26 -0
- data/work/script/rdoc +39 -0
- data/work/script/setup +1616 -0
- data/work/script/test +30 -0
- metadata +298 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
|
5
|
+
<meta http-equiv="Content-Language" content="en">
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="../css/clean.css" type="text/css" media="screen, projection, print"/>
|
8
|
+
<link rel="stylesheet" href="../css/layout.css" type="text/css" media="screen, projection, print"/>
|
9
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen, projection, print"/>
|
10
|
+
|
11
|
+
<link rel="icon" href="../img/tfire.jpg" type="image/x-icon"/>
|
12
|
+
|
13
|
+
<title>TMail — Quick Start Guide</title>
|
14
|
+
|
15
|
+
<script type="text/javascript" src="../js/jquery.js"></script>
|
16
|
+
|
17
|
+
<script>
|
18
|
+
$(document).ready(function(){
|
19
|
+
$('#quickstart').load('quickstart.html');
|
20
|
+
$('#usage').load('usage.html');
|
21
|
+
});
|
22
|
+
</script>
|
23
|
+
|
24
|
+
</head>
|
25
|
+
<body>
|
26
|
+
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
|
27
|
+
</script>
|
28
|
+
<script type="text/javascript">
|
29
|
+
_uacct = "UA-2871747-1";
|
30
|
+
urchinTracker();
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<div class="container">
|
34
|
+
|
35
|
+
<div class="logo">
|
36
|
+
<img src="../img/stamp-sm.jpg"/>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div class="title">
|
40
|
+
<h1>TMail</h1>
|
41
|
+
<h2>Ruby on Mail</h2>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div class="menu">
|
45
|
+
|
46
|
+
<a href="../index.html">Home</a>
|
47
|
+
<a href="../quickstart/index.html">Quickstart</a>
|
48
|
+
<a href="http://lindsaar.net/tmail/" onClick="javascript:urchinTracker('/outgoing/rubyforge.org/blog_page');">Blog</a>
|
49
|
+
<a href="http://rubyforge.org/frs/?group_id=4512" onClick="javascript:urchinTracker('/outgoing/rubyforge.org/download_page');">Download</a>
|
50
|
+
<a href="http://rubyforge.org/mailman/listinfo/tmail-talk">Mailing List</a>
|
51
|
+
<a href="../reference/index.html">Reference</a>
|
52
|
+
<a href="../rdoc/index.html">RDocs</a>
|
53
|
+
<a href="http://rubyforge.org/projects/tmail/" onClick="javascript:urchinTracker('/outgoing/rubyforge.org/project_page');">Project</a>
|
54
|
+
<a href="../contributing/index.html">Contributing</a>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div class="main">
|
58
|
+
<div id="quickstart"></div>
|
59
|
+
|
60
|
+
<div id="usage" ></div>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div class="footer">
|
64
|
+
Copyright (c) 2007 TMail Project ® All Rights Reserved
|
65
|
+
</div>
|
66
|
+
|
67
|
+
</div>
|
68
|
+
</body>
|
69
|
+
</html>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<h1>TMail Quick Start Guide</h1>
|
2
|
+
|
3
|
+
<div class="guide">
|
4
|
+
<p>TMail is an E-Mail handling library. It provides you with access to
|
5
|
+
any email you wrap it around as an object.</p>
|
6
|
+
|
7
|
+
<h2>Unix like OSes</h2>
|
8
|
+
|
9
|
+
<ol>
|
10
|
+
<li>
|
11
|
+
Download the <a href="../download/index.html">
|
12
|
+
latest release</a> gem from the RubyForge TMail project.
|
13
|
+
</li>
|
14
|
+
<li>
|
15
|
+
Run gem install from the directory where you saved the gem:
|
16
|
+
|
17
|
+
<pre class="shell">
|
18
|
+
$ gem install tmail
|
19
|
+
</pre>
|
20
|
+
|
21
|
+
</li>
|
22
|
+
<li>
|
23
|
+
That's it!
|
24
|
+
<br />
|
25
|
+
<br />
|
26
|
+
TMail installs into the ruby_lib_path/gems/ folder just like any other
|
27
|
+
well behaved gem and allows you to require it thusly:<br />
|
28
|
+
</li>
|
29
|
+
|
30
|
+
<pre class="shell">
|
31
|
+
irb(main):001:0> require 'rubygems'
|
32
|
+
irb(main):002:0> require 'tmail'
|
33
|
+
irb(main):003:0> email = TMail::Mail.load("my_raw_email.txt")
|
34
|
+
irb(main):004:0> puts email.to
|
35
|
+
=> mikel@example.com
|
36
|
+
irb(main):005:0> email.to = 'mikel@somewhere.else.com'
|
37
|
+
=> "mikel@somewhere.else.com"
|
38
|
+
irb(main):006:0> email.cc = 'mikel@another.place.com'
|
39
|
+
=> mikel@another.place.com
|
40
|
+
irb(main):007:0> email.destinations
|
41
|
+
=> ["mikel@somewhere.else.com", "mikel@another.place.com"]
|
42
|
+
</pre>
|
43
|
+
|
44
|
+
</ol>
|
45
|
+
|
46
|
+
<h2>UnUnix like OSes (Windows etc)</h2>
|
47
|
+
|
48
|
+
<p>Just do the same as the above... just gem install tmail. If TMail can
|
49
|
+
find a compiler on your system, it will compile the native C extensions,
|
50
|
+
if it can't find a compiler, it will just install the Ruby version. Easy
|
51
|
+
hey?</p>
|
52
|
+
</div>
|
@@ -0,0 +1,193 @@
|
|
1
|
+
<h1>General Usage</h1>
|
2
|
+
|
3
|
+
<h2>Abstraction</h2>
|
4
|
+
|
5
|
+
<p>
|
6
|
+
TMail is designed to be an RFC compatible library. The goal of TMail
|
7
|
+
is to allow you to create emails programatically without having to know
|
8
|
+
about the RFCs or how they work, or what their standards are.
|
9
|
+
</p>
|
10
|
+
|
11
|
+
<h2>Getting information from e-mail</h2>
|
12
|
+
|
13
|
+
<h3>class TMail::Mail</h3>
|
14
|
+
|
15
|
+
<p>
|
16
|
+
When you use TMail, you need to create a TMail object. There are
|
17
|
+
three ways you can do this, the first is by parsing a string supplied
|
18
|
+
to TMail, the second is by loading the mail object from a file, and
|
19
|
+
the third is by opening up a port to whatever mail source you want.
|
20
|
+
<br />
|
21
|
+
<br />
|
22
|
+
For example:
|
23
|
+
</p>
|
24
|
+
|
25
|
+
<h4>Loading from string:</h4>
|
26
|
+
|
27
|
+
<pre class="ruby">
|
28
|
+
require 'tmail'
|
29
|
+
|
30
|
+
mail = TMail::Mail.parse(string) # from String
|
31
|
+
</pre>
|
32
|
+
|
33
|
+
<h4>Loading from a file:</h4>
|
34
|
+
|
35
|
+
<pre class="ruby">
|
36
|
+
require 'tmail'
|
37
|
+
|
38
|
+
mail = TMail::Mail.load(filename) # from file
|
39
|
+
</pre>
|
40
|
+
|
41
|
+
<h4>Using the Port abstraction</h4>
|
42
|
+
|
43
|
+
<p>
|
44
|
+
The third way to get TMail::Mail object is using the "port".
|
45
|
+
"port" is the abstruction of mail sources, e.g. strings or file names.
|
46
|
+
You can get ports by using mail loaders (TMail::*Loader classes).
|
47
|
+
<br />
|
48
|
+
<br />
|
49
|
+
Here's simple example:
|
50
|
+
</p>
|
51
|
+
|
52
|
+
<pre class="ruby">
|
53
|
+
require 'tmail'
|
54
|
+
|
55
|
+
loader = TMail::MhLoader.new( '/home/aamine/Mail/inbox' )
|
56
|
+
loader.each_port do |port|
|
57
|
+
mail = TMail::Mail.new(port)
|
58
|
+
# ....
|
59
|
+
end
|
60
|
+
</pre>
|
61
|
+
|
62
|
+
<p>This lets you cycle through your messages in the inbox</p>
|
63
|
+
|
64
|
+
<h3>Accessing EMail Attributes via TMail::Mail object</h3>
|
65
|
+
|
66
|
+
<p>
|
67
|
+
Once you have the Email loaded, you can now access the various parts
|
68
|
+
of the email, using various methods on the now instantiated TMail::Mail
|
69
|
+
object.
|
70
|
+
<br />
|
71
|
+
<br />
|
72
|
+
For example...
|
73
|
+
</p>
|
74
|
+
|
75
|
+
<h4>
|
76
|
+
To get who the email is to:
|
77
|
+
</h4>
|
78
|
+
|
79
|
+
<pre class="ruby">
|
80
|
+
require 'tmail'
|
81
|
+
|
82
|
+
mail = TMail::Mail.parse( 'To: Minero Aoki <aamine@loveruby.net>' )
|
83
|
+
p mail.to # => ["aamine@loveruby.net"]
|
84
|
+
</pre>
|
85
|
+
|
86
|
+
<h4>
|
87
|
+
To get the subject:
|
88
|
+
</h4>
|
89
|
+
|
90
|
+
<pre class="ruby">
|
91
|
+
p mail.subject
|
92
|
+
</pre class="ruby">
|
93
|
+
|
94
|
+
<h4>
|
95
|
+
To get the body of the email:
|
96
|
+
</h4>
|
97
|
+
|
98
|
+
<pre class="ruby">
|
99
|
+
p mail.body
|
100
|
+
</pre>
|
101
|
+
|
102
|
+
<p>
|
103
|
+
For more information, see the RDoc index and the TMail::Mail class specifically.
|
104
|
+
</p>
|
105
|
+
|
106
|
+
<h3>MIME multipart emails</h3>
|
107
|
+
|
108
|
+
<p>
|
109
|
+
TMail also supports MIME multipart mails.
|
110
|
+
<br />
|
111
|
+
<br />
|
112
|
+
If mail is multipart mail, Mail#multipart? returns true,
|
113
|
+
and Mail#parts contains an array of parts (TMail::Mail object).
|
114
|
+
</p>
|
115
|
+
|
116
|
+
<pre class="ruby">
|
117
|
+
require 'tmail'
|
118
|
+
|
119
|
+
mail = TMail::Mail.parse( multipart_mail_string )
|
120
|
+
if mail.multipart? then
|
121
|
+
mail.parts.each do |m|
|
122
|
+
puts m.main_type
|
123
|
+
end
|
124
|
+
end
|
125
|
+
</pre>
|
126
|
+
|
127
|
+
<h2>Creating New Mail</h2>
|
128
|
+
|
129
|
+
<p>Creating an email is just as easy:</p>
|
130
|
+
|
131
|
+
<pre class="ruby">
|
132
|
+
require 'tmail'
|
133
|
+
|
134
|
+
# Example 1: create mail only in memory
|
135
|
+
mail = TMail::Mail.new
|
136
|
+
|
137
|
+
# Example 2: create mail on mailbox (on disk)
|
138
|
+
loader = TMail::MhLoader.new('/home/aamine/Mail/drafts')
|
139
|
+
mail = TMail::Mail.new( loader.new_port )
|
140
|
+
</pre>
|
141
|
+
|
142
|
+
<p>
|
143
|
+
Then fill headers and body.
|
144
|
+
</p>
|
145
|
+
|
146
|
+
<pre class="ruby">
|
147
|
+
mail.to = 'test@loveruby.net'
|
148
|
+
mail.from = 'Minero Aoki <aamine@loveruby.net>'
|
149
|
+
mail.subject = 'test mail'
|
150
|
+
mail.date = Time.now
|
151
|
+
mail.mime_version = '1.0'
|
152
|
+
mail.set_content_type 'text', 'plain', {'charset'=>'iso-2022-jp'}
|
153
|
+
mail.body = 'This is test mail.'
|
154
|
+
</pre>
|
155
|
+
|
156
|
+
<p>
|
157
|
+
At last, convert mail object to string.
|
158
|
+
</p>
|
159
|
+
|
160
|
+
<pre class="ruby">
|
161
|
+
str = mail.to_s
|
162
|
+
</pre>
|
163
|
+
|
164
|
+
<p>
|
165
|
+
If you want to write mails against files directly
|
166
|
+
(without intermediate string), use Mail#write_back.
|
167
|
+
</p>
|
168
|
+
|
169
|
+
<pre class="ruby">
|
170
|
+
mail.write_back
|
171
|
+
</pre>
|
172
|
+
|
173
|
+
|
174
|
+
<h3>What TMail is NOT</h3>
|
175
|
+
|
176
|
+
<p>
|
177
|
+
Right now, TMail does not touch the body of the mail message,
|
178
|
+
for example, it doesn't encode, decode, handle character sets
|
179
|
+
etc. It only handles the message and headers and gives you
|
180
|
+
access to read and write the mail body.
|
181
|
+
</p>
|
182
|
+
|
183
|
+
<p>
|
184
|
+
Plans for future versions are to allow better handling of the mail
|
185
|
+
body, auto decode Base64 and handling attachments in a better way.
|
186
|
+
</p>
|
187
|
+
|
188
|
+
<h2>Now what?</h2>
|
189
|
+
|
190
|
+
<p>Go to the <a href="../manual/index.html">online manual</a> to find out
|
191
|
+
how to use it all, or if you are stuck you can join the
|
192
|
+
<a href="http://rubyforge.org/mailman/listinfo/tmail-talk">TMail-Talk</a>
|
193
|
+
mailing list and ask your question there.</p>
|
@@ -0,0 +1,247 @@
|
|
1
|
+
<h1>Address Classes</h1>
|
2
|
+
|
3
|
+
<h2><code>class <a name="TMail%3a%3aAddress">TMail::Address</a> </code></h2>
|
4
|
+
|
5
|
+
<h3>Class Methods</h3>
|
6
|
+
|
7
|
+
<dl>
|
8
|
+
<dt><a name="TMail%3a%3aAddress-parse"><code>parse(str)</code></a> -> <code><a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a></code></dt>
|
9
|
+
<dd>
|
10
|
+
<p>
|
11
|
+
str: String<br>
|
12
|
+
</p>
|
13
|
+
|
14
|
+
<p>
|
15
|
+
parses the string and creates a new <code>TMail::Address</code> object.
|
16
|
+
If the string does not follow the standard internet address format, a
|
17
|
+
<code>TMail::SyntaxError</code> exception is raised.
|
18
|
+
</p>
|
19
|
+
|
20
|
+
</dd>
|
21
|
+
<dt><a name="TMail%3a%3aAddress-new"><code>new(locals, <var>domains</var>)</code></a> -> <code><a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a></code></dt>
|
22
|
+
<dd>
|
23
|
+
<p>
|
24
|
+
locals: [String]<br>
|
25
|
+
domains: [String]<br>
|
26
|
+
</p>
|
27
|
+
|
28
|
+
<p>
|
29
|
+
creates a new <code>TMail::Address</code> object consisting of the local part,
|
30
|
+
LOCALS and domain part <var>domains</var>.
|
31
|
+
</p>
|
32
|
+
|
33
|
+
</dd>
|
34
|
+
</dl>
|
35
|
+
<h3>Instance Methods</h3>
|
36
|
+
|
37
|
+
<dl>
|
38
|
+
<dt><a name="TMail%3a%3aAddress-address_group%3f"><code>address_group?</code></a> -> <code>true | false</code></dt>
|
39
|
+
<dd>
|
40
|
+
<p>
|
41
|
+
returns false.
|
42
|
+
</p>
|
43
|
+
|
44
|
+
</dd>
|
45
|
+
<dt><a name="TMail%3a%3aAddress-spec"><code>spec</code></a> -> <code>String</code></dt>
|
46
|
+
<dd>
|
47
|
+
<p>
|
48
|
+
an address spec ("....@....").
|
49
|
+
</p>
|
50
|
+
|
51
|
+
</dd>
|
52
|
+
<dt><a name="TMail%3a%3aAddress-routes"><code>routes</code></a> -> <code>[String]</code></dt>
|
53
|
+
<dd>
|
54
|
+
<p>
|
55
|
+
delivery routes. Strings do not include character "@".
|
56
|
+
</p>
|
57
|
+
|
58
|
+
</dd>
|
59
|
+
<dt><a name="TMail%3a%3aAddress-name"><code>name</code></a> -> <code>String</code></dt>
|
60
|
+
<dt><a name="TMail%3a%3aAddress-phrase"><code>phrase</code></a> -> <code>String</code></dt>
|
61
|
+
<dd>
|
62
|
+
<p>
|
63
|
+
short description for this address (e.g. real name).
|
64
|
+
</p>
|
65
|
+
|
66
|
+
</dd>
|
67
|
+
<dt><a name="TMail%3a%3aAddress-encoded"><code>encoded(eol = "\r\n", <var>encoding</var> = 'j')</code></a> -> <code>String</code></dt>
|
68
|
+
<dd>
|
69
|
+
<p>
|
70
|
+
eol: String<br>
|
71
|
+
encoding: String<br>
|
72
|
+
</p>
|
73
|
+
|
74
|
+
<p>
|
75
|
+
converts this object into MIME-encoded string.
|
76
|
+
</p>
|
77
|
+
|
78
|
+
</dd>
|
79
|
+
<dt><a name="TMail%3a%3aAddress-to_s"><code>to_s(eol = "\n", <var>encoding</var> = 'e')</code></a> -> <code>String</code></dt>
|
80
|
+
<dt><a name="TMail%3a%3aAddress-decoded"><code>decoded(eol = "\n", <var>encoding</var> = 'e')</code></a> -> <code>String</code></dt>
|
81
|
+
<dd>
|
82
|
+
<p>
|
83
|
+
eol: String<br>
|
84
|
+
encoding: String<br>
|
85
|
+
</p>
|
86
|
+
|
87
|
+
<p>
|
88
|
+
converts this object into decoded string.
|
89
|
+
</p>
|
90
|
+
|
91
|
+
</dd>
|
92
|
+
<dt><a name="TMail%3a%3aAddress-%3d%3d"><code>==(other)</code></a> -> <code>true | false</code></dt>
|
93
|
+
<dd>
|
94
|
+
<p>
|
95
|
+
other: Object<br>
|
96
|
+
</p>
|
97
|
+
|
98
|
+
<p>
|
99
|
+
judge if self equals to other by inspecting addr-spec string (#spec).
|
100
|
+
#name and #routes never affects the return value.
|
101
|
+
</p>
|
102
|
+
|
103
|
+
|
104
|
+
</dd>
|
105
|
+
</dl>
|
106
|
+
<h2><code>class <a name="TMail%3a%3aAddressGroup">TMail::AddressGroup</a> </code></h2>
|
107
|
+
|
108
|
+
<h3>Class Methods</h3>
|
109
|
+
|
110
|
+
<dl>
|
111
|
+
<dt><a name="TMail%3a%3aAddressGroup-new"><code>new(name, <var>addrs</var>)</code></a> -> <code><a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a></code></dt>
|
112
|
+
<dd>
|
113
|
+
<p>
|
114
|
+
name: String<br>
|
115
|
+
addrs: [<a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a>]<br>
|
116
|
+
</p>
|
117
|
+
|
118
|
+
<p>
|
119
|
+
creates new <code>TMail::AddressGroup</code> object.
|
120
|
+
NAME is the name of this group, <var>addrs</var> is addresses
|
121
|
+
which belongs to this group.
|
122
|
+
</p>
|
123
|
+
|
124
|
+
</dd>
|
125
|
+
</dl>
|
126
|
+
<h3>Instance Methods</h3>
|
127
|
+
|
128
|
+
<dl>
|
129
|
+
<dt><a name="TMail%3a%3aAddressGroup-address_group%3f"><code>address_group?</code></a> -> <code>true | false</code></dt>
|
130
|
+
<dd>
|
131
|
+
<p>
|
132
|
+
returns true.
|
133
|
+
</p>
|
134
|
+
|
135
|
+
</dd>
|
136
|
+
<dt><a name="TMail%3a%3aAddressGroup-name"><code>name</code></a> -> <code>String</code></dt>
|
137
|
+
<dd>
|
138
|
+
<p>
|
139
|
+
the human readable name of this group.
|
140
|
+
</p>
|
141
|
+
|
142
|
+
</dd>
|
143
|
+
<dt><a name="TMail%3a%3aAddressGroup-addresses"><code>addresses</code></a> -> <code>[<a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a>]</code></dt>
|
144
|
+
<dd>
|
145
|
+
<p>
|
146
|
+
addresses which belongs to this group.
|
147
|
+
</p>
|
148
|
+
|
149
|
+
</dd>
|
150
|
+
<dt><a name="TMail%3a%3aAddressGroup-to_a"><code>to_a</code></a> -> <code>[<a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a>]</code></dt>
|
151
|
+
<dt><a name="TMail%3a%3aAddressGroup-to_ary"><code>to_ary</code></a> -> <code>[<a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a>]</code></dt>
|
152
|
+
<dd>
|
153
|
+
<p>
|
154
|
+
equals to <code>addresses.dup</code>.
|
155
|
+
</p>
|
156
|
+
|
157
|
+
</dd>
|
158
|
+
<dt><a name="TMail%3a%3aAddressGroup-flatten"><code>flatten</code></a> -> <code>[<a href="address.html#TMail%3a%3aAddress">TMail::Address</a>]</code></dt>
|
159
|
+
<dd>
|
160
|
+
<p>
|
161
|
+
flatten this group into one level of array of <code>TMail::Address</code>.
|
162
|
+
</p>
|
163
|
+
|
164
|
+
</dd>
|
165
|
+
<dt><a name="TMail%3a%3aAddressGroup-add"><code>add(addr)</code></a></dt>
|
166
|
+
<dt><a name="TMail%3a%3aAddressGroup-push"><code>push(addr)</code></a></dt>
|
167
|
+
<dd>
|
168
|
+
<p>
|
169
|
+
addr: <a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a><br>
|
170
|
+
</p>
|
171
|
+
|
172
|
+
<p>
|
173
|
+
adds an address or an address group to this group.
|
174
|
+
</p>
|
175
|
+
|
176
|
+
</dd>
|
177
|
+
<dt><a name="TMail%3a%3aAddressGroup-delete"><code>delete(addr)</code></a></dt>
|
178
|
+
<dd>
|
179
|
+
<p>
|
180
|
+
addr: <a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a><br>
|
181
|
+
</p>
|
182
|
+
|
183
|
+
<p>
|
184
|
+
removes ADDR from this group.
|
185
|
+
</p>
|
186
|
+
|
187
|
+
</dd>
|
188
|
+
<dt><a name="TMail%3a%3aAddressGroup-each%20%7b%7ca%7c%20%2e%2e%2e%2e%20%7d"><code>each {|a| .... }</code></a></dt>
|
189
|
+
<dd>
|
190
|
+
<p>
|
191
|
+
a: <a href="address.html#TMail%3a%3aAddress">TMail::Address</a> | <a href="address.html#TMail%3a%3aAddressGroup">TMail::AddressGroup</a><br>
|
192
|
+
</p>
|
193
|
+
|
194
|
+
<p>
|
195
|
+
equals to <code>addresses.each {|a| .... }</code>.
|
196
|
+
</p>
|
197
|
+
|
198
|
+
</dd>
|
199
|
+
<dt><a name="TMail%3a%3aAddressGroup-each_address%20%7b%7ca%7c%20%2e%2e%2e%2e%20%7d"><code>each_address {|a| .... }</code></a></dt>
|
200
|
+
<dd>
|
201
|
+
<p>
|
202
|
+
a: <a href="address.html#TMail%3a%3aAddress">TMail::Address</a><br>
|
203
|
+
</p>
|
204
|
+
|
205
|
+
<p>
|
206
|
+
equals to <code>flatten.each {|a| .... }</code>
|
207
|
+
</p>
|
208
|
+
|
209
|
+
</dd>
|
210
|
+
<dt><a name="TMail%3a%3aAddressGroup-encoded"><code>encoded(eol = "\r\n", <var>encoding</var> = 'j')</code></a> -> <code>String</code></dt>
|
211
|
+
<dd>
|
212
|
+
<p>
|
213
|
+
eol: String<br>
|
214
|
+
encoding: String<br>
|
215
|
+
</p>
|
216
|
+
|
217
|
+
<p>
|
218
|
+
converts this object into MIME-encoded string.
|
219
|
+
</p>
|
220
|
+
|
221
|
+
</dd>
|
222
|
+
<dt><a name="TMail%3a%3aAddressGroup-decoded"><code>decoded(eol = "\n", <var>encoding</var> = 'e')</code></a> -> <code>String</code></dt>
|
223
|
+
<dd>
|
224
|
+
<p>
|
225
|
+
eol: String<br>
|
226
|
+
encoding: String<br>
|
227
|
+
</p>
|
228
|
+
|
229
|
+
<p>
|
230
|
+
converts this object into decoded string.
|
231
|
+
</p>
|
232
|
+
|
233
|
+
</dd>
|
234
|
+
<dt><a name="TMail%3a%3aAddressGroup-%3d%3d"><code>==(other)</code></a> -> <code>true | false</code></dt>
|
235
|
+
<dt><a name="TMail%3a%3aAddressGroup-eql%3f"><code>eql?(other)</code></a> -> <code>true | false</code></dt>
|
236
|
+
<dd>
|
237
|
+
<p>
|
238
|
+
other: Object<br>
|
239
|
+
</p>
|
240
|
+
|
241
|
+
<p>
|
242
|
+
judges if self is equal to OTHER, by comparing <code>self.addresses</code> and
|
243
|
+
<code>other.addresses</code>. (<code>self.name</code> is meanless)
|
244
|
+
</p>
|
245
|
+
</dd>
|
246
|
+
</dl>
|
247
|
+
|