Testing Outbound Mail Server

Testing Outbound Mail Server

par Alan Cherwinski,
Nombre de réponses : 7

I have two Moodle installations on the same VPS. Both are Moodle 3.9.1 (Build: 20200713)

The Moodle Email settings for the Outbound SMTP server configurations are identical and correctly saved.

One site one I can test the email connection and delivery without any issue. On the second installation I click the "Test outgoing mail configuration"  and enter a valid email address and click send test message - nothing happens. The page begins to reload, but no error message is displayed. No failure to connect to STMP host - no information at all. Eventual the page loads without the Test outgoing mail configuration items.  I have turned on the debugging and don't get any messages.

Any suggestion on how to troubleshot the issue?


Thanks



Moyenne des évaluations  -
En réponse à Alan Cherwinski

Re: Testing Outbound Mail Server

par Ken Task,
Avatar Particularly helpful Moodlers

There's a plugin that might help trouble shoot this:

https://moodle.org/plugins/download.php/22516/local_mailtest_moodle39_2020092000.zip

When you send, set the option for from set to noreply@fqdnofmoodleserver

Even if you have smtp setup, my 3.7.highest had this in the header of the rec. message:

From: "(via 37)" <noreply@sos.somenet.net>
Subject: 37
Message-ID: <5f6b8813b0fd11.38504397/moodle37@sos.somenet.net>
X-Mailer: PHPMailer 6.0.1 (https://github.com/PHPMailer/PHPMailer)
X-Moodle-Originating-Script: https://sos.somenet.net/moodle37 => sos:local/mailtest/index.php:206
MIME-Version: 1.0
Reply-To: noreply@sos.somenet.net

39 ... same smtp settings

From: "(via M39)" <noreply@sos.somenet.net>
Subject: Moodle 39
Message-ID: <5f6b8befa27be9.37604822/moodle39@sos.somenet.net>
X-Mailer: PHPMailer 6.1.3 (https://github.com/PHPMailer/PHPMailer)
X-Moodle-Originating-Script: https://sos.somenet.net/moodle39 => sos:local/mailtest/index.php:206
MIME-Version: 1.0
Reply-To: noreply@sos.somenet.net

SMTP servers and Spam checkers/etc. can be picky ... one message from one instance will  work while another message from another instance gets trapped.  I happen to use sendgrid api for smtp so settings etc. are the same for each instance of moodle.

'SoS', Ken


En réponse à Ken Task

Re: Testing Outbound Mail Server

par Alan Cherwinski,
Hello Ken,
Thank you for the quick response. I had installed the pluggin on both servers as a test. It provided confirmation of mail server connection and delivery on the first server and provide no on screen results on the second server.

Attached is what appears after the mail test is submitted. The server is French.   I will look more carefully at the working email test header and compare it to your examples.  I suspect that the second server in not able to connect to the SMTP, but I don't understand why that error is not displayed. 

Thanks
Annexe Mail Test Results.jpg
En réponse à Alan Cherwinski

Re: Testing Outbound Mail Server

par Ken Task,
Avatar Particularly helpful Moodlers

Check your servers logs ... web/error/maillogs

Same VPS but using same fqdn for moodle instances?

Moodle's are not in a folder ... like moodle1 and moodle2 ... but using different FQDN's?

elearning.yournet.org

moodle.yournet.org

Dunno where you host, but hosting providers really don't want to become known as a home for 'spam kings/queens'.   Any hosting provider fine print restrictions related to mail?

Am really guessing ... only thing I can do via forums!

Could you install something like 'alpine' ... ssh/text based mail app.

That could be configured to send via smtp server and should log to your servers maillog.

'SoS', Ken



En réponse à Ken Task

Re: Testing Outbound Mail Server

par Alan Cherwinski,
Thanks Ken,
Please can you tell me how to find the error maillogs? Is this VPS or a Moodle server file?

The two Moodle servers have different and unique sub-domains and sit in different folders under the public_html. The host (LeaseWeb) is probably not blocking the emails due to volume (as there are only a handful of notifications on these installations).

Thanks
En réponse à Alan Cherwinski

Re: Testing Outbound Mail Server

par Ken Task,
Avatar Particularly helpful Moodlers

maillogs are related to email ... which isn't Moodle.  I would assume maillogs are probably in same area of where you could view web server error logs, but ...

Where they are located depends upon how provider set's up customers.

I don't host with Leaseweb and don't know what your Operating System is (nor distro - linux has several) ... so it's time for you to learn about where you host!!!  Maybe the following will get you close ... or at least started ...

https://kb.leaseweb.com/

https://kb.leaseweb.com/search?q=setup%20smtp

https://kb.leaseweb.com/products/hosting/email-hosting/managing-emails

Am also assuming you can contact LeaseWeb helpdesk.

'SoS', Ken

En réponse à Ken Task

Re: Testing Outbound Mail Server

par Alan Cherwinski,
Hi Ken,
I figured out my mistake. Server 1 is an English interface and Server 2 is French. The setting for "SMTP security" on the outbound configuration was not set properly to SSL on the French server as it is on the English. Without the SSL and an external SMTP host configured. Nothing was happening. All cleared up now - a stupid language/translation mistake of mine. Thanks for your help.
En réponse à Alan Cherwinski

Re: Testing Outbound Mail Server

par Ken Task,
Avatar Particularly helpful Moodlers

Good!

As is well that ends well!   But, still suggest you get more familiar with where to find things .... like logs for future issues.  (ya didn't think things were set once and forget it, did ya? ;)]

'SoS', Ken