邮件规则
一,安装pcre和maildrop
tar -jzxf maildrop
./configure
make
make install
对某一用户进行过滤,在其邮箱内用.qmail .mailfilter来完成
对整个域中所有用户的邮件进行过滤,用.qmail-default .mailfilter来完成
.qmail, .mailfilter需新建,文件属性。
chmod 600 .mailfilter
chown vpopmail:vchkpw .mailfilter
chmod 600 .qmail
chown vpopmail:vchkpw .qmail
.qmail内容:
|/usr/local/bin/maildrop ./.mailfilter
if (/^FROM: )
{
cc "/home/vpopmail/domains/vico-lab.com/test/maildir"
to "./maildir/."
}
if (/^Subject: failure notice/)
{
cc "/home/vpopmail/domains/vico-lab.com/test/maildir"
to "./maildir/."
}
过滤整个域时,需要修改.qmail-default,新建.mailfilter文件
vi .qmail-default
| /usr/local/bin/maildrop ./.mailfilter
| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
if (/^From: )
{
cc "/home/vpopmail/domains/vico-laba.com/test/Maildir"
}
本文转自holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/310776