New Instance not sending confirmation email (Mailgun misconfiguration)

Hello,

I am experiencing an issue with a fresh instance on Ubuntu 16.04 in which new user confirmation emails will not get delivered. The Sidekiq UI shows the following in the “Error” column:

Net::SMTPAuthenticationError: 535 5.7.0 Mailgun is not loving your login or password"

The kicker is that using SMTP Diag Tool I am able receive email from my Mailgun account.

Here is what my .env.production file looks like:

SMTP_SERVER=smtp.mailgun.org
SMTP_PORT=587
SMTP_FROM_ADDRESS=myAddress
SMTP_LOGIN=myAddress
SMTP_PASSWORD=xxxxxxxx
#SMTP_AUTH_METHOD=plain
#SMTP_DOMAIN=
#SMTP_ENABLE_STARTTLE_AUTO=true
#SMTP_TLS=true
#SMTP_OPENSSL_VERIFY_MODE=none

This was also a result of my recent installation via production manual so perhaps something is amiss with my install/version?

After two days of troubleshooting I posted this on GitHub too, but maybe this is a better venue. Please help thx!

Strange, but can you try doing this from Ruby using Class: Net::SMTP (Ruby 2.5.0) reference?

Well I’d hate to sound simple about it, but how exactly would I go about doing that?

I finally got it resolved by not worrying about pointing mailgun at a subdomain in DNS zone and just using @.
So ultimately it was just my mistake…again…:grin:

I would still like to know how to perform the task you suggested @saper

I tried looking for documentation on using the Rails console in Mastodon’s GitHub, but really couldn’t find anything solid.

That page has a good example:

irb(main):001:0> require 'net/smtp'
=> true
irb(main):002:0> Net::SMTP.start('localhost', 25) do |smtp|
irb(main):024:1* smtp.send_message <<EOM ,
irb(main):025:1" From: saper@saper.info
irb(main):026:1" To: saper@saper.info
irb(main):027:1" Subject: net smtp test
irb(main):028:1" 
irb(main):029:1" test 0001
irb(main):030:1" EOM
irb(main):031:1* 'saper@saper.info', 'saper@saper.info'
irb(main):032:1> end
=> #<Net::SMTP::Response:0x000000080332fe28 @status="250", @string="250 2.0.0 w2OEINEK037212 Message accepted for delivery\n">

You might need to give username and password after 25 like this:

Net::SMTP.start('dest-server', 25, 'mail-from-domain', 'username, 'password') do |smtp|

I can work with that. Much appraciate @saper !

1 Like