Dear friends,
It's been a couple of days of searching and experimenting different solutions to our peculiar problem of sending emails. Our server has been migrated at DigitalOcean, and since then emails have stopped working. I have tried two approaches:
1) Using a local server - but our messages continually go to SPAM and we'd need to set SPF parameters, etc.
2) Using Gmail's SMTP. That would be an easier solution and it had worked before, but now it's quite a pain.
Let me give you guys our configuration in the image attached. Our Moodle version is 2.8.2.
Our scenario is simple: no emails are being delivered. We send messages, but emails dont reach their respective destinations. I've been testing it using one-to-one messaging to debug. I have added the debug configurations at our config.php:
$CFG->divertallemailsto = 'brenojac@gmail.com';
$CFG->debugsmtp = 1;
And here's what we get in apache's error.log while trying to send a message:
sendmail: fatal: www-data(33): No recipient addresses found in message header
sendmail: fatal: www-data(33): No recipient addresses found in message header
sendmail: fatal: www-data(33): No recipient addresses found in message header
sendmail: fatal: www-data(33): No recipient addresses found in message header
Now, what could be the possible reason Moodle is not being able to get the recipient's address? That question I'd like your help to be answered.
Another simple test: We are able to reach Gmail's SMTP server at 465:
root@guinteract:/var/www/moodle# telnet smtp.gmail.com 465
Trying 74.125.29.108...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
best regards,
- Breno