0

I have 2 servers:

In server 1, IP: 192.168.190.176, I have configured main.cf

myhostname = ubuntu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = ubuntu, 192.168.190.171.ubuntu, 192.168.190.171
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

In server2, IP: 192.168.190.171, I have configured like so:

myhostname = ubuntu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = ubuntu, 192.168.190.176.ubuntu, 192.168.190.176
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

When I send mail from server1 to server2 by command:

echo "Test" | mail -s "Test Postfix" quocchi@[192.168.190.171]

In server2, /var/spool/mail/quocchi is empty.

In server1: /var/log/mail.log

Apr 23 17:37:27 ubuntu postfix/qmgr[3452]: 17902800A9: from=<root@ubuntu>, size=311, nrcpt=1 (queue active)
Apr 23 17:37:27 ubuntu postfix/local[3465]: 17902800A9: to=<quocchi@ubuntu>, relay=local, delay=0.34, delays=0.15/0.15/0/0.05, dsn=2.0.0, status=sent (delivered to mailbox)
Apr 23 17:37:27 ubuntu postfix/qmgr[3452]: 17902800A9: removed

In server2:

Apr 23 19:35:59 ubuntu postfix/smtpd[10688]: lost connection after CONNECT from unknown[192.168.190.17$
Apr 23 19:35:59 ubuntu postfix/smtpd[10688]: disconnect from unknown[192.168.190.176]

How can I set it up correctly?

  • Did you check /var/log/mail.log to see if anything is wrong? – Jos Apr 23 '17 at 10:10
  • I updated in my ask, and i check in local quocchi mail and local mail receive that mail, but i want it send quocchi mail of server2 – QChí Nguyễn Apr 23 '17 at 10:38
  • You have named both servers ubuntu. I guess that will confuse postfix as it will try to deliver the mail locally first. – Jos Apr 23 '17 at 13:24
  • I try with quocchi@[192.168.190.171] but, in /var/log/mail.log of server2 error lost connection after CONNECT from unknown. Can you fix it? – QChí Nguyễn Apr 23 '17 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.