jello <jello(_at_)lava(_dot_)net> writes:
I've got two questions that I didn't see answered in the procmail
pointers page:
1) In the authenticate.c file, I see that #define MAILSPOOLHASH line
where you can say 0,1, or 2 will attempt to deliver to
/var/spool/mail/b/a/bar* , but what if I wanted to change where it
attempts to deliver the mail when I define 2? Ideally, I'm looking to
deliver to: /var/mail/b/a/bar* (taking spool out of the path).
Umm, just change the values for both MAILSPOOLDIR and MAILSPOOLHASH:
#ifndef MAILSPOOLDIR
#define MAILSPOOLDIR "/var/mail/" /* watch the trailing / */
#endif
#ifndef MAILSPOOLSUFFIX
#define MAILSPOOLSUFFIX "" /* suffix to force maildir or MH style */
#endif
#ifndef MAILSPOOLHASH
#define MAILSPOOLHASH 2 /* 2 would deliver to /var/spool/mail/b/a/bar */
#endif
2) Take a look at the following transcript from an attempt to deliver an
email with the hashing turned on:
procmail: Couldn't create "/var/spool/mail/a/r/arghya"
procmail: Lock failure on "/var/mail/a/r/arghya.lock"
procmail: Error while writing to "/var/mail/a/r/arghya" 550 5.0.0
<arghya(_at_)mail(_dot_)blah(_dot_)com>... Can't create output
I see that procmail is trying to create something (that currently
doesn't exist), but does it have the power to create the directories
necessary for delivery? Namely a/r inthe example above? If so is there
anything I have to do to help facilitate it?
You'll need to create all the /var/mail/[a-z]/[a-z] directories. The
first level should all be mode 755 and the second level should be mode
1777. The following shell script will do it for you:
#!/bin/sh
letters='a b c d e f g h i j k l m n o p q r s t u v w x y z'
for i in $letters
do
mkdir -m 755 /var/mail/$i 2>/dev/null
for j in $letters
do
mkdir /var/mail/$i/$j 2>/dev/null
done
chmod 1777 /var/mail/$i/?
done
If you allow numbers or other non-letter characters in the first two
characters of usernames then you should add them to the "letters" list
above.
Now, why doesn't procmail know how to create these itself? Well,
because we haven't gotten around to teaching it how, and it's such an
easy problem to fix when it comes up. Doing it correctly would require
some extensions to the internal interface to the src/authenticate.c
file, but it should be possible. It's not a high priority, so don't
hold your breath...
Philip Guenther
procmail maintainer
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail