Hi,
i have maildrop for final delivery and let it create the maildir if it
doesnt exist,
it also autosubscribes some folders via adding the folders to
courierimapsubscribed.
My problem is that it also adds these entries, even if it existes.
It seems to ignore the "if" no matter how I define it.
on the bottom the spam check works perfect and it moves mail only
to the junk folder if its really junk.
can someone please help
thx
/etc/maildroprc
# Ruta al /home/vmail/domains
VHOME="/home/vmail/"
# This extracts the username part from username at domain.tld
ACCOUNT=`echo "$LOGNAME" | cut -d@ -f1`
# This extracts the domain name from username at domain.tld
USERDOMAIN=`echo "$LOGNAME" | cut -d@ -f2`
# Path to the file where we will log the account creation.
VMAIL_LOGFILE="/home/vmail/maildrop-maildirmake.log"
# Path to maildirmake
MAILDIRMAKE=/usr/bin/maildirmake
ISDIR=0
# Let's check if /home/vmail/domain.tld/username exists
`if [ -d "$VHOME/$USERDOMAIN/$ACCOUNT" ];then ISDIR="1"; fi`
# `test -d "$VHOME/$USERDOMAIN/$ACCOUNT"`
#`test -d $DEFAULT`
if ( $ISDIR == 1 )
{
exception {
MESSAGE_DATE = `date`
# Log the creation date of this account in maildrop-maildirmake.log
`echo CREATION DATE: "$MESSAGE_DATE" >> $VMAIL_LOGFILE`
# Log the full path of the mailbox directory in maildrop-maildirmake.log
`echo EMAIL DIRECTORY: "$VHOME/$USERDOMAIN/$ACCOUNT" >> $VMAIL_LOGFILE`
# Log the username at domain.tld in maildrop-maildirmake.log
`echo USER EMAIL LOGIN: "$LOGNAME" >> $VMAIL_LOGFILE`
# Append a blanck line to maildrop-maildirmake.log
`echo " " >> $VMAIL_LOGFILE`
# Now check if the domain directory /home/vmail/dominio.tld exists.
`test -d "$VHOME/$USERDOMAIN"`
if( $RETURNCODE == 1 )
{
# Log the domain directory to maildrop-maildirmake.log
`echo CREATING DIRECTORY: "$VHOME/$USERDOMAIN" >> $VMAIL_LOGFILE`
# This creates the domain directory under /home/vmail/domains/
`mkdir -p "$VHOME/$USERDOMAIN"`
# Append a blanck line to maildrop-maildirmake.log
`echo " " >> $VMAIL_LOGFILE`
}
# Create the mailbox directory for the new account, this will be:
# /home/vmail/domains/domain.tld/username/
`$MAILDIRMAKE "$VHOME/$USERDOMAIN/$ACCOUNT"`
# Lets create the Sent directory for IMAP users
`$MAILDIRMAKE -f Sent "$VHOME/$USERDOMAIN/$ACCOUNT"`
# Suscribe the new Sent directory to the suscribed folders, only
for courier-imap users.
`echo INBOX.Sent >> $VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed`
# Lets create the Thrash directory for IMAP users
`$MAILDIRMAKE -f Trash "$VHOME/$USERDOMAIN/$ACCOUNT"`
# Suscribe the new Trash directory to the suscribed folders, only
for courier-imap users.
`echo INBOX.Trash >> $VHOME/$USERDOMAIN/$ACCOUNT/courierimapsubscribed`
# Create the curierimapuiddb directory under the user maildir
`touch $VHOME/$USERDOMAIN/$ACCOUNT/courierimapuiddb`
# Create the courierimapkeywords file under the user maildir
`mkdir -p "$VHOME/$USERDOMAIN/$ACCOUNT/courierimapkeywords"`
#####
# Create maildirsize quota file
`touch $VHOME/$USERDOMAIN/$ACCOUNT/maildirsize`
`echo 52428800S >> $VHOME/$USERDOMAIN/$ACCOUNT/maildirsize`
}
}
# GLOBAL VARIABLES
# HOME=/home/vmail/dominios
# LOGNAME=username at dominio.tld
# DEFAULT=dominio.tld/username/
# Log everything to this file
logfile "/home/vmail/maildrop.log"
# LOG BEGING OF FILTERING
log "==== BEGIN maildrop processing for $LOGNAME ==="
exception {
log "Including $HOME/$DEFAULT.mailfilter"
include "$HOME/$DEFAULT.mailfilter"
}
##
# move spam to spamfolder
##
SPAMFLD=$DEFAULT/.Junk/
SUBSCRIPT=$DEFAULT/courierimapsubscribed
# test idf Junk folder exists, if notr create one
# autosubscribe to the Junk folder
`test -d "$SPAMFLD"`
if( $RETURNCODE == 1 )
{
`maildirmake "$SPAMFLD"`
`echo INBOX.Junk >> $SUBSCRIPT`
}
## verschiebe die mail in den Junk Ordner, wenn Spam
if (/^X-Spam-Status: Yes,/)
{
exception {
to $SPAMFLD
}
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users