After upgrading a server from Ubuntu 10.04 to 12.04, postfix is no longer sending email through sendgrid.com. I followed this guide about 6 months ago and everything had been working perfectly until the upgrade. Now it doesn't seem to be authenticating with sendgrid.

This is the error I get in my syslog when I try to send an email.

May 22 10:19:55 server postfix/smtp[3844]: 983B11C5DA: to=<to address>, 
relay=smtp.sendgrid.net[]:587, delay=0.05, delays=0.01/0/0.04/0,
dsn=5.0.0, status=bounced (host smtp.sendgrid.net[] said: 550 Cannot
receive from specified address <sendgrid username>: Unauthenticated senders not
allowed (in reply to MAIL FROM command))

This is from postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = no
config_directory = /etc/postfix
header_size_limit = 4096000
inet_interfaces = loopback-only
mailbox_size_limit = 0
mydestination = localhost, mylinode.members.linode.com
myhostname = hostname
mynetworks = [::ffff:]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relayhost = [smtp.sendgrid.net]:587
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = login
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sendgrid
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

Any help would be greatly appreciated. I would be happy to post any other logs or other relevant information.


I had a similar error. I fixed it by commenting out:

#default_transport = error
#relay_transport = error
| improve this answer | |
  • 1
    This fixed it for me. – kouton Jul 14 '14 at 14:01

cited from the commment:

"It turns out that it wasn't a rehash that it needed, but the format of the file was incorrect. It looked like [smtp.sendgrid.net] username:password but it didn't need the brackets around the host name. In my hunt for answers somewhere I saw that it was required and someone even said to put the port behind it, but neither was necessary."

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.