On Tue, Oct 17, 2006 at 04:02:39PM -0300, Renato Otranto Jr. wrote:
Hello,
I'm using postfix + maildrop autheticating against an AD server.
My maildrop version is 2.0.2.
I need to create the new maildirs automatically, so, I wrote the
following /etc/maildroprc file:
---------------------------------------------------------------
MAIL = "$HOME"
QUOTA="$MAILDIRQUOTA"'S'
`echo "$HOME --> $QUOTA" >> /tmp/result`
`test -d $MAIL`
if( $RETURNCODE == 1)
{
`mkdir -m 0700 -p $MAIL`
`maildirmake $MAIL/Maildir`
}
`test -e $MAIL/Maildir/maildirsize`
if ($RETURNCODE == 1)
{
`maildirmake -q $QUOTA $MAIL/Maildir`
}
---------------------------------------------------------------
After some tests, I observed that if the maildir exists, the maildroprc
file is read normally, but if the maildir don't exists yet, the maildroprc
file is not read. I could observe this, with the 'echo' command at the
begin of file.
If the maildir exists, but it don´t have quota setted up (with
maildirsize file)
after the maildir has been created manually, the maildroprc is able to set
the maildir quota file.
Anybody knows why my maildroprc file is not read if the maildir don´t
exists?
Well, a quick parse through maildrop/main.C shows that maildrop first
tries to chdir to the user's home directory and then later tries to
load and parse the maildroprc. If the home directory doesn't exist or
has one of a myriad other problems, maildrop exits with very helpful
error messages pointing out exactly what the problem was.
Maildrop, rightly, assumes that if the user's home directory doesn't
exist, then delivery is hopeless and gives up before going any
farther.
It's not maildrop's job to create home and maildir directories. That
should be part of your user creation process. (Someday I'm going the
check the archives to see how often I've said that.)