astrotrain 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/astrotrain.gemspec +3 -2
- data/lib/astrotrain/message.rb +3 -2
- data/test/fixtures/undisclosed.txt +14 -0
- data/test/message_test.rb +7 -0
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.3
|
data/astrotrain.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{astrotrain}
|
5
|
-
s.version = "0.4.
|
5
|
+
s.version = "0.4.3"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["technoweenie"]
|
9
|
-
s.date = %q{2009-09-
|
9
|
+
s.date = %q{2009-09-27}
|
10
10
|
s.email = %q{technoweenie@gmail.com}
|
11
11
|
s.extra_rdoc_files = [
|
12
12
|
"LICENSE",
|
@@ -63,6 +63,7 @@ Gem::Specification.new do |s|
|
|
63
63
|
"test/fixtures/multiple_delivered_to.txt",
|
64
64
|
"test/fixtures/multiple_with_body_recipients.txt",
|
65
65
|
"test/fixtures/reply.txt",
|
66
|
+
"test/fixtures/undisclosed.txt",
|
66
67
|
"test/fixtures/utf-8.txt",
|
67
68
|
"test/logged_mail_test.rb",
|
68
69
|
"test/mapping_test.rb",
|
data/lib/astrotrain/message.rb
CHANGED
@@ -93,8 +93,9 @@ module Astrotrain
|
|
93
93
|
header = TMail::Address.parse(email)
|
94
94
|
parsed = {:name => header.name}
|
95
95
|
if header.is_a?(TMail::AddressGroup)
|
96
|
-
|
97
|
-
|
96
|
+
header = header[0]
|
97
|
+
end
|
98
|
+
if !header.blank?
|
98
99
|
parsed[:email] = header.address
|
99
100
|
end
|
100
101
|
parsed
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Delivered-To: "Processor" <processor@astrotrain.com>
|
2
|
+
Message-ID: <a16be7390810161014n52b603e9k1aa6bb803c6735aa@mail.gmail.com>
|
3
|
+
Date: Thu, 16 Oct 2008 10:14:18 -0700
|
4
|
+
From: Bob <user@example.com>
|
5
|
+
To: undisclosed-recipients:;
|
6
|
+
Subject: Fwd: blah blah
|
7
|
+
MIME-Version: 1.0
|
8
|
+
X-Custom: reply
|
9
|
+
Content-Type: text/plain; charset=ISO-8859-1
|
10
|
+
Content-Transfer-Encoding: 7bit
|
11
|
+
Content-Disposition: inline
|
12
|
+
|
13
|
+
---------- Forwarded message ----------
|
14
|
+
blah blah
|
data/test/message_test.rb
CHANGED
@@ -441,6 +441,13 @@ class Astrotrain::MessageTest < Astrotrain::TestCase
|
|
441
441
|
it "parses invalid email" do
|
442
442
|
assert_equal({:name => "Name", :email => "email@server.com"}, Astrotrain::Message.parse_email_address("Name:email@server.com"))
|
443
443
|
end
|
444
|
+
|
445
|
+
it "parses undisclosed recipients" do
|
446
|
+
raw = mail(:undisclosed)
|
447
|
+
m = Astrotrain::Message.parse(raw)
|
448
|
+
assert_equal(["undisclosed-recipients: ;"], m.recipients_from_to)
|
449
|
+
assert_equal({:name => "undisclosed-recipients"}, Astrotrain::Message.parse_email_address(m.recipients_from_to.first))
|
450
|
+
end
|
444
451
|
end
|
445
452
|
|
446
453
|
describe "queueing" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: astrotrain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- technoweenie
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-27 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -182,6 +182,7 @@ files:
|
|
182
182
|
- test/fixtures/multiple_delivered_to.txt
|
183
183
|
- test/fixtures/multiple_with_body_recipients.txt
|
184
184
|
- test/fixtures/reply.txt
|
185
|
+
- test/fixtures/undisclosed.txt
|
185
186
|
- test/fixtures/utf-8.txt
|
186
187
|
- test/logged_mail_test.rb
|
187
188
|
- test/mapping_test.rb
|