SMTP connect error with Gmail after upgrade to 3.7

Re: SMTP connect error with Gmail after upgrade to 3.7

од Visvanath Ratnaweera -
Број на одговори: 0
Слика од Particularly helpful Moodlers Слика од Translators
Hallo Farid

I am not Emma. Your problem is also not of hers https://moodle.org/mod/forum/discuss.php?d=390369#p1573723, a similar one, but not the same. Belongs to a new discussion.

You wrote:
> I am running moodle 3.8.2 / Ubuntu18 /Droplet / Digital ocean.

Never used a Digital Ocean (DO) "Droplet". Seen discussions by people using DO and assume it behaves identical to any Ubuntu Linux Server.

> I configured outbound email on moodle to use the smtp.gmail.com with the org's gmail account but it did not work.

If that is the path you want to go, then trying something else won't solve the problem. How "it did not work"? What did you do exactly? What was the result after each step? Ref https://docs.moodle.org/38/en/Email_setup_gmail.

> I then installed postfix on ubuntu

This is a new route.

> and had to enable a 2-step verification with an app password on the google account.

This is not connected to Postfix, right? You just want to use a 2FA service provided by Google?

> I am able to send email out from my ubuntu server (using the mail command)

That is a good start. So your Postfix is accepting mail from the local machine and relaying them. Analyse the full mail headers of such a mail at receiving end to see whether it has gone through something Gmail. (Do not use a Gmail account as a recipient.)

> In the moodle GUI -- I replaced the SMTP hosts entry: smtp.gmail.com:587 by localhost (to point to my postfix MTA)

In the local "sendmail" (Postfix) method, you leave the Moodle SMTP setting at their default. See the screenshot.

> Site Admin --> Server --> Email --> Outgoing Mail config --> SMTP hosts: localhost

See the attached screen-shot.

> That did not work.

Watch '# tail -f /var/log/mail.log' as Moodle is delivering a e-mail.
Прилог moodle-smtp-default.png