procmail
[Top] [All Lists]

Re: Dots in usernames and MAILSPOOLHASH=2

1998-04-27 10:12:20
furio ercolessi <furio(_at_)spin(_dot_)it> writes:
I am new to procmail, and trying to implement a MAILSPOOLHASH=2
mailspool (/var/spool/mail/b/a/bar) in conjunction with sendmail 8.9.0.
I am using 3.11pre7, on a Linux RedHat 5.0 platform.

All seems to work, but.... I suddenly realized that I might have
problems with usernames of the form "J.User".  In fact, this would
map into /var/spool/mail/j/./j.user , and in Unix semantics 
this is of course equivalent to  /var/spool/mail/j/j.user.
In fact, I have tested that the mail sent to such an user would
end up stored right there, one level up with respect to all the others.

Is everybody happy with that? :-)

The placement is odd, but it should work just fine.  You could hack
around it, but is it worth the effort?  Don't forget to handle
usernames that begin with a dot (that would be gross, but you *must*
write bulletproof code in a delivery agent)!

As a side-issue for the curious, if the length of the username is less
than MAILSPOOLHASH, the last character in the username is repeated as
needed to fill out the 'hash tree', and the real username is used as
the filename is the directory itself.  I.e., with MAILSPOOLHASH=4:

        guenther => /var/spool/mail/g/u/e/n/guenther
        joe      => /var/spool/mail/j/o/e/e/joe
        al       => /var/spool/mail/a/l/l/l/al


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>