4 messages in net.sourceforge.lists.courier-maildrop[maildropl] Autocreate Home-Dir - jus...
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:[maildropl] Autocreate Home-Dir - just 1 Bit missingActions...
From:Thomas Kofler (mail@kofler.eu.org)
Date:Sep 20, 2007 2:31:09 am
List:net.sourceforge.lists.courier-maildrop

Hi,

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.

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}

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 .)

Does the use vmail have to be created on the system? Even if the delete the user vmail maildrop works for existing /home/$user/Maildir directories.

Any help is really welcome.

"/etc/maildroprc"

SHELL="/bin/bash" DEFAULT = "$HOME/Maildir" MAILDIR = "$HOME/Maildir"

# # Logfile destination # After your satisifed that this is working properly, comment out all # the lines that start with "log" # logfile "/var/log/maildrop.log"

VHOME="/home" ACCOUNT=`echo "$LOGNAME" | cut -d@ -f1` USERDOMAIN=`echo "$LOGNAME" | cut -d@ -f2` LOGINNAME = $LOGNAME

`test -d "$VHOME/$LOGINNAME"` if( $RETURNCODE == 1 ) { MESSAGE_DATE = `date` `echo CREATION DATE: "$MESSAGE_DATE" >> $logfile` `echo EMAIL DIRECTORY: "$VHOME/$LOGINNAME" >> $logfile` `echo USER EMAIL LOGIN: "LOGINNAME" >> $logfile` `echo USER QUOTA SIZE: "$MAILDIRQUOTA" >> $logfile` `echo " " >> $logfile`

`echo CREATING DIRECTORY: "$VHOME/$LOGINNAME" >> $logfile` `mkdir -p "$VHOME/$LOGINNAME"` `echo CREATING MAILDIR: "$VHOME/$LOGINNAME/Maildir" >> $logfile` `echo " " >> $logfile` `maildirmake "$VHOME/$LOGINNAME/Maildir"` `chmod -R 755 $LOGINNAME "$VHOME/$LOGINNAME"` `chown -R $LOGINNAME "$VHOME/$LOGINNAME"` `chmod -R 700 $LOGINNAME "$VHOME/$LOGINNAME/Maildir"` }

`test -r $VHOME/$LOGINNAME/.mailfilter` if( $RETURNCODE == 0 ) { log "(==) Including $VHOME/$LOGINNAME/.mailfilter" exception { include $VHOME/$LOGINNAME/.mailfilter } }

to "$VHOME/$LOGINNAME/Maildir"