MDA配置
概念:MDA mail deliver agent其实就是邮件投递代理,postfix本身有很多邮件投递代理,由于我们的环境虚拟域所以可以使用postfix自己的virtual 这个代理,但是它必须创建一个用户来执行投递操作,main.cf中有记录象这样:
virtual_uid_maps = static:1000
virtual_gid_maps = static:1000
virtual_transport = virtual
下面介绍另一种MDA maildrop
安装Maildrop
apt-get install maildrop
gedit /etc/maildropmysql.config
//创建一个文件
hostname 127.0.0.1
port 3306
database extmail
dbuser extmail
dbpw extmail
dbtable mailbox
default_uidnumber 1000
default_gidnumber 1000
uidnumber_field uidnumber
gidnumber_field gidnumber
uid_field username
homedirectory_field concat('/home/vmail/',homedir,'/')
maildir_field concat('/home/vmail/',maildir)
quota_field quota
mailstatus_field active
修改/etc/maildroprc
logfile "/var/log/maildrop.log"
手动创建日志
gedit /var/log/maildrop.log
chown vmail:vmail /var/log/maildrop.log
chmod 766 /var/log/maildrop.log
创建 /etc/logrotate.d/maildrop
内容为下面:
/var/log/maildrop.log {
daily
notifempty
missingok
rotate 5
compress
create 766 vmail vmail
sharedscripts
}
编辑/etc/postfix/master.cf,注释掉原来maildrop的配置内容并改为:
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=maildrop -w 90 -d ${user}@${nexthop} ${recipient} ${user} ${extension} {nexthop}
由于maildrop不支持一次接收多个收件人,因此必须在/etc/postfix/main.cf增加如下参数:
###### Maildrop config ########
maildrop_destination_recipient_limit = 1
virtual_transport = maildrop:
创建 /etc/quotawarnmsg,为邮箱空间超过配额时的警告邮件内容
X-Comment: Rename/Copy this file to quotawarnmsg, and make appropriate changes
X-Comment: See deliverquota man page for more information
From: Mail Delivery System <Mailer-Daemon@example.com>
Reply-To: support@example.com
To: Valued Customer:;
Subject: Mail quota warning
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Your mailbox on the server is now more than 90% full. So that you can continue
to receive mail you need to remove some messages from your mailbox.
