# 如果没有安装nmap可以先apt-get install nmap安装一下
$ sudo nmap your-server-ip
Starting Nmap 7.60 ( https://nmap.org ) at 2019-07-15 16:34 +08
Nmap scan report for ubuntu (your server ip)
Host is up (0.00040s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
25/tcp open smtp
Nmap done: 1 IP address (1 host up) scanned in 1.65 seconds
二、测试发送邮件
echo "test email" | sendmail your-eamil
# 也可以使用mail命令来发送邮件,使用mail发送邮件的时候,main.cf配置文件对其不生效,应该有自己的配置文件,还没找到
# mail -s title your-eamil <<< "mail content"
查看你的邮箱收件箱,应该可以看到,估计在垃圾箱。
日志文件:/var/log/mail.log
配置文件:/etc/postfix/main.cf
保存用户邮件:/var/spool/mail和/var/mail/
三、遇到的问题
问题1:发件人地址不正确
在/var/log/mail.log日志中显示的发件人信息为:
Jul 15 15:28:08 mail postfix/pickup[856]: 2E7B6442DC: uid=1000 from=<wangjun>
Jul 15 15:28:08 mail postfix/cleanup[865]: 2E7B6442DC: message-id=<20190715072808.2E7B6442DC@bonnenuit.vip>
Jul 15 15:28:08 mail postfix/qmgr[857]: 2E7B6442DC: from=<wangjun@iZ94pe2uk6bZ>, size=264, nrcpt=1 (queue active)
Jul 15 15:33:02 mail postfix/qmgr[857]: 5542E4431B: from=<wangjun@bonnenuit.vip>, size=264, nrcpt=1 (queue active)
Jul 15 15:33:33 mail postfix/smtp[870]: connect to hotmail-com.olc.protection.outlook.com[104.47.46.33]:25: Connection timed out
Jul 15 15:33:33 mail postfix/smtp[871]: connect to hotmail-com.olc.protection.outlook.com[104.47.9.33]:25: Connection timed out