Why not test email during bootstrapping of app?


(Manthan Mallikarjun) #1

Hey!

Just wondering, why not send a test email to make sure SMTP is working while bootstrapping the app? If it fails, let the server admin know at the end so he can make a change.

Thanks.


(Jeff Atwood) #2

Fair point, it should probably be tested before bootstrapping even occurs, but does this not imply you are using two email accounts? One to send (the Discourse configured one) and one to recieve the test email and verify that it arrived OK?

That is a lot of credentials…


(Jens Maier) #3

You could provide a mailtest webservice… send email with random token to mailtest@discourse.org, poll mailtest.discourse.org/t/#{token} for true/false result. :grin:


(Allen - Watchman Monitoring) #4

Perhaps the people over at http://www.mail-tester.com/ would be interested in being a part?


(Michael Downey) #5

One does not need to send an email to test correct connectivity to and credentials for an SMTP server…

But I disagree that Discourse should be checking whether or not the SMTP server itself is fully functional. That is a job for monitoring tools or mail service providers to implement.


(Manthan Mallikarjun) #6

What @elberet said is correct. You could try sending an email to mailtest@discourse.org. If there are no errors sending the email, and mailtest.discourse.org/t/#{token} returns true, then mail is working.


(Manthan Mallikarjun) #7

The point of this is to let the admin know that the email is setup improperly, so when they go to create their account, they wont get confused.


(Allen - Watchman Monitoring) #8

9/10 times the mail server is just fine. Personally, I’d love to get an in-app notification of my discourse knew it couldn’t send email.


(Manthan Mallikarjun) #9

The problem with that is that the admin has to log-in and to log-in, they have to verify their email address. Its best if its during/before/right after bootstrapping.


(Jens Maier) #10

I like that idea, even if not in the context of bootstrapping a new Discourse but of monitoring a running Discourse’s health.


(Manthan Mallikarjun) #11

Changed the category to feature.


(Manthan Mallikarjun) #12

So any update @codinghorror? Will this be implemented?


(Allen - Watchman Monitoring) #13

Not to belittle testing email, but there are a number of other fish to fry which would allow more Discourse to get official hosting. Mostly centered around default category watch / mailing list mode settings for new users IMNSHO.

Also, I don’t know that I’ve seen a real valid method of testing… who’s going to run the testing service we can all count on? how are we going to set up the testing? How are those settings going to be reliable (and not cause false positives)


(Manthan Mallikarjun) #14

Can’t Discourse setup the servers? All they have to do is check to see the email is recieced and make a record in a database that the email has been received… I don’t think it’s that hard to maintain and host.


(Michael Downey) #15

Some people really don’t want a 3rd party to be automatically logging every time someone starts up their Discourse application.

It’s good to test out & monitor all parts of your IT infrastructure, but we don’t expect the Discourse web app to do TCP/IP diagnostics or make sure the server is working correctly, so email shouldn’t be any different.


(Allen - Watchman Monitoring) #16

“Just”

What language? Who pays for that database hosting? Why? What if I don’t want my discourse to reach out, or its not on the public wan?

Lots of layers here, not simple IMO


(Manthan Mallikarjun) #17

Ruby probably since thats what Discourse is written in.

Discourse itself. It would run on the same servers that Meta runs on.

There should be an option in the config to enable and disable mail checking.


(Kane York) #18

By the time you get to the site settings, that’s a little late already…


(Allen - Watchman Monitoring) #19

I meant, English, Russian, etc… the settings to explain how/why the email test are not trivial.

As for where the testing goes… the test will need to accept email even if spf & DKIM are failed - or outright blocked by DMARC.

While this is a great idea, and I’d love a way to have my discourse create a full loop of email send/receive test on bootstrapping, it’s not trivial and not something discourse can “just provide”.


(Manthan Mallikarjun) #20

No, in the app.yml, not the site setting.