[Spambayes] sb_imapfilter connection timeout handling

Klaas Hofstra spambayes at klaashofstra.com
Wed Sep 14 15:40:11 CEST 2005


Hi,

I really like sb_imapfilter, keep up the good work! I have a couple of 
questions about the filter:

For some reason the connection to my IMAP server is regularly closed down due 
to a timeout. sb_imapfilter does not seem to handle this well, because it 
exits with the text at the bottom of this mail (debug set to -i 4). Shouldn't 
sb_imapfilter be able to gracefully handle this timeout by stopping the 
current action, closing down the connection, reopening the connection and 
continuing?

Could a timeout lead to corrupted mail? I ask this because after running the 
filter I ended up with some mail with 'unknown' arrival date and some with 
'unknown' sender. 

If I understand correctly a filtered mail is recreated with the new header and 
the old mail is removed. Is the deletion done after it is affirmed that the 
recreated copy was successfully created?

Cheers,

Klaas


 11:32.61 < OLL1275 OK FETCH completed.
  11:32.61 > OLL1276 UID FETCH 217 (FLAGS INTERNALDATE)
  11:32.61 < * 217 FETCH (FLAGS (\Seen) INTERNALDATE "21-Jan-2005 13:45:56 
+0200" UID 217)
  11:32.61 < OLL1276 OK FETCH completed.
  11:32.61 > OLL1277 APPEND "INBOX/spambayes" (\Seen) "21-Jan-2005 13:45:56 
+0200" {2801}
  11:32.62 < + Ready for additional command text.
  11:32.62 write literal size 2801
  41:32.82 < * BYE Microsoft Exchange IMAP4rev1 server version 5.5.2654.50 
closing connection due to timeout
  41:32.82 BYE response: Microsoft Exchange IMAP4rev1 server version 
5.5.2654.50 closing connection due to timeout
  41:32.82 last 4 IMAP4 interactions:
  06:24.50 < * OK Microsoft Exchange IMAP4rev1 server version 5.5.2654.50 
(--------) ready
  06:24.50 > OLL0 CAPABILITY
  06:24.50 < * CAPABILITY IMAP4 IMAP4rev1 IDLE LITERAL+ LOGIN-REFERRALS 
MAILBOX-REFERRALS NAMESPACE AUTH=NTLM
  06:24.50 < OLL0 OK CAPABILITY completed.
.................................................................................................................*************************************************************************************************Traceback 
(most recent call last):
  File "/usr/bin/sb_imapfilter.py", line 947, in ?
    run()
  File "/usr/bin/sb_imapfilter.py", line 937, in run
    imap_filter.Filter()
  File "/usr/bin/sb_imapfilter.py", line 808, in Filter
    self.unsure_folder)
  File "/usr/bin/sb_imapfilter.py", line 722, in Filter
    for msg in self:
  File "/usr/bin/sb_imapfilter.py", line 613, in __iter__
    yield self[key]
  File "/usr/bin/sb_imapfilter.py", line 662, in __getitem__
    msg.Save()
  File "/usr/bin/sb_imapfilter.py", line 523, in Save
    self.as_string())
  File "/usr/lib/python2.4/imaplib.py", line 316, in append
    return self._simple_command(name, mailbox, flags, date_time)
  File "/usr/lib/python2.4/imaplib.py", line 1028, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python2.4/imaplib.py", line 860, in _command_complete
    raise self.abort('command: %s => %s' % (name, val))
imaplib.abort: command: APPEND => socket error: EOF


More information about the Spambayes mailing list