Smtp doctor test using port 465 even though its configured to use 2525

I am not receiving emails from the site or the doctor. I noticed that the doctor is using port 465 even though I configured it to use 2525:

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=url
SMTP_ADDRESS=smtp.mailgun.org
DEVELOPER_EMAILS=REDACTED 
SMTP_PASSWORD=REDACTED 
SMTP_PORT=2525
SMTP_USER_NAME=url
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED 

==================== MAIL TEST ====================
For a robust test, get an address from URL...
Sending mail to REDACTED  . . 
Testing sending to email@gmail.com using smtp.mailgun.org:465, username:postmaster@url with plain auth.
======================================== ERROR ========================================
                                    UNEXPECTED ERROR

Net::ReadTimeout

Is this expected? I used the smtp checker and it works with 2525 but times out with 465.

1 Like

Hmm. Try

   ./launcher enter app 
    rake emails:test[user@address ]

I’m not sure how that might happen. I’ll try to have a look later.

That’s pretty cool. I didn’t know I could enter the app :smiley:. I’ll try that in a couple of hours. Thank you.

1 Like

EDIT:

These are wrong. They should be like this:

Oops. That’s what discourse-doctor prints out. (I wrote that code, so I should have known!)

Oh, and looking at the code, what discourse-doctor does is run the rake task inside the container, so that should do exactly the same thing.

Did you rebuild, or at least destroy and start the container after making those changes?

2 Likes

For reference if you’re using ./discourse-setup then mailgun works with the default port (563)

Tested. Still using port 465. :slight_smile:

Testing sending to bj97301@gmail.com using smtp.mailgun.org:465, username:postmaster@***.org with plain auth.
======================================== ERROR ========================================
                                    UNEXPECTED ERROR

Net::ReadTimeout

====================================== SOLUTION =======================================
This is not a common error. No recommended solution exists!

Please report the exact error message above to https://meta.discourse.org/
(And a solution, if you find one!)
=======================================================================================

I had to edit the app.yml directly because it didn’t allow me to set the smtp domain differently than the hostname:

DISCOURSE_HOSTNAME: forum.electricmoto.org
...
DISCOURSE_DEVELOPER_EMAILS: 'bj97301@gmail.com'

## TODO: The SMTP mail server used to validate new accounts and se>
# SMTP ADDRESS, username, and password are required
# WARNING the char '#' in SMTP password can cause problems!
DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: postmaster@electricmoto.org
DISCOURSE_SMTP_PASSWORD: "***"
# DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, defa>
DISCOURSE_SMTP_DOMAIN: electricmoto.org
DISCOURSE_NOTIFICATION_EMAIL: noreply@electricmoto.org

After doing that i restarted the app using the launcher thingy. Do i need to do something different to rebuild the container?

I did a thing:

./../../var/discourse/launcher rebuild app

hope that works :crossed_fingers:

Yes. You need to

 ./launcher rebuild app

Though in this case you can

  ./launcher destroy app;./launcher start app

If you don’t do that then the changes to your app.yml have no effect.

Got it. I was under the assumption that restart would do the trick. Got a link to docs on this launcher thing?

Thanks again for all the awesome help :beers:

YES! That worked. You are the best! Have one on me::beers:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.