Specific format required for from email address

My team’s SMTP provider requires the from address to be formatted in Mailbox format (Name <example@domain.com>), otherwise the SMTP server throws the following error when using ./discourse-doctor to test email sending:
554 error: from_field_is_not_present
I have already confirmed that the login credentials are valid and the connection SMTP server is established correctly.

I have tried to set DISCOURSE_NOTIFICATION_EMAIL in the app.yml file like this

The final environment variable after the container is rebuilt looks like this:

DISCOURSE_NOTIFICATION_EMAIL="Hiveologie <happenings@hello.hiveologie.com>"

After running the ./discourse-doctor email test again it parses the from email address as missing, and fails with the following message

Sending to `nikola@hiveologie.com`. . .
Sending mail failed.
SMTP From address may not be blank: nil

Is the current version of Discourse able to parse this email format when sending notifications or am I missing something when it comes to setting the environment variable in app.yml file, like escaping the space character properly or getting the single and double quotes in a specific order?

Then you’ll need a different SMTP provider or to figure out how to override the SMTP stuff in Discourse. I suppose a plugin can do it, but it’s not going to be easy.

1 Like