邮件服务 SMTP(25端口)

配置环境(dns的作用:解析域名)

在server虚拟机里面:新建两个域

wKiom1g8R7WRvOnyAADmL9eHF1w737.png-wh_50

wKioL1g8R7rzjDmUAAC1yDyZVhY540.png-wh_50

wKioL1g8R77iAVZDAACsHB-6Fgw107.png-wh_50


desktop虚拟机测试:(得到不同的IP)

dig -t mx dd.com

 

wKiom1g8R-izck9gAAG4JzPyZ3U381.png-wh_50

dig -t mx linux.com

wKiom1g8SWfzurYOAAGoJRcMQb0671.png-wh_50

主机linux.linux.com

systemctl stop firewalld

vim /etc/postfix/main.cf

myhostname = linux.linux.com(主机名)

mydomain = linux.com

myorigin =$mydomain(域名)

113:inet_interfaces =all (将25端口全部打开)

wKioL1g8SUfzBg67AAF4CcHW93Y547.png-wh_50

netstat -antlpe | grep 25

 

164:mydestination =$myhostname,$mydomain,localhost(我可以收到:自己主机名域名 什么都不写)

systemctl restart postfix.service

 

测试:

1.自己给自己发邮件

wKioL1g8SaPB1NeHAAFhHvbFRIo057.png-wh_50

2.别人给自己发邮件

wKiom1g8ScmywWhBAAGudIDP_1I044.png-wh_50

3.互相发送邮件

wKioL1g8SdWyRyQyAAFsE4bwcw0248.png-wh_50

 

主机:dd.dd.com

systemctl stop firewalld

vim /etc/postfix/main.cf

myhostname = dd.dd.com(主机名)

mydomain = dd.com

myorigin =$mydomain(域名)

113:inet_interfaces =all

164:mydestination=$myhostname,$mydomain,localhost(我可以收到:自己主机名 域名 什么都不写)

systemctl restart postfix.service

 

查看邮件:mailq(查看邮件队列)

mail -u 用户(查看用户收到的邮件)

 

 

postconf -e 修改脚本选项

postconf -d 查看默认设置(没改过)

postconf -n 查看当前设置(修改过)

 

虚拟用户alias:

vim /etc/aliases

haha:  root (前面是虚拟用户后面是真实用户)

more   :include: /etd/moreusers (邮件群发)

wKiom1g8SeaSKbvvAAFjNKjnpbA187.png-wh_50

vim /etc/moreusers

postalias /etc/aliases

systemctl restart postfix.service

wKioL1g8SgWieHXWAABbKp5rgcU838.png-wh_50

wKioL1g8SgjBlry3AADzwhhkajE814.png-wh_50

wKiom1g8SgzwpHXyAAA1zBqMAPs060.png-wh_50

wKioL1g8ShvyP0v7AAGhbx_Oedw470.png-wh_50

伪装出站地址

cd /etc/postfix

vim generic

真域名 假域名

wKiom1g8SiyyX-FCAAA9g7ib6W4680.png-wh_50

postconf generic(加密)

postconf -e"smtp_generic_maps=hash:/etc/postfix/generic"

wKiom1g8Sj7xTAAeAAEHiT2PHR0942.png-wh_50

测试:

 

wKioL1g8SlyzjB5KAABuaKu_K24095.png-wh_50

wKiom1g8Sm2yzk1MAAGMkkFd_Ik193.png-wh_50

 

远程登陆发送邮件

telnet172.25.254.231 25

 

 

wKioL1g8SomAFBLEAAEYMky8-I0540.png-wh_50

wKiom1g8So7D3O4JAAErk8TdmSs013.png-wh_50