procmail
[Top] [All Lists]

Re: Maildir/ support looks a bit wierd

2000-12-13 08:46:42

  > Hi there, I am testing procmail extensively for Maildir support and I
  > discovered something that I think is now right, but I may be wrong.
  >
  > Almost every other software I use (or tried) say postfix, mutt, qmail
  > and courier-(mta|imap|webmail) stores mail in a very different way than
  > procmail (procmail being the exception here, not the rule).
  >
  > Other mailers save their mail to files that looks like this..
  > ~/Maildir/.list.procmail/cur/976672218.2600_9.synchro:2,RS
  > and procmails' version would look like this
  > ~/Maildir/.list.procmail/cur/_xw+yFuN6.synchro:2,S
  >
  > Any reason why it's done this way? Isn't it easier to use the time
  > format other that to cook up a random string (Is it actually random?)
  >
  > Any perceivable side effects, here? Especially for interoperability
  > between servers/procmail.


The procmail maintainer has answered this before:

 "It differs because a) it generates shorter filenames, and b) fits better
  into the procmail code base that way.  However, the exact format of
  the filenames is to be considered an implementation detail, so don't
  depend it."

It works well as far as it goes. And since programs are not supposed
to parse filenames I do not think procmail violates any rules.

HOWEVER: the fact is that several other programs, user agents and IMAP
servers with which procmail must interoperate, do parse the filenames.
I know of two reasons:

1) Sort the messages according to the time they were delivered by
   sorting them by filename (since the first item in the name is
   a timestamp)

2) Code the file size into the filename so that it is quicker to
   find the total size of a maildir later. Instead of stat'ing every
   message one needs only to read the directory, parse the filenames
   and add up the sizes. The Courier mail system uses this. Very useful
   and resource-saving if you use NFS mounted mailboxes. The name of
   a file with size 3067 bytes will for example be:

            96243352.4366.mailhost,S=3067:2,

A ",S=3067" has been added just before the colon. I highly recommend
that procmail change its Maildir file naming scheme to match the rest
of the world, even though I feel that procmails present behaviour
does not violate the `standard'. This will make it less painful for mail
admins to use procmail as their local delivery agent and thus contribute
to raise procmails popularity.

Personaly, as an administrator of a large mail system, I would very
much like to see number 2) above be implemented in procmail.

Or perhaps even better - let the user choose the format by optionaly
supplying procmail with a format string in /etc/procmailrc, for example:

        MAILDIRNAME = "%time.%pid.%host,S=%size"

-- 
Gjermund Sorseth
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail