Skip to content

SMTP_RELAY_LOGIN value might not not always be a value SMTP FROM Address

Hello I ran into the following issue when I was setting up your container using sendgrid.com SMTP API. I was not able to get it to work without rewriting the header_check. Sorry if I missed something.

The SMTP_RELAY_LOGIN value for authenticating to their API is always going to be the user name of "apikey"

Due to the header_check rewrite function of

/From:.*/ REPLACE From: "$SMTP_SENDER_NAME" <$SMTP_RELAY_LOGIN>

The SMTP from the address is always going to be replaced with the value of SMTP_RELAY_LOGIN resulting in emails being rejected by sendgrid as "apikey" is not a valid SMTP address.

A new environmental value could be created called SMTP_SENDER_ADDRESS or if this value was blank then use the FROM SMTP address set in the original email.