I currently have a working mailserver with Postfix and Dovecot with virtual mailboxes in mySQL. However, I have a problem setting Sendgrid as relayhost.
As said, the authentication is done as follows:
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
I also use TLS and the certificates are pointed to correctly.
Now, when I follow Sendgrid's guide:
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:yourSendGridUsername:yourSendGridPassword
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587
(username and password changed), I am not quite sure how the authentication is done. It simply doesn't work, as I receive an error message from Sendgrid with:
"550 Cannot receive from specified address : Unauthenticated senders not allowed (in reply to MAIL FROM command)"
If I remove the Dovecot part, obviously the e-mail cannot be sent in the first place because it is not allowed to connect to the mailserver.
Any thoughts?