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 main.cf 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 = mail1.elusive.com.br
mydomain = elusive.com.br
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $mydomain, $myhostname, localhost.domain
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/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 mail1.elusive.com.br.
TXT "v=spf1 include:_spf.google.com include:elusive.com.br ~all"
The PRT is this:
PTR 162.243.76.132 elusive.com.br 24 hrs
So, when I try to send e-mail:
root@elusive:~# echo "Teste" | mail -s Teste lucas@lucasveiga.com
Feb 21 08:17:23 elusive postfix/pickup[15561]: C5F7862D14: uid=0 from=
Feb 21 08:17:23 elusive postfix/cleanup[15682]: C5F7862D14: message-id=<20140221131723.C5F7862D14@mail1.elusive.com.br>
Feb 21 08:17:23 elusive postfix/qmgr[15562]: C5F7862D14: from=, size=438, nrcpt=1 (queue active)
Feb 21 08:17:24 elusive postfix/smtp[15684]: connect to ASPMX.L.GOOGLE.com[2607:f8b0:400d:c01::1a]:25: Network is unreachable
Feb 21 08:17:54 elusive postfix/smtp[15684]: connect to ASPMX.L.GOOGLE.com[173.194.76.27]:25: Connection timed out
Feb 21 08:17:54 elusive postfix/smtp[15684]: connect to ALT2.ASPMX.L.GOOGLE.com[2a00:1450:4013:c01::1a]:25: Network is unreachable
Feb 21 08:18:24 elusive postfix/smtp[15684]: connect to ALT1.ASPMX.L.GOOGLE.com[173.194.66.27]:25: Connection timed out
Feb 21 08:18:24 elusive postfix/smtp[15684]: connect to ALT1.ASPMX.L.GOOGLE.com[2a00:1450:400c:c03::1a]:25: Network is unreachable
Feb 21 08:18:24 elusive postfix/smtp[15684]: C5F7862D14: to=, relay=none, delay=60, delays=0.01/0.01/60/0, dsn=4.4.1, status=deferred (connect to ALT1.ASPMX.L.GOOGLE.com[2a00:1450:400c:c03::1a]:25: Network is unreachable)