最终效果
[root@jenkins data]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 mail.jzhu.cn ESMTP Postfix
MAIL FROM:<test@jzhu.cn>
250 2.1.0 Ok
RCPT TO:wangxiaomin@800617.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: hello
this is a demo
.
250 2.0.0 Ok: queued as 653751EC15F
quit
221 2.0.0 Bye
Connection closed by foreign host.
准备
1. 邮件服务器主机名是mail.jzhu.cn
配置步骤
vi /etc/postfix/main.cf
1.修改myhostname
myhostname = mail.cnblogs.info
2.修改mydomain
myorigin = $mydomain
3.修改myorigin
myorigin = $mydomain
4.修改inet_interfaces
inet_interfaces = all
5.修改inet_protocols
inet_protocols = ipv4
6.添加$mydomain
mydestination = $myhostname,localhost.$mydomain,localhost,$mydomain
7.修改mynetworks
mynetworks = 127.0.0.0/8
8.设置home_mailBox
home_mailBox = Maildir/
9.设置mail_spool_directory
mail_spool_directory = /data/mail
10.重启postfix使设置生效
service postfix restart
参考资料
http://www.cnblogs.com/dudu/archive/2012/12/12/linux-postfix-mailserver.html