Question

Postfix ipv4 set up problem

  • Posted January 3, 2014

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

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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.

<b>“I followed the tutorial for installing postfix…”</b> <br> <br>Which one?

Thanks loads, that seems to have fixed that problem at least. Postfix starts up now and I don’'t get the unreachable network error. <br>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). <br>Any ideas on how i can start to debug this? <br> <br>Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: connect from unknown[198.199.124.252] <br>Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: 686B842ABD: client=unknown[198.199.124.252], sasl_method=PLAIN, sasl_username=admin <br>Jan 3 11:48:19 localhost postfix/cleanup[31165]: 686B842ABD: message-id=52c6a382f25b5_39641869f1020266@behappyhost.mail <br>Jan 3 11:48:19 localhost postfix/qmgr[31146]: 686B842ABD: from=please-change-me-at-config-initializers-devise@example.com, size=1159, nrcpt=1 (queue active) <br>Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: disconnect from unknown[198.199.124.252] <br>Jan 3 11:48:19 localhost postfix/smtp[31166]: 686B842ABD: to=kimberley.bottomley@virginmedia.com, 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) <br> <br>log of an email that never arrives <br>Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: connect from unknown[198.199.124.252] <br>Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: 686B842ABD: client=unknown[198.199.124.252], sasl_method=PLAIN, sasl_username=admin <br>Jan 3 11:48:19 localhost postfix/cleanup[31165]: 686B842ABD: message-id=52c6a382f25b5_39641869f1020266@behappyhost.mail <br>Jan 3 11:48:19 localhost postfix/qmgr[31146]: 686B842ABD: from=please-change-me-at-config-initializers-devise@example.com, size=1159, nrcpt=1 (queue active) <br>Jan 3 11:48:19 localhost postfix/submission/smtpd[31158]: disconnect from unknown[198.199.124.252] <br>Jan 3 11:48:19 localhost postfix/smtp[31166]: 686B842ABD: to=kimberley.bottomley@virginmedia.com, 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) <br> <br> <br>log on an email that arrives <br>Jan 3 11:49:26 localhost postfix/submission/smtpd[31158]: connect from unknown[198.199.124.252] <br>Jan 3 11:49:26 localhost postfix/submission/smtpd[31158]: 084A342ABD: client=unknown[198.199.124.252], sasl_method=PLAIN, sasl_username=admin <br>Jan 3 11:49:26 localhost postfix/cleanup[31165]: 084A342ABD: message-id=52c6a3c5ebd77_39641869f102033a@behappyhost.mail <br>Jan 3 11:49:26 localhost postfix/qmgr[31146]: 084A342ABD: from=please-change-me-at-config-initializers-devise@example.com, size=1141, nrcpt=1 (queue active) <br>Jan 3 11:49:26 localhost postfix/submission/smtpd[31158]: disconnect from unknown[198.199.124.252] <br>Jan 3 11:49:26 localhost postfix/smtp[31166]: 084A342ABD: to=roy.bottomley@virginmedia.com, 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) <br>Jan 3 11:49:26 localhost postfix/qmgr[31146]: 084A342ABD: removed <br> <br>postconf -n output <br>alias_database = hash:/etc/aliases <br>alias_maps = hash:/etc/aliases <br>config_directory = /etc/postfix <br>inet_interfaces = all <br>inet_protocols = ipv4 <br>local_recipient_maps = proxy:unix:passwd.byname $alias_maps <br>mailbox_size_limit = 0 <br>mydestination = mail.traintobehappy.com, traintobehappy.com, localhost, localhost.localdomain <br>myhostname = mail.traintobehappy.com <br>mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 <br>myorigin = /etc/mailname <br>recipient_delimiter = + <br>relayhost = <br>smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache <br>smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination <br>smtpd_tls_cert_file = /etc/ssl/private/mail.traintobehappy.crt <br>smtpd_tls_key_file = /etc/ssl/private/mail.key <br>smtpd_tls_protocols = !SSLv2, !SSLv3 <br>smtpd_tls_security_level = may <br>smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache <br>smtpd_use_tls = yes <br> <br>

Change inet_interfaces back to all <br> <br>add this in the postfix config: <br>inet_protocols = ipv4 <br> <br>then try restarting