1

I have a CentOS box running my Apache website and Postfix, but whenever I try PHP's mail() function to my @aevidi email, it sends to my local mailbox in ~/mail, but is not visible in Zoho's webmail. When I send an email from my Gmail account to my @aevidi email, I see it in Zoho but not in my local mailbox (expected result). Here is my setup:

  • Zoho as my email host for my custom domain
  • CentOS box with my site and mail server (postfix)

I followed this tutorial for my Zoho/SES/Postfix high level setup (honestly not sure where SES comes into play)

I followed this tutorial to setup Postfix (and Dovecot before I realized what it did, but have removed it since).


/var/log/maillog after executing mail()

Aug  3 20:05:37 aevidi postfix/pickup[7702]: 31ADD40BDD: uid=48 from=<[email protected]>
Aug  3 20:05:37 aevidi postfix/cleanup[7707]: 31ADD40BDD: message-id=<20140804000537.31ADD40BDD@aevidi>
Aug  3 20:05:37 aevidi postfix/qmgr[7703]: 31ADD40BDD: from=<[email protected]>, size=344, nrcpt=1 (queue active)
Aug  3 20:05:37 aevidi postfix/local[7709]: 31ADD40BDD: to=<[email protected]>, relay=local, delay=0.03, delays=0.02/0.0
1/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Aug  3 20:05:37 aevidi postfix/qmgr[7703]: 31ADD40BDD: removed

/etc/postfix/main.cf

myhostname = aevidi #This is my FQDN when I type 'hostname -f'
mydomain = aevidi.com
myorigin = $mydomain
home_mailbox = mail/
mynetworks = 127.0.0.0/8
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

relayhost = email-smtp.us-east-1.amazonaws.com:25
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt

DNS configuration

Cloudflare DNS


Any help is appreciated!

2
  • What do you mean by @aevidi email? You mean aevidi.com? If your postfix want to deliver mails for aevidi.com to Zoho mail servers, then you should remove $domain from mydestination. That way postfix will consider aevidi.com as remote domain and deliver mails doing an MX lookup.
    – clement
    Commented Aug 4, 2014 at 12:49
  • You are awesome! That was the fix. If you post it as the answer I will mark it correct :)
    – sbl03
    Commented Aug 5, 2014 at 1:41

1 Answer 1

0

If you want postfix to deliver mails for aevidi.com by doing an MX lookup (i.e to Zoho mail servers, in your case), then you should remove $domain i.e aevidi.com from mydestination.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .