Moodle + Exchange Email Problem

Moodle + Exchange Email Problem

by Ian Kennedy -
Number of replies: 20
Moodle + Exchange Email Problem
###############################

Hello All,

We are having a problem getting moodle to send any emails at all.

We have it set up on two different machines, one as the main Moodle site,
and another on a desktop as a test machine.  Both Moodles are version 1.4.3.

The desktop is running XP Pro, Apache, EasyPHP.
The main site is the same but on a server running Windows Server 2003.

We are trying to send emails through our Exchange Server 2003.

I have tested the account moodle is to use for sending emails and that works fine.

I have looked all through these forums and tried different variations to do with the mail settings.
I have even tried using an external smtp server and tried sending the mail from that account.

It seems that from the log files, that moodle will only try to send email from the admin account, when any other account is specified, it appears to do nothing.

The errors...

I think this appears when moodle is set to use our Exchange Server.
forum mail digest err
library mailer  ERROR: The following From address failed:
forum mail error

This error appears when using the external mail system.
library mailer     ERROR: SMTP Error: The following recipients failed:

If anyone could explain any of these errors or offer any advice it would be great.

Thanks very much...

Ian
Average of ratings: -
In reply to Ian Kennedy

Re: Moodle + Exchange Email Problem

by Bruce Long -

Ian,

I can't help, but I can add my cry for help. I have a similar situation. I am running Moodle on a test platform with a WinXP pro machine with Easy PHP and Apache.

I keep trying to set up new accounts and it always says there was a failure to send the email confirmation to the new user. I have tried leaving the smpt settings blank as well as putting in an account on our Exchange server (2003).

I, too, would appreciate any direction. Frankly, it would be great if the Apache server would just handle it.

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I can't help either, sorry!

This problem is generally called propriatory lock-in sad

On an open plattform like LAMP there are much more people who will help you out.
In reply to Ian Kennedy

Re: Moodle + Exchange Email Problem

by David Wilkinson -

Ian,

I am a former exchange 2000 and 2003 administrator, and I am familiar with Windows 2003 and Moodle. I can help you, but it will probably take some protracted communication over the next 2-3 days as I am quite busy right now with a SharePoint Portal server configuration and install.

First of all, I will assume that you have Moodle installed on a separate win2k3 box, from your exchange server.

You will need either the IP address of your exchange server or the DNS name of the exchange server.

Check to make sure that smtp service is running on the exchange server.

Create an eschange account for moodle:

moodleadmin@<yourdomain>.com

Go into moodle and configure the smtp settings adding in the three settings:

