I was trying to send email after an email server switch, before it was working fine, however, now I am unable to send emails. The thing is, the connection is 100% working as you can see. But for some reasons it is unable to send the email.
Email address for mail test? ('n' to skip) [email@example.com]:
Sending mail to firstname.lastname@example.org. . .
Testing sending to email@example.com using smtppro.zoho.eu:587, username:firstname.lastname@example.org with login auth.
SMTP server connection successful.
Sending to email@example.com. . .
Sending mail failed.
end of file reached
There shouldn’t be any solution for this really. Why would I need to modify anything, if the connection was successful?
Also, yes, I found several topics like that, also one thread where you replied, but I am not going to fallback to 465 port which is depricated. Obviously, the issue is with Discourse or its Mail Sending library.
I can share, but how would it be misconfigured if the connection was successful?
## this is the all-in-one, standalone Discourse Docker container template
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
## Uncomment these two lines if you wish to add Lets Encrypt (https)
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
- "8080:8080" # http
- "15432:5432" # PostgreSQL
# - "8443:8443" # https
## Set db_shared_buffers to a max of 25% of the total memory.
## will be set automatically by bootstrap based on detected RAM, or you can override
## can improve sorting performance, but adds memory usage per-connection
## Which Git revision should this container use? (default: tests-passed)
# DISCOURSE_DEFAULT_LOCALE: en
## How many concurrent web requests are supported? Depends on memory and CPU cores.
## will be set automatically by bootstrap based on detected CPUs, or you can override
## TODO: The domain name this Discourse instance will respond to
## Required. Discourse will not work with a bare IP number.
## Uncomment if you want the container to be started with the same
## hostname (-h option) as specified above (default "$hostname-$config")
## TODO: List of comma delimited emails that will be made admin and developer
## on initial signup example 'firstname.lastname@example.org,email@example.com'
## TODO: The SMTP mail server used to validate new accounts and send notifications
# SMTP ADDRESS, username, and password are required
# WARNING the char '#' in SMTP password can cause problems!
DISCOURSE_SMTP_ENABLE_START_TLS: true # (optional, default true)
## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
# LETSENCRYPT_ACCOUNT_EMAIL: firstname.lastname@example.org
## The http or https CDN address for this Discourse instance (configured to pull)
## see https://meta.discourse.org/t/14857 for details
## The maxmind geolocation IP address key for IP address lookup
## see https://meta.discourse.org/t/-/137387/23 for details
## The Docker container is stateless; all data is stored in /shared
## Plugins go here
## see https://meta.discourse.org/t/19157 for details
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-chat.git
- git clone https://github.com/discourse/discourse-reactions.git
- git clone https://github.com/discourse/discourse-solved.git
- git clone https://github.com/discourse/discourse-voting.git
- git clone https://github.com/discourse/discourse-chat-integration.git
## Any custom commands to run after building
- exec: echo "Beginning of custom commands"
## If you want to set the 'From' email address for your first registration, uncomment and change:
## After getting the first signup email, re-comment the line. It only needs to run once.
#- exec: rails r "SiteSetting.email@example.com'"
- exec: echo "End of custom commands"
The good news is you didn’t spend 5 days debugging the smtp library as you suggested!
(I just spent a dozen hours over many days recently debugging the code that inserted a pull down menu that wouldn’t pull down. I poured over the coffee that inserted the pull down. I examined the coffee that produced the data for the pull down. I compared it to how other pull downs worked. Then, I found one little line of css that I had inserted that had made it so that there was no space for the pull down to pull down into.)
That’s why the standard install includes a list of recommended mail providers. If you want to deviate from those recommendations then you also accept the additional technical complexity that it introduces. Not all mail servers behave the same, it’s not the place of Discourse to address that.
The summary of the above is you misconfigured Zoho. Discourse can’t see the configuration there, and assumes you’re providing it with correct info. Had you rerun ./discourse-setup, it would have asked you again for the sending address, which you would have entered incorrectly due to this misconfiguration.
We can save users from a lot of problems, but rarely from themselves. Next time around I would suggest focusing on the more likely aspects and double-checking the details on external systems, before insisting that the issue lies in code that’s being utilized to serve tens of millions of users. It will likely get you to your answer far quicker.
But, it’s not clear that “end of file reached” will always mean, “you failed to configure your mail service for the sending address that you used” or whatever it was they you did to fix things.
It turns out that there are lots of things to do wrong after discourse successfully connects to a mail server. If you want a better error message, have zoho provide one rather than just shut down the connection.