4 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Autocreate Home-Dir -...
FromSent OnAttachments
Thomas KoflerSep 20, 2007 2:31 am 
Tony EarnshawSep 20, 2007 4:02 am 
Thomas KoflerSep 20, 2007 4:16 am 
Ed WOct 3, 2007 2:41 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Autocreate Home-Dir - just 1 Bit missingActions...
From:Tony Earnshaw (ton@hetnet.nl)
Date:Sep 20, 2007 4:02:23 am
List:net.sourceforge.lists.courier-maildrop

Thomas Kofler skrev, on 20-09-2007 11:31:

we have a distributed server setup and want to auto-create the home-directory with maildrop (and then the Maildir itself).

The problem is, that maildrop tries to chroot to the users home directory - but that is of courese not work, when the home directory does not exist.

This has been "up" on this ML repeatedly; what you want isn't possible. The home directory has to exist first, with the correct owner:group and permissions. At the school site that I run, we have a dedicated mail server where users have no shell login, the whole mail hierarchy belongs to vmail:vmail (system user in /etc/passwd) and all the users are in LDAP.

Every hour vmail runs a script looking in LDAP for what the users' mail directory ought to be, and if the home directory with the Maildir under it doesn't exist, he makes them and sends a mail to postmaster with what he's done. So all I have to do is make new users in LDAP, with where their mail directories should be, and vmail does the rest (this fall there were approximately 170 new users).

I searched all relevant sources and the best solution would be to use the -d switch to change the default delivery user.

postfix-2.3.3-2 maildrop-2.0.4-3

So we changed /etc/postfix/master.cf to

maildrop unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/bin/maildrop -d vmail ${recipient} ${nexthop} ${sender}

That's ok if you have the same sort of setup we have; if Maildir is in a shell user's home directory, then it should be '-d ${user}'.

And 'user=vmail:vmail' should be 'user=vmail'.

with "-d vmail" maildrop should change to the user vmail and also chroot to that directory (/home in our case) and then execute /etc/maildroprc which then creates and delivers the mail to the right recipient.

But we get still the error message: (temporary failure. Command output: maildrop: Unable to change to home directory

If it doesn't exist, whichever user maildrop runs is can't change to it.

Does the use vmail have to be created on the system?

If you have the same setup as us, obviously. If there isn't a vmail user, he can't do anything. But if you have shell login users and use '-d ${user}', he doesn't have to exist (there's no point in having a vmail user).

Even if the delete the user vmail maildrop works for existing /home/$user/Maildir directories.

[...]

Best,

--Tonni