server address (which will most likely be <servername>@<yourdomain>.com
user name you created: moodleadmin@<yourdomain>.com
password

For starters, please send me a description of your exchange architecture. In other words, do you have a front-end server and a back-end server, or do you host exchange all on one server. This will help.

Also, for testing purposes, find BLAT on the net and download the windows version. It is excellent for testing pieces of a mail system.

Regards,
David

In reply to David Wilkinson

Re: Moodle + Exchange Email Problem

by Bruce Long -

David,

Since I have a similar problem, I am hoping to "listen in" on your communication with Ian. I am running Moodle 1.5.2, but I am running on an Apache installation on a WinXP Pro box. It is on our network as a test machine for me to test Moodle--verses being a "live" web server. We have an Exchange 2003 server that is all on one server.

I tried putting in the Exchange information and just put in my Exchange email address. That didn't work. Does it need to have it's own email account on the exchange server in order to work?

I will check with our network admin to be certain the smtp service is running on our Exchange server.

Thank you for your willingness to lend your expertise to the forum.

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by David Wilkinson -

Hi Bruce,

I have no problem with you 'listening in'. That's what the Moodle community is about!

You should be able to test with your own email account. You just need to have a valid "active directory/exchange email account" to connect with.

Yes, check to make sure that the smtp service is up and running on the exchange box.

Here is a free diagnostic tool from Microsoft to diagnose your smtp problems, this might be helpful.

smtp diag

Hope this helps,
David

In reply to David Wilkinson

Re: Moodle + Exchange Email Problem

by David Wilkinson -

Hi,

Here is another tool that might be helpful:

Exchange 2003 might be denying a connection to your moodle server...

smpt accept/deny configuration tool

This will tell you what the Exchange server is doing with smtp requests, and if it is denying your moodle server a connection.

HTH,
David

In reply to David Wilkinson

Re: Moodle + Exchange Email Problem

by Bruce Long -

David,

Thank you! I will work with these tools and our IT folks to see if I can trace down the problem.

I'll report back. Good luck onthe project you're working on smile

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by David Wilkinson -

Hi,

One more thought.

I believe that you need a smtp address in your exchange email for the target user account.

In the exchange administrator, you must add a smtp email address for that user, otherwise, exchange does not have a reference for that account.

Active Directory Users and Computers->user account->properties->email addresses tab

Add an smtp address...

<first.last>@<yourdomain>.com

David

In reply to David Wilkinson

Re: Moodle + Exchange Email Problem

by Ian Kennedy -
Hello David,

Thanks very much for your assistance, and i must apologise for not getting back to this thread earlier.

Here I can confirm some further details about our set-up...
Our 2 Moodles and our Exchange server are all installed on different boxes,
Our Exchange installation is all on the one server.

The settings we have put in the configuration / variables relating to email are as follows...

SMTP Hosts : This field is the IP address of our mail server
SMTP User : This field has the email address for our moodle account (moodleadmin@...)
SMTP Pass : This field is the password for our moodle email account

We had set up an email account for moodle on the exchange.

I have tried the smtpdiag tool and Blat,
smtpDiag showed all processes completed sucessfully (green), and using Blat, I was able to send mail using moodle's mail account.

The strange thing is, when the SMTP User field is set to the address moodleadmin@... the error log still shows 'The following From address failed' moodle@... (no admin) - Is there a setting somewhere in the config files that i'm missing ?

Thanks Very Much,

Ian
In reply to Ian Kennedy

Re: Moodle + Exchange Email Problem

by Bruce Long -

Ian,

As you have probably read, I'm dealing with a similar issue. I have a similar setup and have similar settings. I discovered my smtp issue when experimenting with creating new accounts. It takes the account fine, but it tells me the email failed.

I  have not yet tried the two diagnostic tools, but I have discovered something interesting. If I set up a new account with an email address in our domain, the email goes through just fine. Have you seen that?

It baffles me, and our IT person is not sure what to make of it either (all of our servers are Windows-based, so the Apache environment is unfamiliar to him).

Bruce

In reply to Ian Kennedy

Re: Moodle + Exchange Email Problem

by David Wilkinson -

Hi,

Here is my best guess about that. The moodle program attempts to set the "From:" address to the email of the moodle admin account. You probably need to either one of the following:

Change the moodle admin email to a valid exchange email address
or
Add the moodle admin email to exchange.

hth,
David

In reply to David Wilkinson

Re: Moodle + Exchange Email Problem

by Bruce Long -

David,

Although I have checked everything you suggested, I have not used any of the diagnostic tools. I am completely unfamiiar with them. When I looked them up on the web, it wasn't clear to me whether the tools needed to be loaded on my Moodle server or if the IT director needed to run them on the Exchange server. I don't have access to the Exchange server.

Here's the reason I'm writing. After making certain everything was like you said (my Exchange account is the admin account, it has an smtp address in Exchange, smpt is turned on, I know the Moodle server can talk to the Exchange server), I am able to send limited email from Moodle: it will send ONLY to email accounts with our domain.

So, if I create a new user account and give it a mydomain.edu email address, it works perfectly. It send the confirmation email right through with no errors reported. If I put any other email address in the new account, it always reports a failure to send. It even does this with email address that are in our Outlook global directory but not mydomain.edu addresses.

This makes me think it is working, but there is a setting at one end that needs to be changed. I've talked to the IT director, and he doesn't know what it might be. Do you?

I have been considering reinstalling EasyPHP/Apache/MySQL and Moodle. Might that help?

I have also wondered if the issue is that the Moodle server (WinXP machine with EasyPHP/Apache/MySQL and Moodle) needs to have an external IP address. It is sitting on our network with a LAN static IP. It didn't seem like that should make a difference, but I thought i would ask.

Finally, I want to confirm that IIS should be OFF on the Moodle server. Is that correct? I didn't even load IIS, since I thought it would be a conflict with Apache.

Thanks for your help.

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by Bruce Long -

OK, it struck me to try using the smtp server from my email account at my  home ISP. I changed my admin account email to my home email and changed the smtp settings. Boom! everything works perfectly.

Does this indicate a specific setting issue with our Exchange server?

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by David Wilkinson -

Bruce,

To answer your question from a previous post, you do not need IIS turned on, on your moodle server. You already have apache. In fact, if you have been able to get apache to play nice with windows, than you are probably further ahead at this point, and IIS "should" be turned off in this instance.

Two:
"Does this indicate a specific setting issue with our Exchange server"

Yes, this means that your exchange server (mail environment) is not configured to send email to external email addresses, or maybe the moodle server is attempting to "relay" mail to the exchange server and exchange is not accepting this type of email.

The first place to look is at your DNS MX records:

http://computerperformance.co.uk/exchange2003/exchange2003_MX_records.htm

I will forward any other information I can find tomorrow.

David

In reply to David Wilkinson

Re: Moodle + Exchange Email Problem

by Bruce Long -

David,

Thanks for the confirm on IIS. It didn't make any sense to me to need IIS, but I was getting a bit desperate smile

Since our Exchange server sends just fine to external email addresses, the issue must be that the Exchange server is not accepting relay mail. I will ask the admin about that specifically.

I believe the Moodle server is working just fine since:

1) It can send to itnernal email addresses over our Exchange server.
2) It can send to external email addresses when I assign an externalsmtp server.

