我有域名“example.com”,以及两个 Redhat VM“Clinet1.example.com”和“Client2.example.com”,我安装了 postfix 服务器“server.example.com”。我在客户端 1 和客户端 2 上都进行了配置,以使用服务器作为中继主机。当我从客户端 1 或客户端 2 向服务器发送电子邮件时,它会显示在邮件目录中,但是当我从客户端 1 发送到客户端 2 或反之亦然时,它会显示在邮件目录中。在服务器中也是如此,无法到达接收的客户端。服务器上的 /etc/postfix/main.cf 如下
myhostname = server.example.com
mydomain = example.com
myorigin = $myhostname
inet_interfaces = all
inet_protocols = ipv4
mydestination = client1.$mydomain, client2.$mydomain, $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain
mynetworks = 192.168.64.0/25, 192.168.64.0/24, 127.0.0.0/8
relayhost = [server.example.com]
home_mailbox = Maildir/
mail_spool_directory = /var/spool/mail
PS 所有机器上的防火墙和 selinux 都已关闭。问题是什么?
服务器日志
Jun 21 17:02:38 server postfix/smtpd[23972]: connect from client1.example.com[192.168.64.151]
Jun 21 17:02:38 server postfix/smtpd[23972]: 933081037382: client=client1.example.com[192.168.64.151]
Jun 21 17:02:38 server postfix/cleanup[23975]: 933081037382: message-id=<5eef768e.it6sAA/ACNAsXJuO%[email protected]>
Jun 21 17:02:38 server postfix/qmgr[23118]: 933081037382: from=<[email protected]>, size=895, nrcpt=1 (queue active)
Jun 21 17:02:38 server postfix/smtpd[23972]: disconnect from client1.example.com[192.168.64.151]
Jun 21 17:02:38 server postfix/local[23976]: 933081037382: to=<[email protected]>, relay=local, delay=0.03, delays=0.02/0.02/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jun 21 17:02:38 server postfix/qmgr[23118]: 933081037382: removed
Cleint1(发送方)日志
Jun 21 17:15:37 client1 sendmail[21572]: 05LFFbl2021572: [email protected], size=319, class=0, nrcpts=1, msgid=<5eef7999.yBmZcYVpHOwevzri%[email protected]>, relay=root@localhost
Jun 21 17:15:37 client1 postfix/smtpd[21573]: connect from localhost[127.0.0.1]
Jun 21 17:15:37 client1 postfix/smtpd[21573]: EF3A018FCB41: client=localhost[127.0.0.1]
Jun 21 17:15:37 client1 postfix/cleanup[21576]: EF3A018FCB41: message-id=<5eef7999.yBmZcYVpHOwevzri%[email protected]>
Jun 21 17:15:38 client1 postfix/qmgr[20322]: EF3A018FCB41: from=<[email protected]>, size=687, nrcpt=1 (queue active)
Jun 21 17:15:38 client1 sendmail[21572]: 05LFFbl2021572: [email protected], [email protected] (1000/1000), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30319, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as EF3A018FCB41)
Jun 21 17:15:38 client1 postfix/smtpd[21573]: disconnect from localhost[127.0.0.1]
Jun 21 17:15:38 client1 postfix/smtp[21577]: EF3A018FCB41: to=<[email protected]>, relay=mail.example.com[192.168.64.150]:25, delay=0.2, delays=0.07/0.08/0.03/0.02, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 777BD1037382)
Jun 21 17:15:38 client1 postfix/qmgr[20322]: EF3A018FCB41: removed