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 CHANGED
@@ -1,3 +1,7 @@
1
+ *0.1.18 [Enhancement] (2010-06-11)
2
+
3
+ * Moving mail that has no rfc822 content into a settings[:failure_folder], if that setting is provided. [aiwilliams]
4
+
1
5
  *0.1.17 [Bug Fix] (2010-05-04)
2
6
 
3
7
  * Fixed bug where rfc822 was missing. [mikehale]
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
+ :patch: 18
2
3
  :major: 0
3
4
  :build:
4
5
  :minor: 1
5
- :patch: 17
@@ -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({:archive_folder => 'Archive'})
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 blow up if an RFC822 does not exist' do
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
- lambda { @imap.process_message_id(1) }.should_not raise_error
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
- - 17
9
- version: 0.1.17
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-05-04 00:00:00 -04:00
17
+ date: 2010-06-11 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20