申请了一个yi.zapto.org的免费域名,想把*@yi.zapto.org的邮件地址都送到zrr@yi.zapto.org这个地址去。

用Sendmail:

编辑local-host-names,设置邮件的域名,对了,最好在/etc/hosts中增加yi.zapto.org的解析,否则sendmail启动时会反解,速度很慢。

# vi /etc/mail/local-host-names
yi.zapto.org  

编辑virtusertable,设置全域邮件转发到zrr

# vi /etc/virtusertable
@yi.zapto.org zrr
# rm /etc/virtusertable.db
# cd /etc/mail
# make

编辑sendmail.cf,增加信任用户nobody

# vi /etc/mail/sendmail.cf
...
#####################
#   Trusted users   #
#####################

# this is equivalent to setting class "t"
Ft/etc/mail/trusted-users  
Troot  
Tdaemon  
Tuucp  
Tnobody  
...

这样所有发过来的邮件都会自动转发到zrr这个账号下。

编辑sendmail.cf,开放端口,否则只能127.0.0.1收发邮件

...
#O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA  
...

ok,重启sendmail

service sendmail restart  
comments powered by Disqus