View Single Post
  #4  
Old 16th July 2008, 22:10
tecstream tecstream is offline
Junior Member
 
Join Date: Jun 2008
Posts: 10
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I found that the creation of the vmail folder was related to an incorrect maildroprc file. (listed below) I have fixed that file but still I do not get an auto created mail directory. Also even if I create the file via maildirmake I still get the unable to open the mailbox error (also shown below)

vmail is the owner and group and files permissions are 0700

maildroprc old file

#Global maildrop filter file
#DEFAULT="$HOME/.maildir/"

#
# Define variables
#
SHELL="/bin/bash"
EXTENSION="$1"
RECIPIENT=tolower("$2")
HOME="/home/vmail"
USER="$3"
HOST="$4"
SENDER="$5"
DEFAULT="$HOME/vmail/$HOST/$USER"
MAILDIR="$HOME/vmail/$HOST/$USER"

logfile "/var/log/maildroprc.log"
log "Markers: ---------------------------------------------"
log " (**) from config file, (II) informational, (WW) warning"
log "--------------------------------------------------------"
log ""


################################################## ####################
#
# Adding missing headers for PGP/MIME
#

BPM="-----BEGIN PGP MESSAGE-----"
EPM="-----END PGP MESSAGE-----"
BPS="-----BEGIN PGP SIGNATURE-----"
EPS="-----END PGP SIGNATURE-----"

if (!/^Content-Type: message/ && !/^Content-Type: multipart/ \
&& !/^Content-Type: application\/pgp/)
{
if (/^$BPM/:b && /^$EPM/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=encrypt'"

if (/^$BPS/:b && /^$EPS/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=sign'"
}


################################################## ###################
#
# Correcting wrong signature dashes
#

if (/^--($|[ ]{2,}^)/:b)
{
xfilter "sed -r 's/^--($|[ ]{2,}^)/-- /'"
log "(II) Sig Dashes corrected"
}

# Include any rules set up for the user - this gives the
# administrator a way to override the domain's mailfilter file
#
# this is also the "suggested" way to set individual values
# for maildrop such as quota. (why do you need quota on your own PC?)
#
`test -e $HOME/vmail/$HOST`
if ( $RETURNCODE != 0 )
{
`/bin/mkdir $HOME/vmail/$HOST`
`/bin/chown vmail.vmail $HOME/vmail/$HOST`
`/bin/chmod 0700 $HOME/$HOST`
}

`test -e $HOME/vmail/$HOST/$USER`
if ( $RETURNCODE != 0 )
{
`/usr/bin/maildirmake $HOME/vmail/$HOST/$USER`
`/bin/chown -R vmail.vmail $HOME/vmail/$HOST`
`/bin/chmod -R 0700 $HOME/vmail/$HOST`
}

`test -r $HOME/vmail/mailfilters/$HOST`
if( $RETURNCODE == 0 )
{
log "(==) Including $HOME/mailfilters/$HOST"
include $HOME/mailfilters/$HOST
}

maildroprc new file


#Global maildrop filter file
#DEFAULT="$HOME/.maildir/"

#
# Define variables
#
SHELL="/bin/bash"
EXTENSION="$1"
RECIPIENT=tolower("$2")
HOME="/home/vmail"
USER="$3"
HOST="$4"
SENDER="$5"
DEFAULT="$HOME/$HOST/$USER"
MAILDIR="$HOME/$HOST/$USER"

logfile "/var/log/maildroprc.log"
VERBOSE="9"
log "Markers: ---------------------------------------------"
log " (**) from config file, (II) informational, (WW) warning"
log "--------------------------------------------------------"
log ""


################################################## ####################
#
# Adding missing headers for PGP/MIME
#

BPM="-----BEGIN PGP MESSAGE-----"
EPM="-----END PGP MESSAGE-----"
BPS="-----BEGIN PGP SIGNATURE-----"
EPS="-----END PGP SIGNATURE-----"

if (!/^Content-Type: message/ && !/^Content-Type: multipart/ \
&& !/^Content-Type: application\/pgp/)
{
if (/^$BPM/:b && /^$EPM/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=encrypt'"

if (/^$BPS/:b && /^$EPS/:b)
xfilter "reformail -A 'Content-Type: application/pgp; format=text; \
x-action=sign'"
}


################################################## ###################
#
# Correcting wrong signature dashes
#

if (/^--($|[ ]{2,}^)/:b)
{
xfilter "sed -r 's/^--($|[ ]{2,}^)/-- /'"
log "(II) Sig Dashes corrected"
}

# Include any rules set up for the user - this gives the
# administrator a way to override the domain's mailfilter file
#
# this is also the "suggested" way to set individual values
# for maildrop such as quota. (why do you need quota on your own PC?)
#
`test -e $HOME/$HOST`
if ( $RETURNCODE != 0 )
{
`/bin/mkdir $HOME/$HOST`
`/bin/chown vmail.vmail $HOME/$HOST`
`/bin/chmod 0700 $HOME/$HOST`
}

`test -e $HOME/$HOST/$USER`
if ( $RETURNCODE != 0 )
{
`/usr/bin/maildirmake $HOME/$HOST/$USER`
`/bin/chown -R vmail.vmail $HOME/$HOST`
`/bin/chmod -R 0700 $HOME/$HOST`
}

`test -r $HOME/mailfilters/$HOST`
if( $RETURNCODE == 0 )
{
log "(==) Including $HOME/mailfilters/$HOST"
include $HOME/mailfilters/$HOST
}



maillog

Jul 16 16:05:05 demo authdaemond: Authenticated: clearpasswd=<null>, passwd=$1$954a669d$zcDxyF.55ZLtPu9rJHLU1/
Jul 16 16:05:05 demo maildrop[7982]: Unable to open mailbox.
Jul 16 16:05:05 demo postfix/pipe[7981]: 436AEA0259: to=<mark.mac@example.com>, relay=maildrop, delay=12038, delays=12038/0.05/0/0.07, dsn=4.3.0, status=deferred (temporary failure. Command output: /usr/bin/maildrop: Unable to open mailbox. )
Reply With Quote