[Spambayes] Re: imapfilter mangling headers!

Meyer, Tony T.A.Meyer at massey.ac.nz
Sun Apr 20 22:04:59 EDT 2003

> >             Pd = parsedate(message_date)
>               ^^ "pd"
That's stupid Outlook thinking it knows how to fix my spelling.

> >             print pd
> >             md = mktime(pd)
>                    ^^^^^^ "time.mktime"
That's stupid me, thinking I had imported that... ;)

>   File "imapfilter.py", line 180, in extractTime
>     md = time.mktime(pd)
> TypeError: argument must be 9-item sequence, not None

Well, it seems that it's the call to parsedate that's returning None.
I'll check in a fix, since it's easy enough, but it's strange.  The date
header must not be in the correct (RFC822) format.

>     >>> import imaplib
>     >>> imap = imaplib.IMAP4("mail.example.com")
>     >>> imap.login("username", "password")
>     ('OK', ['completed'])
>     >>> imap.select()
>     ('OK', ['5282'])
>     >>> imap.fetch("1:1", "(INTERNALDATE)")
>     ('OK', ['1 (INTERNALDATE "11-Mar-2003 18:37:56 +0000")'])
>     >>> imap.logout()
>     ('BYE', ['CommuniGate Pro IMAP closing connection'])
What's odd is that it's finding the INTERNALDATE, so it should be using
that, and not extractTime at all.  I'll look into this, but it might be
tomorrow before I get to it.

> No problem; I just wish I could get you an account so you 
> could try this stuff yourself.

:)  I do test on the two imap servers I have - one is Courier and one is
Netmail.  Even with just these two there are notable differences.

=Tony Meyer

More information about the Spambayes mailing list