Newer
Older
tbrehm
committed
#
# Import variables
#
LOGNAME=tolower("$LOGNAME")
EXTENSION="$1"
RECIPIENT=tolower("$2")
USER=tolower("$3")
HOST=tolower("$4")
tbrehm
committed
SENDER="$5"
DEFAULT="{dist_postfix_vmail_mailbox_base}/$HOST/$USER/."
# Workaround for broken tolower function in some current fedora releases
if(!$USER)
{
USER=$3
}
if(!$HOST)
{
HOST=$4
}
tbrehm
committed
if ( "$EXTENSION" ne "" )
{
DELIMITER="+"
}
if (!$SENDER)
{
SENDER = "<>"
}
#
# Autocreate maildir, if not existant
#
#`test -e {dist_postfix_vmail_mailbox_base}/$HOST`
#if ( $RETURNCODE != 0 )
#{
# `mkdir {dist_postfix_vmail_mailbox_base}/$HOST`
#}
tbrehm
committed
#`test -e {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
#if ( $RETURNCODE != 0 )
#{
# `maildirmake {dist_postfix_vmail_mailbox_base}/$HOST/$USER`
# `chmod -R 0700 {dist_postfix_vmail_mailbox_base}/$HOST`
#}
tbrehm
committed
# Check if the user has a autoresponder enabled
`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder`
if ( $RETURNCODE == 0 )
{
include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.autoresponder"
}
`echo $SIZE >> {dist_postfix_vmail_mailbox_base}/$HOST/$USER/ispconfig_mailsize`
tbrehm
committed
#
# Test if the user has his own maildrop include,
tbrehm
committed
# if not available, check if $DEFAULT is set
# (newer maildrop get's that from the DB and updates
# it) and deliver or fail temporarily if not available
#
`test -f {dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter`
tbrehm
committed
if ( $RETURNCODE == 0 )
{
include "{dist_postfix_vmail_mailbox_base}/mailfilters/$HOST/$USER/.mailfilter"