View Single Post
  #10  
Old 27th July 2011, 13:50
labanczjoe labanczjoe is offline
Junior Member
 
Join Date: Jun 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello!

Sorry , here is my full .mailfilter file : copy/paste user error

#
# Import variables
#
logfile "/temp/maildrop3.log"
LOGNAME=tolower("$LOGNAME")
EXTENSION="$1"
RECIPIENT=tolower("$2")
USER=tolower("$3")
HOST=tolower("$4")
SENDER="$5"
DEFAULT="/var/vmail/$HOST/$USER/."
#logfile "/var/mail/$HOST/$USER/mailfilter.log"

# Workaround for broken tolower function in some current fedora releases

if(!$USER)
{
USER=$3
}
if(!$HOST)
{
HOST=$4
}

if ( "$EXTENSION" ne "" )
{
DELIMITER="+"
}

if (!$SENDER)
{
SENDER = "<>"
}

#
# Autocreate maildir, if not existant
#

`test -e /var/vmail/$HOST`
if ( $RETURNCODE != 0 )
{
`mkdir /var/vmail/$HOST`
}

`test -e /var/vmail/$HOST/$USER`
if ( $RETURNCODE != 0 )
{
# `maildirmake /var/vmail/$HOST/$USER`
# `chmod -R 0700 /var/vmail/$HOST`
}


`test -e /var/vmail/$HOST/$USER`
if ( $RETURNCODE != 0 )
{
# available exitcodes: EX_NOUSER=67, EX_TEMPFAIL=75
EXITCODE = 67
exit
}
# Check if the user has a autoresponder enabled

`test -f /var/vmail/mailfilters/$HOST/$USER/.autoresponder`
if ( $RETURNCODE == 0 )
{
include "/var/vmail/mailfilters/$HOST/$USER/.autoresponder"
}

# Create a mailsize file
`echo $SIZE >> /var/vmail/$HOST/$USER/ispconfig_mailsize`


#
# Test if the user has his own maildrop include,
# 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 /var/vmail/mailfilters/$HOST/$USER/.mailfilter`
if ( $RETURNCODE == 0 )
{
include "/var/vmail/mailfilters/$HOST/$USER/.mailfilter"
}
else
{
if ( "$DEFAULT" ne "" )
{
to "$DEFAULT"
}
else
{
EXITCODE=75
exit
}
}
Reply With Quote