New install email not working "shadowed so this will be ignored"

After a brand new clean install, I’ve been unable to get email to function. I have followed every step of the troubleshooting guide here

I am using Zoho mail
The mail settings are pretty simple:

 DISCOURSE_SMTP_ADDRESS: smtp.zoho.com
 DISCOURSE_SMTP_PORT: 587
 DISCOURSE_SMTP_USER_NAME: forum@blockchainofthings.com
 DISCOURSE_SMTP_PASSWORD: "redeacted"
 DISCOURSE_SMTP_ENABLE_START_TLS: true       # (optional, default true)
 DISCOURSE_SMTP_DOMAIN: blockchainofthings.com
 DISCOURSE_NOTIFICATION_EMAIL: sys@blockchainofthings.com

I have removed the comment from the custom command section.

- exec: rails r "SiteSetting.notification_email='forum@blockchainofthings.com'"

I can telnet to the SMTP server from my EC2 instance where discourse is installed with no problems.

runnign ./discourse-doctor I get:

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Or just send a test message to yourself.
Email address for mail test? ('n' to skip) [sys@blockchainofthings.com]: sue@rightclick.com
Sending mail to sue@rightclick.com. . . 
Testing sending to sue@rightclick.com using smtp.zoho.com:587, username:forum@blockchainofthings.com with plain auth.
SMTP server connection successful.
Sending to sue@rightclick.com. . . 
Sending mail failed.
end of file reached

The log has a funny statement An attempt was to change notification_email SiteSetting to forum@blockchainofthings.com however it is shadowed so this will be ignored! this might be the issue, but I am not sure why or how to fix it.

here is more of the log:

An attempt was to change notification_email SiteSetting to forum@blockchainofthings.com however it is shadowed so this will be ignored!
Creating scope :open. Overwriting existing method Poll.open.
Started GET "/privacy" for 18.204.103.32 at 2021-09-15 20:22:27 +0000
Processing by StaticController#show as */*
 Parameters: {"id"=>"privacy"}
 Rendered static/show.html.erb within layouts/crawler (Duration: 7.7ms | Allocations: 963)
 Rendered layout layouts/crawler.html.erb (Duration: 41.8ms | Allocations: 8467)
Completed 200 OK in 114ms (Views: 45.2ms | ActiveRecord: 0.0ms | Allocations: 18560)
Started GET "/privacy" for 18.204.103.32 at 2021-09-15 20:22:27 +0000
Processing by StaticController#show as */*
 Parameters: {"id"=>"privacy"}
 Rendered static/show.html.erb within layouts/crawler (Duration: 5.2ms | Allocations: 931)
 Rendered layout layouts/crawler.html.erb (Duration: 26.5ms | Allocations: 6343)
Completed 200 OK in 59ms (Views: 30.1ms | ActiveRecord: 0.0ms | Allocations: 12955)
 Rendered layouts/email_template.html.erb (Duration: 0.8ms | Allocations: 273)
Delivered mail ac1148f5-a79f-4892-8982-8e6f512a3b04@forum.blockchainofthings.com (1462.1ms)
Job exception: end of file reached

Creating scope :open. Overwriting existing method Poll.open.
 Rendered layouts/email_template.html.erb (Duration: 2.1ms | Allocations: 487)
Delivered mail 5e74a41c-48ee-4e14-b669-091665840076@forum.blockchainofthings.com (544.7ms)

any help on how to fix this one a brand new install would be appreciated.

You need to change it in the app.yml. That’s what the “shadowed” thing is about.

 DISCOURSE_NOTIFICATION_EMAIL: sys@blockchainofthings.com

If Zoho wants you to send from forum@blockchainofthings.com rather than the other address, you need to change it in your app..yml. (I think that you can ./launcher destroy app; ./launcher start app rather than do a rebuild for that setting, but I’m no longer entirely sure; it might need to be in the discourse.conf inside the container, in which case, it’ll be easier to just rebuild, unless you know what all of that means).

I’m not sure what that end of file reached message means or indicates.

I don’t know about Zoho and transational email, are you talking about Transactional email service | ZeptoMail by Zoho Mail? If not, you’re probably looking at a world of hurt. In the time I’ve spent typing this, you could have configured mailgun and it would work.

2 Likes

Thanks! I changed it to

DISCOURSE_NOTIFICATION_EMAIL: forum@blockchainofthings.com

and it worked perfectly

2 Likes