2

I managed to create successfully a white-list sender email filter see: here.

My goal now is to have separate filter for each user. I would like to filter out all the emails based on the rules created send to the group email all@mydomain.com, but I do not wish to limit the personal emails to user{(1-9)*}@mydomain.com. The aliases file is setup as all: user1, user2, user3 ....

Is this user based mail filtering possible or should I try something more complex such as triggering a php script on email reception see: here?

Update:

In the end, as there was no better way I followed the example here (and here), where I modified the bash file to execute my own filters. Still looking for a more elegant solution.

Stanislav
  • 121
  • 1
  • 3

1 Answers1

1

It's a example for maildrop:

SHELL="/bin/bash"
import EXT
import HOST
VPOP="| /home/vpopmail/bin/vdelivermail '' delete"
VHOME=`/home/vpopmail/bin/vuserinfo -d $EXT@$HOST`

DUMMY=`test -d $VHOME/Maildir`
if ( $RETURNCODE == 1 )
{
   echo "Sorry, no mailbox here by that name. (#5.1.1)"
   EXITCODE=100
   exit
}

DUMMY=`test -d $VHOME/Maildir/.Spam`
if ( $RETURNCODE == 1 )
{
   DUMMY=`/usr/bin/maildirmake -f Spam $VHOME/Maildir`
#   DUMMY=`echo Inbox.Spam >> $VHOME/Maildir/courierimapsubscribed`
}

#if ( $SIZE < 4621440 )
#{
#xfilter "/usr/local/bin/spamc -f -u nobody"
#}

if (/^X-Barracuda*/)
{
        echo "60.11 Message delivered to home dir"
        to "$VPOP"
        exit
}
else
{
        to "$VHOME/Maildir/.Spam"
        echo "Message delivered to $VHOME/Maildir/.Spam"
        exit
}
PersianGulf
  • 602
  • 8
  • 21