Relay emails using sendgrid


I am new to Mail-in-a-box, I have started using it for a while, I have decided to relay my smtp to use sendgrid one, to be able to send email to services like outlook.
I have followed the configurations to letters, adding all sasl configs and restart postfix services, for several times as having been described in the page:

If I keep smtpd_sasl_type=dovecot I will receive 550 error telling that postfix did not even authenticate using sasl and went direclty in trying to send email.
On the otherhand, if I remove sasl_type I will get 535 authentication error with localhost.
Do anyone have an idea what is going, and why SASL authentication is not forced by postfix when relaying smtp to sendgrid?
I also have changed 578 to 2525 and got the same result, my service provider is Digital ocean.

Best regards.

Hi @shrit

I have created a SMTP relay product and the install instructions are very similar to sendgrids … yet, users don’t encounter any problem similar to yours.

What leads you to believe that the issue is concerning smptd_sasl_type=dovecot ?

Did you remember to execute postmap on the sasl_password file?

Hello @alento
Thanks for your answer.
Yes of course, I have already executed postmap on the sasl_passwd file which generated a sasl_passwd.db file.
I do not understand the reason why postfix goes forward and send email to sendgrid instead of authentication. I am not sure if it is related to smtpd_sasl_type=dovecot, but there is no tutorial specifying whether to keep smtpd_sasl_type or not.
The problem in my case is authentication, I do not understand why postfix does not execute sasl lines in file.

Here is the output of return email:[] said: 550
Unauthenticated senders not allowed (in reply to MAIL FROM command)

@alento Any thoughts?
Is there any official tutorial how to do the smtp relay with mail in a box

1 Like