Postfix ipv4 set up problem

January 3, 2014 10.9k views
Hi Guys, I followed the tutorial for installing postfix and have it pretty much running. However in the mail logs i have connect to aspmx.l.google.com[2a00:1450:400c:c05::1a]:25: Network is unreachable reading your documentation you don't support ipv6 so in my /etc/postfix/main.cf I changed inet_interfaces = all to inet_interfaces = ipv4. Now when I try to restart postfix i get postfix: fatal: config variable inet_interfaces: host not found: ipv4 I've been trawling the internet for a day or too but I'm not very knowledgeable on this network stuff and can't find out what to to. I think its probably my /etc/hosts file but I'm not sure what to put in there. my /etc/hosts file is 127.0.0.1 localhost behappyhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ifconfig outputs the following eth0 Link encap:Ethernet HWaddr 04:01:09:00:d9:01 inet addr:198.199.124.252 Bcast:198.199.124.255 Mask:255.255.255.0 inet6 addr: fe80::601:9ff:fe00:d901/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:33434204 errors:0 dropped:6 overruns:0 frame:0 TX packets:2249672603 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:3458227348 (3.4 GB) TX bytes:99888789748 (99.8 GB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:24183 errors:0 dropped:0 overruns:0 frame:0 TX packets:24183 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:18406889 (18.4 MB) TX bytes:18406889 (18.4 MB) I'm grateful for any help Regards Roy
5 Answers
Change inet_interfaces back to all

add this in the postfix config:
inet_protocols = ipv4

then try restarting
Thanks loads, that seems to have fixed that problem at least. Postfix starts up now and I don''t get the unreachable network error.
However i'm still not able to send some mail. My log is below and ooutput from postconf -n, the first mail arrives (and used to work even when ipv6 was enabled) but the second email never arrives (i can send to the email address from elsewhere).
Any ideas on how i can start to debug this?

Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: connect from unknown[198.199.124.252]
Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: 686B842ABD: client=unknown[198.199.124.252], sasl_method=PLAIN, sasl_username=admin
Jan 3 11:48:19 localhost postfix/cleanup[31165]: 686B842ABD: message-id=<52c6a382f25b5_39641869f1020266@behappyhost.mail>
Jan 3 11:48:19 localhost postfix/qmgr[31146]: 686B842ABD: from=, size=1159, nrcpt=1 (queue active)
Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: disconnect from unknown[198.199.124.252]
Jan 3 11:48:19 localhost postfix/smtp[31166]: 686B842ABD: to=, relay=aspmx.l.google.com[173.194.70.27]:25, delay=0.51, delays=0.04/0.01/0.17/0.29, dsn=2.0.0, status=sent (250 2.0.0 OK 1388749699 v6si70477773eel.7 - gsmtp)

log of an email that never arrives
Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: connect from unknown[198.199.124.252]
Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: 686B842ABD: client=unknown[198.199.124.252], sasl_method=PLAIN, sasl_username=admin
Jan 3 11:48:19 localhost postfix/cleanup[31165]: 686B842ABD: message-id=<52c6a382f25b5_39641869f1020266@behappyhost.mail>
Jan 3 11:48:19 localhost postfix/qmgr[31146]: 686B842ABD: from=, size=1159, nrcpt=1 (queue active)
Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: disconnect from unknown[198.199.124.252]
Jan 3 11:48:19 localhost postfix/smtp[31166]: 686B842ABD: to=, relay=aspmx.l.google.com[173.194.70.27]:25, delay=0.51, delays=0.04/0.01/0.17/0.29, dsn=2.0.0, status=sent (250 2.0.0 OK 1388749699 v6si70477773eel.7 - gsmtp)


log on an email that arrives
Jan 3 11:49:26 localhost postfix/submission/smtpd[31158]: connect from unknown[198.199.124.252]
Jan 3 11:49:26 localhost postfix/submission/smtpd[31158]: 084A342ABD: client=unknown[198.199.124.252], sasl_method=PLAIN, sasl_username=admin
Jan 3 11:49:26 localhost postfix/cleanup[31165]: 084A342ABD: message-id=<52c6a3c5ebd77_39641869f102033a@behappyhost.mail>
Jan 3 11:49:26 localhost postfix/qmgr[31146]: 084A342ABD: from=, size=1141, nrcpt=1 (queue active)
Jan 3 11:49:26 localhost postfix/submission/smtpd[31158]: disconnect from unknown[198.199.124.252]
Jan 3 11:49:26 localhost postfix/smtp[31166]: 084A342ABD: to=, relay=aspmx.l.google.com[173.194.70.27]:25, delay=0.5, delays=0.04/0/0.2/0.26, dsn=2.0.0, status=sent (250 2.0.0 OK 1388749766 t6si70482011eeh.45 - gsmtp)
Jan 3 11:49:26 localhost postfix/qmgr[31146]: 084A342ABD: removed

postconf -n output
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
config_directory = /etc/postfix
inet_interfaces = all
inet_protocols = ipv4
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
mailbox_size_limit = 0
mydestination = mail.traintobehappy.com, traintobehappy.com, localhost, localhost.localdomain
myhostname = mail.traintobehappy.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtpd_tls_cert_file = /etc/ssl/private/mail.traintobehappy.crt
smtpd_tls_key_file = /etc/ssl/private/mail.key
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

"I followed the tutorial for installing postfix..."

Which one?
this one
https://digitalocean.com/community/articles/how-to-set-up-a-postfix-e-mail-server-with-dovecot

by Lukas Erlacher
This tutorial will tell you how to setup a basic mail server and attempts to teach you a bit about the Postfix MTA (Mail Transfer Agent) in the process.
One stupid thing to remember: if u send the mail from gmail via your postfix to gmail, then google ignores that. So you need to test that by not using a gmail address.
Have another answer? Share your knowledge.