SMTP configuration

SMTP configuration

by Adam Smith -
Number of replies: 6

Hi all, until today we have never needed the set up of SMTP on our moodle site, we have used the PHP mailer. Version is 2.4.4. 

Over night students had stopped getting feedback notifications from tutors, rather we  were receiving this error message: (even though we have already contacted the student before)

Failure notification

I have not set up SMTP with our Microsoft exchange account but not we are not receiving notifications as well as the student. 

Any help is appreciated.


Adam


Average of ratings: -
In reply to Adam Smith

Re: SMTP configuration

by Ken Task -
Picture of Particularly helpful Moodlers

Don't have an answer ... just suggestions as to where you might look ...

From what you've shared ... looks like server is using Exim as an MTA ... on the server.

So the first place to check is/are the Exim logs.

I don't run Exim so ... https://www.exim.org/exim-html-current/doc/html/spec_html/ch-log_files.html

I also see the phpmailer code claiming to be from Google?!!!

On a CentOS 7 Moodle 3.4.highest git installed instance (no hacks) the headers of a message sent from that to an address shows:

X-Mailer: PHPMailer 6.0.1 (https://github.com/PHPMailer/PHPMailer)

So has your server been customized to use Google's phpmailer code or ID as using Google phpmailer code?

https://code.google.com/archive/a/apache-extras.org/p/phpmailer/issues

The noreply address using IP address ... even though the IP of the server .. is sometimes caught be spam checkers.  Suggest using noreply@learning.yourdomain.network ... that is the true server.

'spirit of sharing', Ken



In reply to Ken Task

Re: SMTP configuration

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hello Everyone,

I also see the phpmailer code claiming to be from Google?!!!

it's an old PHPMailer version, the one distributed with Moodle 2.4.x, precisely the weekly 2.4.4+ released on 21 Jun 2013.

Not sure why we're talking about Exchange here when Moodle is sending emails to Exim: that error looks like an issue with relay, something has changed in the SMTP server configuration.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: SMTP configuration

by Ken Task -
Picture of Particularly helpful Moodlers

Well, I'll be darn ... confirmed ... it is a 2.4.x and the Google APIs Client Library is present (vr. 1.1.7).   Boy, that was a short-lived jaunt ... wasn't it!

The thing about 'exchange' ... may not be a true 'exchange' server ... in investigating the mail DNS records related there is an 'inbound message exchange' involved in the flow of mail from Moodle server ... probably back to teachers/students within that domain.

Matteo is correct ... and just to add ... troubleshooting tip ... follow the path ... moodle -> phpmailer -> Exim -> whatever the next hop is ... the inbound servers?   Server is hosted in the 'cloud' (not amazon/google/azure, but a hosting provider).  Is Exim setup with a smarthost? (all mail sent to Exim MTA is directed to a mail server to handle relays [the 'smarthost]' or in other terms 'an STMP relay').

Has the SMTP relay(s)/server(s) been picked up by SpamHause or other?   Exim mail servers logs *might* show that.

All in all ... a convoluted mail setup.

'spirit of sharing', Ken


In reply to Matteo Scaramuccia

Re: SMTP configuration

by Adam Smith -

Hi Matteo and Ken, 

Thank you for your suggestions. 

Matteo - you say it may be an issue with relay? I have no experience with this.  What should I be checking? 

Thanks 

Adam

In reply to Adam Smith

Re: SMTP configuration

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Adam,
you need to get in touch with who is managing that SMTP server to get the logs and search for the exact error: if the relay issue will be confirmed, someone has recently changed the configuration of the SMTP server and she/he need to "open the relay" to the server hosting your Moodle instance since you were able in the past to access to it to relay Moodle mail messages.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: SMTP configuration

by Adam Smith -

Hi, 

I have done that and 90% of the problem has been sorted. 

The problem seems to be that Microsoft have blocked us, I have sent the request to get this removed.

Many thanks 


Adam