Troubleshooting SMTP on CentOS University Campus

Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -
Number of replies: 17

Hi, I am getting this simple error: http://docs.moodle.org/25/en/error/moodle/cannotmailconfirm

Now, the settings and the host have both been double checked by administrators and network admins. Please offer any advice on troubleshooting the issue I am having. Are there error logs I can check?

Moodle 2.5.2 - App server and a database server, CentOS 6.4, university campus VMs. SELinux is completely disabled. No unusual ports for the smtp.

Average of ratings: -
In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
What is the mail server: sendmail, exim, postfix, ...?

What is in the mail log (/var/log/something)?
In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yep - need to know your mail server configuration. 

However, if (likely) you are pointing at a remote SMTP server. The first thing to do is to try this on the *Moodle Server* command line...

telnet your.mail.hostname 25

Obviously, replace your.mail.hostname with the name or IP of your mail server. If it times out or you get an error then there's your problem. In large organisations I always suspect firewalls regardless of what the admin staff say wink

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Ken Task -
Picture of Particularly helpful Moodlers

While Howard's test via telnet is valid, it only test connection to port and not the full process of sending mail.  One would have to go further with aweful commands to test actually sending.

Suggest installing alpine from any repo your CentOS 6.4 server is using.  Alpine is the old text based mailer that used to be known as pine.

Once installed, any user that has ssh access to the server can login and launch alpine.   From the command prompt, simply enter: alpine [ENTER]. 

In the alpine config, set it up to use the SMTP server you are using in Moodle.   Once that's done, compose a message to some address you can check and test.

Alpine will tell you right away if it can send/relay via SMTP server or not and in inspecting the maillogs ... usually in /var/log/ one might see specific reasons for failure which then gives you a clue as to what to do.

'spirit of sharing', Ken

Average of ratings: Useful (2)
In reply to Ken Task

Re: Troubleshooting SMTP on CentOS University Campus

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Ken

What is awful in this: https://moodle.org/mod/forum/discuss.php?d=227247#p986869 ?
;-P

@Daniel
Obviously you have to replace 'localhost' by the mailserver's IP address or hostname, if it is external.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

Ah hah!

Very interesting. SMTP can't send mail outside the university accounts:

MAIL FROM: noreply-xxxx@blah.edu
250 2.1.0 Sender OK
RCPT TO: daniel@exodomain.com
550 5.7.1 Unable to relay
RCPT TO: daniel@exodomain.com
550 5.7.1 Unable to relay
RCPT TO: dlombardo@blah.edu
250 2.1.5 Recipient OK


Another piece in the puzzle.

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Doesn't puzzle me at all. That server is maintained by the univ. for outgoing mail. They have made a policy decision on allowed mail addresses. You need to talk to the IT dept. of your univ.
In reply to Visvanath Ratnaweera

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

Apparently not quite so simple - it's the smtp authentication. The reason it sends ok to local email addresses is that you don't need to authenticate to use that (university side), but you do for sending to outside mail. The problem appears to be something about the PHP not being compatible with the Microsoft Exchange mail server.

PHP 5.5.3

Error message from PHP mailer script:

authentication failure [SMTP: No supported authentication methods (code: 250, response: EXMS1.DOMAIN Hello [MY.SERVER.IP]

Keep on trucking.

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
If it is SMTP-Auth, how do you expect Moodle to find the credentials?

Having never configured Moodle for SMTP-Auth, I don't know whether it is possible. Your best bet is to run a local SMTP server, like postfix, make it relay the Moodle generated mails through the campus server. For that to work, the administrator of the campus server must share the credentials with you.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

This afternoon the administrator tried extremely hard to find out how it could be done. It was quite fun to watch, should have made screencast.

If anyone out there can help with SMTP-Auth please let me know.

Vis, I will likely do that if nothing turns up. But in the meantime should I start a new thread called Troubleshooting SMTP-Auth or something?

 

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hallo Daniel

Sure, you should check the SMTP-Auth capability of Moodle. The interface suggests that it could. See - Site administration - Plugins - Message outputs - E-mail:
- SMTP hosts:
- SMTP security (None | SSL | TLS)
- SMTP username:
- SMTP password:

Pl. notice that the local SMTP suggested above does not need Moodle to handle SMTP-Auth.

Sure, I would love to see the screen-cast. I imagine a dinosaur under the microscope if the patient has anything to do with an "Exchange"!
;-P


In reply to Visvanath Ratnaweera

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

Yes, it's not accepting the mail will all credentials accurate. We wrote a little tester script in php also, but that also will not accept mail with SSL or TLS authentication. Head scratching for now - put that one back in the IN tray.

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
When you say 'it', you mean a Microsoft Exchange server, right? Doesn't 'it' have a decent error log? (I know, the dinosaurs don't respond.) Debugging only on the client side is just trial-and-error.

Ad-hoc PHP programs are error prone. You can try digging deeper in telnet, if you know SMTP-Auth. A random web search brought this: http://www.computerperformance.co.uk/exchange2010/exchange_2010_smtp_auth_login.htm, for example.

Another method is to configure a mail client first to relay mail through 'it'. I can think of mutt and Thunderbird, or alpine as Ken suggested. Then translate those values into Moodle.
In reply to Ken Task

Re: Troubleshooting SMTP on CentOS University Campus

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

true - but my experience is that you don't get that far. The firewall is usually blocking access.

In reply to Ken Task

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

Alpine was pretty useful thanks, I got to see a whole new array of error messages telling why I could not authenticate with SSL. I'm not being facetious, that's really useful right now ;)

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

Thank you for these marvellous replies - as always Moodle Masters jump to my rescue - love you folks. I'm troubleshooting this in my next AM.

Yes, remote host: smtp.blah.edu:25

I also have the IP address and got going previously with telnet, so I'll get back soon.

Peace.

 

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

Here's another point. I tried it out by setting one of my testing accounts to have a university email address - and the password reset worked!

But the send person was me (my Admin User account), I thought and would prefer that the Password Change response came from my noreply account at the university. Can't find the setting to change that.

In reply to Daniel Lombardo

Re: Troubleshooting SMTP on CentOS University Campus

by Daniel Lombardo -

Hey hey, this is changed by changing the name of the Support contact:

Site administration > Server > Support contact > Yay.