hi
I tried to run an extension of the filter possibilities of sqwebmail taking into account the .qmail in the user home created by qmailadmin using the maildrop filter below. However I run into trouble if there is a forward address entry in the qmailadmin .qmail file (&[EMAIL PROTECTED]).


Everything works fine if I dont have &[EMAIL PROTECTED] in the .qmail file, files are delivered, vacancy message works etc. if I have a forward address set in .qmail the e-mail is not forwarded. There is no error visible in the logs, the e-mail simply disappears. If I select the forward and local store in qmailadmin, the e-mail is stored locally but not forwarded. If I have no .qmail file everything works fine. Is that a known problem? Is it already solved in newer versions of vpopmail (I use 5.3.24)?

thanks
andrej


# mailfilter written by [EMAIL PROTECTED] to # work with qmail, vpopmail, sqwebmail, qmailadmin # 1. check if .Spam maildir exists and deliver if its spam # 2. check if .qmail in virtual home and proceed with vdelivermail # 3. check if mailfilters from sqwebmail in virtual home and include them # 4. standard mail delivery with vdelivermail

# PREREQUISITS
# needs program to check if file exists /usr/bin/test
# file in ./Maildir or /usr/local/share/sqwebmail called maildirfilterconfig
# with
# MAILDIRFILTER=../.mailfilter
# MAILDIR=$VHOME/Maildir

# this filter is called by .qmail-default
# | maildrop mailfilter

SENDMAIL="/var/qmail/bin/sendmail"
VPOP="| /mailboxen/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
#VPOP="| /mailboxen/vpopmail/bin/vdelivermail '' /var/qmail/popboxes/vpopmail/domains/sfgb-b.ch/0/d.stettler


# virtual user home
VHOME=`/mailboxen/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]
HOME=$VHOME

#logfile $VHOME/log
logfile "/var/log/maildrop"

log "VPOP: $VPOP"
log "VHOME: $VHOME"
log "SENDMAIL: $SENDMAIL"

`/usr/bin/test -d $VHOME`
if( $RETURNCODE != 0 )
  {
  echo 'Sorry, no mailbox here by that name. vpopmail (#5.1.1)'
  EXITCODE=100
  log "bouncing"
  exit
}


#log $SENDMAIL


# spam directory for automatic spam filtering
SPAMDIR="$VHOME/Maildir/.Spam"
`/usr/bin/test -d $SPAMDIR`
SPAMDIRF="$RETURNCODE"
log "SPAMDIR: $SPAMDIR SPAMDIRF: $SPAMDIRF"


# dotqmail DOTQMAIL="$VHOME/.qmail" `/usr/bin/test -f $DOTQMAIL` DOTQMAILF="$RETURNCODE" log "DOTQMAIL: $DOTQMAIL DOTQMAILF: $DOTQMAILF"

# further maildrop filters (configured via sqwebmail)
SQMAILF="$VHOME/.mailfilter"
`/usr/bin/test -f $SQMAILF`
SQMAILFF="$RETURNCODE"
log "SQMAILF: $SQMAILF SQMAILFF: $SQMAILFF"




if ($SPAMDIRF == 0) { if (/^X-Spam-Flag: *YES/) { log "xspam yes and spamdir exists" exception { # to Spamfolder to "$SPAMDIR" } } }

if ($DOTQMAILF == 0)
{
  exception {
    # proceed with .qmail
    log ".qmail exists"
    to "$VPOP"
  }
}

if ($SQMAILFF == 0)
{
  exception {
    # proceed with maildrop filters
    log "include filters"
    include $VHOME/.mailfilter
  }
  exception {
    # proceed
    log "standard delivery after filter inclusion"
    to "$VPOP"
  }

}
else
{
  exception {
    # proceed
    log "standard delivery"
    to "$VPOP"
  }
}

log "end"

Reply via email to