Moodle 1.9.19+ Error with E-mail registration

Moodle 1.9.19+ Error with E-mail registration

Sergey Muha -
回帖数:7

Hello community

I am trying to configure Email-based self-registration for Moodle 1.9.19+ on LAMP environment

I have set next configuration.

Email-based self-registration yes

SMTP hosts  smtp.gmail.com:465smtphosts

SMTP username      moodlemgiro@gmail.comsmtpuser
SMTP password   xxxxxxxxsmtppass

But when I have try to create new user and always received error

Notice: fputs(): send of 22 bytes failed with errno=32 Broken pipe in /var/www/moodle/lib/phpmailer/class.smtp.php on line 489 Notice: fputs(): send of 12 bytes failed with errno=32 Broken pipe in /var/www/moodle/lib/phpmailer/class.smtp.php on line 146 ERROR: The following From address failed:

Ubuntu 12.04.5 LTS \n \l

Could some one help me to investigate this issue

回复Sergey Muha

Re: Moodle 1.9.19+ Error with E-mail registration

Sergey Muha -
I have used another mail server my own mail.adminim.by  with smtp at 25 port and message sent good.

回复Sergey Muha

Re: Moodle 1.9.19+ Error with E-mail registration

Ken Task -
Particularly helpful Moodlers的头像

Which is *exactly* what I was going to tell you to try!   Does this now mean you consider this issue to be resolved?

IF so, let's hope it stays that way .... old version of Moodle.

In 1.9.19+ PHPMailer 1.73 library
In 3.1 of Moodle PHPMailer 5.2.14 library

pipe broken is usually an indication of a networking issue.

mail.adminim.by is setup to allow relay from any server in the minsk.edu.by domain.

Would suggest to you now that the old FQDN you used ... nonprod.minsk.edu.by ... be removed from DNS and only the production FQDN remain.

Now the issues that might arise relate to the other end of messages sent via that SMTP server to users whose addy might be at places like gmail.com.   The SMTP server to which you've pointed your Moodle has only MX record.    Check your settings for EMail addresses used replyto address, etc.

'spirit of sharing', Ken

回复Ken Task

Re: Moodle 1.9.19+ Error with E-mail registration

Sergey Muha -
Unfortunately issue isn't resolved because I want use gmail account.

Gmail mail use 465 port for smtp and mail hasn't sent

I think some where at moodle code should exist config for port and SSL/TLS
回复Ken Task

Re: Moodle 1.9.19+ Error with E-mail registration

Sergey Muha -

Thank you Ken

I have found code that fix this e mail issue

next links help me

https://docs.moodle.org/22/en/Email_setup_gmail

https://moodle.org/mod/forum/discuss.php?d=51833

I have change in moodle/lib/phpmailer/class.smtp.php

bold and underlined code have been added

....

 function Connect($host,$port=0,$tval=30) {
        $host = 'ssl://' . $host;# set the error val to null so there is no confusion
        $this->error = null;
.....

This issue have been resolved.

回复Sergey Muha

Re: Moodle 1.9.19+ Error with E-mail registration

Ken Task -
Particularly helpful Moodlers的头像

Congrats.

Did you also read the part on the first link that mentioned DNS?

Google education edition with 1.9.9

When using Google Education Edition with 1.99

The latest php mailer is paramont. If someschool.edu email at google is not accepting mails from the moodle as valid mails you need to create an SPF record at your host, allowing mail from the Central Mail server, Google and the local server which satisified Google's validation desires.

@ 14400 IN TXT "v=spf1 ip4:174.121.161.XXX include:aspmx.googlemail.com mx:c1.hostname.com ~all"

This bit is server side more than moodle so if you are on managed or shared hosting the server admin will have to do the record (try submitting a request to have the record added with full details of how and why to do so) then follow the previous the directions in this record.

While above is about a lower version of moodle and google edu,  could have done the same for your now moodle host (which is different from Windows server I would assume) and it's something I mentioned before that yoiu might try.   True, moodle server isn't a mail server but it does send mail if using forums etc.

And, there's the limitation ... does the site use the Front Page forum to which all users on the system are subscribed?    I did see announcements on the site.    How many users do you hae on the system?

As long as one stays at 1.9.19+, can live with the limitations,  and doesn't migrate the server upwards to 2.x or 3.x you might be ok.    Make note of it ... keep the note for when you do move higher.

'spirit of sharing', Ken


回复Ken Task

Re: Moodle 1.9.19+ Error with E-mail registration

Sergey Muha -
The site have approximately 18K users
I will check note about Front page forum
I don't have time to continue migration and will resume maybe after some month. I will note sfp step.

Thank you . I am really apreciating your help.