Postfix,为每个用户独立进行基于规则的过滤

我成功地创build了一个白名单发件人电子邮件filter,请参阅: 这里 。

我现在的目标是为每个用户设置单独的filter。 我想过滤出所有的电子邮件发送到组的电子邮件[email protected] ,但我不希望限制个人电子邮件user{(1-9)*}@mydomain.com 。 别名文件设置为all: user1, user2, user3 ...

这是基于用户的邮件过滤可能或者我应该尝试更复杂的东西,如触发电子邮件接收的php script请参阅: 这里 ?

更新:

最后,因为没有更好的方法,我在这里 (和这里 )的例子,我修改了bash文件来执行我自己的filter。 仍在寻找更优雅的解决scheme。

这是一个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 }