[Python-bugs-list] mailbox module's maildir class broken? (PR#414)

guido@beopen.com guido@beopen.com
Wed, 26 Jul 2000 17:31:49 -0400 (EDT)


> I'm using the "mailbox" module that comes with python. I'm trying to
> use the maildir class in there, but I think it's not following the
> maildir protocol properly. The maildir protocol specifies that in a
> Maildir, a message file can have any name that is unique, as long as
> it doesn't begin with a period.  However, the maildir class looks
> for valid message filenames, by checking to see if the filename has
> more than 1 period in it, ie. consists of 3 or more sections
> separated by periods. Typically, this is the sort of name one finds
> in a Maildir, because the Maildir protocol page describes one simple
> way of creating a unique filename, ie. by using the timestamp, pid
> of the writer, and the hostname. However, when I insert messages
> into a maildir which don't follow that system of generating unique
> filenames, the maildir class of the module doesn't see
> them. Additioanlly, it _does_ see message files which begin with a
> period, eg. .12345678.1234.hostname. This is also a violation of the
> maildir protocol. I believe that a maildir reader should simply look
> at all files in a maildir, no matter what the name, except for those
> that begin with a period.

You're probably right.  I've never used that code, and according to
the logs it was contributed to Mike Meyer (no email known).  Perhaps
you would be willing to create a patch?  See
http://www.python.org/patches/ for submission guidelines.

--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)