Forums | Mahara Community

Support /
SMTP Email Error: noreply address not being applied

Scott Korvek's profile picture
Posts: 3

17 March 2011, 1:43 PM

Hello.  Sorry to start another post on this issue, but I am loathe to sidetrack other's questions.  I did plenty of searching, and cannot find an answer anywhere in the forums or wiki.


I am using Mahara 1.3.3 clean install on shared hosting with inmotionhosting.  Everything works, but my emails sent by mahara are getting blocked.  I had the same problem with my moodle installation, but was able to configure it with SMTP email and a defined, working noreply address. However, this is not working with mahara.

I have created a noreply address and have verified that mail can be sent to and from that account.   The smtp server and authentication info in the config is correct. 

I have defined the cfg->noreplyaddress directive and ensured it's pointing to the correct address.  However, in the database config file, it wasn't picked up, instead pointing to (I use subdomains to separate the various applications on the server) which was the default probably put in before I set it in the config file myself.  So I changed the config file back to match what's in the database, again checking all the credentials, authentication, and that that email address can send/receive mail.

The mail is actually sent, but is blocked at the destination because the user's profile email address is being used as the from field, instead of the noreplyaddress as defined.  Since the email is coming from another domain, but claiming to be from the same domain as the recipeint, it's blocked by the receving mailserver (rightfully so). 

So again, I'm on shared hosting, my users are all likely going to be on the same domain which is NOT the domain on which moodle and mahara are installed, and I have no control over the recieving email server.  The solution for Moodle was to use the proper noreply address, and I have verified that that solution is working with Moodle.  However, the same cannot be said for Mahara, and I can't see any reason it wouldn't, as I'm doing everything the same between the two and the docs/forums lead me to belive that that's the correct solution!

Lastly, I noticed that there was a bug regarding the noreply address with an older release that was fixed in 1.2.5.  Could it have crept back in?




François Marier's profile picture
Posts: 411

17 March 2011, 5:18 PM

Hi Scott,

It does sound like it may be a bug in Mahara (as opposed to a problem with your mail server config).

Feel free to file a bug on the tracker and someone will take a look:



Scott Korvek's profile picture
Posts: 3

19 March 2011, 10:35 AM

I solved the problem in my install!

Maybe some of this information might be helpful to another user, and to the developers in fixing the issue.

I too am having the signup errors of "SMTP error: Something bad happenned... headers sent..."  whan someone mnets over from moodle (the only way accounts can be created) and mahara is trying to create the account and send the welcome email. 

So I created several dummy accounts with any other email address I have, and it works on the user creation on roaming over via mnet and I get the email with the correct noreply setting.

Seems like there were two problems with your code:

1) The database didn't pick up a noreplyaddress change in the config, and instead kept the original value.  Once I made the database and the config file match, all was ok.  But I shouldn't have to have gone digging into the database once fixing the config file-- so that's a bug.

2) I had a config file error (wrong case on the error log.. CFG-> vs cfg->) which was copied over from lib/config-defaults.php -- so that's a minor typo in your lib/config-defaults.php file with big consequences; and thus another easy-to-fix bug.


In doing the testing, I was following the troubleshooting info on the wiki and using the contact us form to send the test emails.  Peeking around the code I see that that is a rather "crude" form that takes the email given and passes it on to phpmailer as the from address.  The from email field is autopopulated since I am logged in, so the noreplyaddress is never used in this case.

After fixing the above problems, the contact form submissions still get blocked (obviously).  In a case where the noreplyaddress config directive is set, the form should be smart enough to substitute that address for the entered address (or better yet-- apply that address to the reply-to address, and use the noreply address as the "from" or "sender" fields to comply with proper envelope format and accepted relay rules) since in effect mahara is using the mailserver as a relay.

If that can't be done, perhaps you could include a switch to turn off the contact form and replace it with a email address url for contact (mailto) so the person trying to contact the admin can use their own mail system (less ideal I guess).

Lastly, until this is fixed, and possibly after, the troubleshooting docs shouldn't suggest using this form to troubleshoot email since the form itself is the problem!


Scott Korvek's profile picture
Posts: 3

A post by Deleted user was deleted

5 results