[Spambayes] Re: imapfilter mangling headers!
T.A.Meyer at massey.ac.nz
Sun Apr 20 15:16:57 EDT 2003
> > I've checked in a fix for this.
> Not yet, I think. After an update:
> %python imapfilter.py -c -D ~/bayes.db
> Traceback (most recent call last):
> File "imapfilter.py", line 509, in ?
> File "imapfilter.py", line 499, in run
> File "imapfilter.py", line 391, in Filter
> File "imapfilter.py", line 350, in Filter
> File "imapfilter.py", line 201, in Save
> msg_time = self.extractTime()
> File "imapfilter.py", line 178, in extractTime
> return imaplib.Time2Internaldate(\
> TypeError: argument must be 9-item sequence, not None
A couple of things that are odd here. The first is that extractTime
should almost never be called now - the imap server should provide the
time. Could you execute the following and tell me what you get?
(replacing the server-specific stuff, obviously)
>>> import imaplib
>>> imap = imaplib.IMAP4("mail.example.com")
>>> imap.login("username", "password")
>>> imap.fetch("1:1", "(INTERNALDATE)")
The other odd thing is that the date header is definitely present
(otherwise line 178 wouldn't execute) so it's either parsedate or mktime
that's returning None. Could you change line 178 to this and let me
know what prints out?
Pd = parsedate(message_date)
md = mktime(pd)
t2i = imaplib.Time2Internaldate(md)
Thanks for the help in tracing these down. Given the way that each imap
server software seems to put it's own interpretation on the RFC, we need
as many testers as possible.
More information about the Spambayes