rockdove 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -1
- data/lib/rockdove/collect_mail.rb +4 -3
- data/lib/rockdove/exchange_mail.rb +5 -1
- data/lib/rockdove/version.rb +1 -1
- data/spec/rockdove/collect_mail_spec.rb +3 -1
- data/spec/rockdove/emails/auto_reply_mail.yml +1 -0
- data/spec/rockdove/emails/forwarded_mail.yml +1 -0
- data/spec/rockdove/emails/gmail_fwd_mail.yml +1 -0
- data/spec/rockdove/emails/mail_type_text.yml +1 -0
- data/spec/rockdove/emails/mail_with_attachment.yml +1 -0
- data/spec/rockdove/emails/new_mail.yml +1 -0
- data/spec/rockdove/emails/replied_mail.yml +1 -0
- data/spec/rockdove/emails/undeliverable_mail.yml +1 -0
- data/spec/rockdove/fetch_incoming_mail_spec.rb +3 -0
- data/spec/rockdove/rockdove_shared_spec.rb +1 -1
- metadata +21 -21
data/CHANGELOG.md
CHANGED
@@ -24,4 +24,8 @@
|
|
24
24
|
* [Feature] Email Attachments & Save to File support
|
25
25
|
* [Fix] Paste of links under email body generates unnecessary duplication of link tags
|
26
26
|
* [Fix] Sent Via signature parsing under email body screws up Reply & forwarded mails parsing
|
27
|
-
* [Fix] Utf-8 encoding issues on email body & attachments
|
27
|
+
* [Fix] Utf-8 encoding issues on email body & attachments
|
28
|
+
|
29
|
+
## v0.3.1
|
30
|
+
|
31
|
+
* [Fix] Handles peculiar cases of Auto Replies ex: Out of Office responses
|
@@ -4,6 +4,7 @@ module Rockdove
|
|
4
4
|
AUTO_REPLY = /Automatic reply/i
|
5
5
|
SPAM = /SPAM/i
|
6
6
|
FAILURE = /Delivery(.+)Failure/i
|
7
|
+
AUTO_REPLIES_HEADER = "X-Auto-Response-Suppress"
|
7
8
|
|
8
9
|
class << self
|
9
10
|
attr_accessor :mail_stack, :inbox_connection
|
@@ -69,7 +70,7 @@ module Rockdove
|
|
69
70
|
Rockdove.logger.info "Rockdove deleting this mail: #{item.subject}."
|
70
71
|
true
|
71
72
|
else
|
72
|
-
false
|
73
|
+
item.headers.include?(AUTO_REPLIES_HEADER) ? true : false
|
73
74
|
end
|
74
75
|
end
|
75
76
|
|
@@ -111,13 +112,13 @@ module Rockdove
|
|
111
112
|
return nil
|
112
113
|
end
|
113
114
|
|
114
|
-
def process
|
115
|
-
@to_folder = Rockdove::Config.archive_folder
|
115
|
+
def process
|
116
116
|
@mail_stack.each {|item| archive(item) }
|
117
117
|
@mail_stack = nil
|
118
118
|
end
|
119
119
|
|
120
120
|
def archive(item)
|
121
|
+
@to_folder = Rockdove::Config.archive_folder
|
121
122
|
if @to_folder.blank?
|
122
123
|
item.delete!
|
123
124
|
Rockdove.logger.info "Rockdove delivered & deleted the mail."
|
@@ -8,7 +8,7 @@ module Rockdove
|
|
8
8
|
|
9
9
|
# The below specifics can be accessed via Rockdove::ExchangeMail @class_instance.
|
10
10
|
def_delegators :@mail_item, :to_recipients, :date_time_created, :date_time_sent, :from, :body, :body_type
|
11
|
-
def_delegators :@mail_item, :subject, :body, :has_attachments?, :attachments, :text_only=, :text_only?
|
11
|
+
def_delegators :@mail_item, :subject, :body, :has_attachments?, :attachments, :text_only=, :text_only?, :auto_response?
|
12
12
|
|
13
13
|
attr_accessor :connection
|
14
14
|
|
@@ -88,5 +88,9 @@ module Rockdove
|
|
88
88
|
def retrieve_text_type
|
89
89
|
{:base_shape=>"AllProperties", :body_type=>"Text"}
|
90
90
|
end
|
91
|
+
|
92
|
+
def auto_response?
|
93
|
+
Rockdove::CollectMail.new.bounce_type_mail?(@mail_item)
|
94
|
+
end
|
91
95
|
end
|
92
96
|
end
|
data/lib/rockdove/version.rb
CHANGED
@@ -70,7 +70,8 @@ describe "CollectParseArchive" do
|
|
70
70
|
handle_inbox(Array(mail))
|
71
71
|
convert_from_hash(mail)
|
72
72
|
@mail_retriever.group_of_mails.should be_an_instance_of(Rockdove::RockdoveCollection)
|
73
|
-
@
|
73
|
+
@mail_retriever.bounce_type_mail?(mail).should == true
|
74
|
+
@log_stream.string.should include("Rockdove deleting this mail: Automatic reply: Out of Office Message")
|
74
75
|
end
|
75
76
|
|
76
77
|
it "should ignore mails when specified under ews_ignore_mails list" do
|
@@ -87,6 +88,7 @@ describe "CollectParseArchive" do
|
|
87
88
|
handle_inbox(Array(mail))
|
88
89
|
convert_from_hash(mail)
|
89
90
|
@mail_retriever.group_of_mails.should be_an_instance_of(Rockdove::RockdoveCollection)
|
91
|
+
@mail_retriever.bounce_type_mail?(mail).should == true
|
90
92
|
@log_stream.string.should include("Rockdove deleting this mail: Undeliverable: New Post")
|
91
93
|
end
|
92
94
|
|
@@ -6,6 +6,7 @@ parent_folder_id:
|
|
6
6
|
id: AAMkADZjZWE3MWJkLWJmZDctNGViOC1iMmFjLTgxOWE5MDk5NDg5OAAuAAAAAAD/yBU79ZvXQ6rBazqQ3s20AQBjikxovOdMSKu/0PoKjGIOAAADx+aDAAA=
|
7
7
|
change_key: AQAAAA==
|
8
8
|
subject: "Automatic reply: Out of Office Message"
|
9
|
+
headers: "X-Auto-Response-Suppress"
|
9
10
|
sensitivity:
|
10
11
|
text: Normal
|
11
12
|
body_type: HTML
|
@@ -45,6 +45,7 @@ body: ! "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/ht
|
|
45
45
|
LastName</font><br>\r\n<font face=\"comic sans ms,sans-serif\">"Th</font><font
|
46
46
|
face=\"comic sans ms,sans-serif\">e Journey Goes on..."<br>\r\nCatch me
|
47
47
|
<a href=\"https://socio.ewsdomain.com/u/505\" target=\"_blank\">@network</a><br>\r\n</font><br>\r\n</body>\r\n</html>\r\n"
|
48
|
+
headers: ""
|
48
49
|
size:
|
49
50
|
text: '3863'
|
50
51
|
date_time_sent:
|
@@ -10,6 +10,7 @@ sensitivity:
|
|
10
10
|
text: Normal
|
11
11
|
body_type: Text
|
12
12
|
body: ! "I get proper rendering as well.\r\n\r\nOn Dec 16, 2011, at 12:47 PM, Corey Donohoe<reply@reply.github.com>wrote:\r\n\r\n> Was this caching related or fixed already? I get proper rendering here.\r\n>\r\n> ![](https://img.skitch.com/20111216-m9munqjsy112yqap5cjee5wr6c.jpg)\r\n>\r\n> ---\r\n> Reply to this email directly or view it on GitHub:\r\n> https://github.com/github/github/issues/2278#issuecomment-3182418"
|
13
|
+
headers: ""
|
13
14
|
size:
|
14
15
|
text: '1658'
|
15
16
|
date_time_sent:
|
@@ -11,6 +11,7 @@ sensitivity:
|
|
11
11
|
body_type: Text
|
12
12
|
body: ! "This is a new post\r\nThanks & Regards,\r\n [http://etc.usf.edu/clipart/2400/2430/k_1_lg.gif]
|
13
13
|
iran lastname\r\n\"The Journey Goes on...\"\r\nCatch me @network<https://socio.ewsdomain.com/u/505>\r\n\r\n"
|
14
|
+
headers: ""
|
14
15
|
size:
|
15
16
|
text: '1658'
|
16
17
|
date_time_sent:
|
@@ -18,6 +18,7 @@ body: ! "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/ht
|
|
18
18
|
LastName</font><br>\r\n<font face=\"comic sans ms,sans-serif\">"Th</font><font
|
19
19
|
face=\"comic sans ms,sans-serif\">e Journey Goes on..."<br>\r\nCatch me
|
20
20
|
<a href=\"https://socio.ewsdomain.com/u/505\" target=\"_blank\">@network</a><br>\r\n</font><br>\r\n</body>\r\n</html>\r\n"
|
21
|
+
headers: ""
|
21
22
|
size:
|
22
23
|
text: '1324'
|
23
24
|
date_time_sent:
|
@@ -18,6 +18,7 @@ body: ! "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/ht
|
|
18
18
|
LastName</font><br>\r\n<font face=\"comic sans ms,sans-serif\">"Th</font><font
|
19
19
|
face=\"comic sans ms,sans-serif\">e Journey Goes on..."<br>\r\nCatch me
|
20
20
|
<a href=\"https://socio.ewsdomain.com/u/505\" target=\"_blank\">@network</a><br>\r\n</font><br>\r\n</body>\r\n</html>\r\n"
|
21
|
+
headers: ""
|
21
22
|
size:
|
22
23
|
text: '1324'
|
23
24
|
date_time_sent:
|
@@ -13,6 +13,7 @@ body: ! "This is a replied post from outlook\r\n________________________________
|
|
13
13
|
lastname, User (ewsdomain)\r\nSent: Monday, June 25, 2012 6:26 PM\r\nTo: network\r\nSubject:
|
14
14
|
New Post\r\n\r\nHi, This is a new post\r\n\r\n--\r\nThanks & Regards,\r\n [http://etc.usf.edu/clipart/2400/2430/k_1_lg.gif]
|
15
15
|
iran lastname\r\n\"The Journey Goes on...\"\r\nCatch me @network<https://socio.ewsdomain.com/u/505>\r\n\r\n"
|
16
|
+
headers: ""
|
16
17
|
size:
|
17
18
|
text: '1658'
|
18
19
|
date_time_sent:
|
@@ -18,6 +18,7 @@ body: ! "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/ht
|
|
18
18
|
LastName</font><br>\r\n<font face=\"comic sans ms,sans-serif\">"Th</font><font
|
19
19
|
face=\"comic sans ms,sans-serif\">e Journey Goes on..."<br>\r\nCatch me
|
20
20
|
<a href=\"https://socio.ewsdomain.com/u/505\" target=\"_blank\">@network</a><br>\r\n</font><br>\r\n</body>\r\n</html>\r\n"
|
21
|
+
headers: "X-Auto-Response-Suppress"
|
21
22
|
size:
|
22
23
|
text: '1324'
|
23
24
|
date_time_sent:
|
@@ -36,6 +36,7 @@ describe "FetchIncomingMail" do
|
|
36
36
|
match_results(result, mail)
|
37
37
|
convert_from_hash(mail)
|
38
38
|
result.from.should == "User.LastName@ewsdomain.com"
|
39
|
+
result.auto_response?.should == false
|
39
40
|
end
|
40
41
|
|
41
42
|
it "is trying to fetch a new mail" do
|
@@ -48,6 +49,7 @@ describe "FetchIncomingMail" do
|
|
48
49
|
match_results(result, mail)
|
49
50
|
convert_from_hash(mail)
|
50
51
|
result.from.should == "User.LastName@ewsdomain.com"
|
52
|
+
result.auto_response?.should == false
|
51
53
|
end
|
52
54
|
|
53
55
|
it "is trying to fetch a new replied mail" do
|
@@ -60,6 +62,7 @@ describe "FetchIncomingMail" do
|
|
60
62
|
match_results(result, mail)
|
61
63
|
convert_from_hash(mail)
|
62
64
|
result.from.should == "User.LastName@ewsdomain.com"
|
65
|
+
result.auto_response?.should == false
|
63
66
|
end
|
64
67
|
|
65
68
|
def match_results(result, mail)
|
@@ -3,7 +3,7 @@ require 'spec_helper.rb'
|
|
3
3
|
module Rockdove
|
4
4
|
class EWS
|
5
5
|
attr_accessor :to_recipients, :date_time_created, :date_time_sent, :from
|
6
|
-
attr_accessor :subject, :body, :body_type, :attachments, :has_attachments
|
6
|
+
attr_accessor :subject, :body, :body_type, :attachments, :has_attachments, :headers
|
7
7
|
|
8
8
|
def id
|
9
9
|
rand(10)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rockdove
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &78673310 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *78673310
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: guard-rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &78673040 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *78673040
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &78672730 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.2.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *78672730
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: simplecov
|
49
|
-
requirement: &
|
49
|
+
requirement: &78672480 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *78672480
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: raad
|
60
|
-
requirement: &
|
60
|
+
requirement: &78672220 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *78672220
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: viewpoint
|
71
|
-
requirement: &
|
71
|
+
requirement: &78671910 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - =
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 0.1.26
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *78671910
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: email_reply_parser
|
82
|
-
requirement: &
|
82
|
+
requirement: &78671640 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *78671640
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: logger
|
93
|
-
requirement: &
|
93
|
+
requirement: &78671350 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :runtime
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *78671350
|
102
102
|
description: Incoming mail processing daemon for Exchange Web Services (EWS). This
|
103
103
|
is the Ruby Gem that does fetching, parsing and watching the exchange mail box for
|
104
104
|
further processing.
|
@@ -155,7 +155,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
segments:
|
157
157
|
- 0
|
158
|
-
hash:
|
158
|
+
hash: -739065965
|
159
159
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
160
|
none: false
|
161
161
|
requirements:
|
@@ -164,10 +164,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
segments:
|
166
166
|
- 0
|
167
|
-
hash:
|
167
|
+
hash: -739065965
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project: rockdove
|
170
|
-
rubygems_version: 1.8.
|
170
|
+
rubygems_version: 1.8.10
|
171
171
|
signing_key:
|
172
172
|
specification_version: 3
|
173
173
|
summary: Incoming mail processing daemon for Exchange Web Services (EWS)
|