mlist 0.1.17 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/VERSION.yml +1 -1
- data/lib/mlist/email_server/imap.rb +7 -0
- data/spec/integration/imap_email_server_spec.rb +8 -4
- metadata +3 -3
data/CHANGELOG
CHANGED
data/VERSION.yml
CHANGED
@@ -58,6 +58,13 @@ module MList
|
|
58
58
|
if rfc822 = @imap.fetch(id, 'RFC822')
|
59
59
|
content = rfc822[0].attr['RFC822']
|
60
60
|
process_message(content)
|
61
|
+
elsif settings[:failure_folder]
|
62
|
+
begin
|
63
|
+
@imap.move(id, settings[:failure_folder])
|
64
|
+
rescue Net::IMAP::NoResponseError
|
65
|
+
@imap.create(settings[:failure_folder])
|
66
|
+
retry
|
67
|
+
end
|
61
68
|
end
|
62
69
|
end
|
63
70
|
|
@@ -26,11 +26,14 @@ end
|
|
26
26
|
describe MList::EmailServer::Imap, 'processing' do
|
27
27
|
before do
|
28
28
|
@imap_server = 'mock_imap_server'
|
29
|
-
@imap = MList::EmailServer::Imap.new({
|
29
|
+
@imap = MList::EmailServer::Imap.new({
|
30
|
+
:archive_folder => 'Archive',
|
31
|
+
:failure_folder => 'Failures'
|
32
|
+
})
|
30
33
|
@imap.instance_variable_set('@imap', @imap_server)
|
31
34
|
end
|
32
35
|
|
33
|
-
it 'should process the provided folders' do
|
36
|
+
it 'should process the provided source folders' do
|
34
37
|
imap = MList::EmailServer::Imap.new(:source_folders => ['Inbox', 'Spam'])
|
35
38
|
mock(imap).process_folder('Inbox')
|
36
39
|
mock(imap).process_folder('Spam')
|
@@ -55,9 +58,10 @@ describe MList::EmailServer::Imap, 'processing' do
|
|
55
58
|
@imap.process_message_id(1)
|
56
59
|
end
|
57
60
|
|
58
|
-
it 'should not
|
61
|
+
it 'should not receive messages with no RFC822 content, moving them to the failure folder' do
|
59
62
|
mock(@imap_server).fetch(1, 'RFC822') { nil }
|
60
|
-
|
63
|
+
mock(@imap_server).move(1, 'Failures')
|
64
|
+
@imap.process_message_id(1)
|
61
65
|
end
|
62
66
|
|
63
67
|
it 'should wrap up RFC822 content in a TMail::Mail object' do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 18
|
9
|
+
version: 0.1.18
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Adam Williams
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-11 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|