Postfix & SMTP Issues

I need to setup an send-only e-mail server. Also, I have Google Apps for my domain. So, the main issue is:

  • Over php mail() function, I want to send from my server (not from Google due sending limits).
  • Also, I want to send and receive e-mails in my Google Apps gmail app.

So, after installing postfix, my postfix is this:

TLS parameters

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for

information on enabling SSL in the smtp client.

myhostname = mydomain = alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = $mydomain, $myhostname, localhost.domain relayhost = mynetworks = [::ffff:]/104 [::1]/128 mailbox_size_limit = 0 recipient_delimiter = +

I removed Gmail’s MX records form my DNS records for testing if was it causing the issue. I think isn’t. Anyway, my DNS records are:

MX 10 TXT “v=spf1 ~all”

The PRT is this:

PTR 24 hrs

So, when I try to send e-mail:

root@elusive:~# echo “Teste” | mail -s Teste

Feb 21 08:17:23 elusive postfix/pickup[15561]: C5F7862D14: uid=0 from=<root> Feb 21 08:17:23 elusive postfix/cleanup[15682]: C5F7862D14: Feb 21 08:17:23 elusive postfix/qmgr[15562]: C5F7862D14:, size=438, nrcpt=1 (queue active) Feb 21 08:17:24 elusive postfix/smtp[15684]: connect to[2607:f8b0:400d:c01::1a]:25: Network is unreachable Feb 21 08:17:54 elusive postfix/smtp[15684]: connect to[]:25: Connection timed out Feb 21 08:17:54 elusive postfix/smtp[15684]: connect to[2a00:1450:4013:c01::1a]:25: Network is unreachable Feb 21 08:18:24 elusive postfix/smtp[15684]: connect to[]:25: Connection timed out Feb 21 08:18:24 elusive postfix/smtp[15684]: connect to[2a00:1450:400c:c03::1a]:25: Network is unreachable Feb 21 08:18:24 elusive postfix/smtp[15684]: C5F7862D14:, relay=none, delay=60, delays=0.01/0.01/60/0, dsn=4.4.1, status=deferred (connect to[2a00:1450:400c:c03::1a]:25: Network is unreachable)

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Yes indeed. i am having problem with emails which have been already send in the past…are being send again…

i have check my config file…and added the inet_protocols = ipv4. after that i have not seen the error on not being able to reach the ipv6 address. maybe this is the reason why postfix is retrying to send some of the emails…now i will observe.

This means your MTA is trying to connect to the Google SMTP via IPv6. This doesn’t work as your network probably doesn’t support IPv6.

To get rid of the error message, you can configure Postfix not to use IPv6 by editing your /etc/postfix/ with this directive:

inet_protocols = ipv4

Afterwards you’ll have to restart postfix:

/etc/init.d/postfix restart

I’m getting the same issue, the cloud server doesn’t send emails to outside the domain. So I believe that it could be due this 40 days to avoid spam. But for me it’s extremely necessary to my application works… I opened a ticked… now, i’m waiting for an answer.