[Dovecot] 1.0-test22 - maildir fixed?

Maikel Verheijen maikel at ladot.com
Tue Jun 29 15:02:18 EEST 2004


On Jun 28, 2004, at 10:12 PM, Timo Sirainen wrote:

> On 28.6.2004, at 22:57, Moe Wibble wrote:
>
> Perhaps Dovecot should require at least minimal compliance from maildir
> filenames so problem like these wouldn't happen. IIRC Courier requires
> that filename starts with digit, otherwise it isn't touched.
>
> Anyone have opinions either way?
Why not hold on to the maildir standard and enforce that? Maybe 
complain about invalid mail-files?

http://cr.yp.to/proto/maildir.html contains the following passage:
Okay, so you're writing messages. A unique name has three pieces, 
separated by dots. On the left is the result of time() or the second 
counter from gettimeofday(). On the right is the result of 
gethostname(). (To deal with invalid host names, replace / with \057 
and : with \072.) In the middle is a delivery identifier, discussed 
below.

Which states it should contain 3 dots, the left portion should be a 
timestamp,  the middle "an identifier" and the right hand side a 
hostname. This means you can check if it has a) 2 dots (3 pieces) and 
starts with a valid timestamp?
>
> One reason why I haven't added any checks is because while testing I
> often create filenames such as "foo", "foo2", etc. Might take a while
> to start remembering that digit is required as first character.

This is indeed a pain if you don't follow the maildir standard. However 
it is pretty easy to generate a "custom" mailfile-name creator :)
eg: printf "%d.%d.%s\n" `date +%s` "$$" `hostname -s `

Kind regards,

Maikel Verheijen
Ladot Nederland BV.




More information about the dovecot mailing list