I would prefer that the mail go through our Exchange, so I will see if it is blocking relay mail.

Thanks,

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by Bruce Long -

Our IT admin says that he has all relaying turned off, so that explains the issues I was having. He says that if you allow any relaying that your exchange server can get "blacklisted" as a possible source of relayed spam.

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by David Wilkinson -

Bruce,

Heh, I will try to be polite with this reply. Yes, there is a grain of truth to the blacklist statement. However, IMHO, his comment does not apply to this situation, he appears to be giving you a line of "you know what":

You can (if you know what you are doing) configure your exchange server to only accept a relay from an "internally" generated email server. That is, you can specify a down-level smtp server (i.e. your moodle box) so that exchange will "accept" sent email to the exchange server, without turning on relay for the whole box, and the whole organization. This will prevent your domain from being blacklisted.

Also, the moodle server is using a specified mailbox and a specified password to make the connection, so that will prevent "internal" hackers from using the box as a relay, unless they know the mailbox id (aka the AD account) and the password. Hopefully, your exchange server is behind a firewall, and maybe even two firewalls, so that it is properly walled out from the external internet.

So, your IT Director, or designated staff "Should" be able to set the exchange server up so that only the Moodle server "relays" email to the exchagne server, and then the exchange server can "send" the email out of it's own gateway in a protected manner.

Let me know if I can be of any assistance with this in the form of links or how-to's if you want to continue to educate the IT Director.

Regards,
David

In reply to David Wilkinson

Re: Moodle + Exchange Email Problem

by Bruce Long -

David,

Thank you for your polite reply smile

Right now I am beta testing Moodle internally with just our faculty. I think I'm going to leave it set to an external smtp server for a while, and then work towards getting it to email through the Exchange server.

Exchange is behind a firewall, and we are about to upgrade the firewall.

I think our IT director will be able to open up Exchange to accept internal email relay, but I may seek your help if I need links to convince him that it won't blacklist us.

Thanks again,

Bruce

In reply to Bruce Long

Re: Moodle + Exchange Email Problem

by mohammaed moreb -

Hi Bruce Long

I search about send emal using MS Exchange and i read many articals about this problem but in university the student can recive the email from moodle if their email located locally ( the same domain) but if i tray to send to yahoo or gmail i recive error massage thate cant send massage

any help

In reply to mohammaed moreb

Re: Moodle + Exchange Email Problem

by Amit Krishineel Prasad -
I face the same error. I have exchange 2010 installed. I have moodle 1.9+ installed on linux (ubuntu 10.04 desktop edition). in the email settings, SMTP: IP of my exchange
username: administrator
Password: of the administrator.
setup is intergrated with LDAP (MS) too.
when a user logs in - it asks to update the profile (here is the main problem)
when the user click update - it cannot send email to outside domain (other domains apart from the one exchange is on)

if i change the email to local domain (x@x.ac.fj) it goes through.

is something that i am missing....

please help anyone....