I am fairly new to Elgg, but not to Linux and PHP. My server setup is:
Elgg version : Release - 2.3.2, Version - 2016092300
Apache/2.4.18 (Ubuntu)
PHP 7.0.15-0ubuntu0.16.04.4
ssmtp v2.64
When anyone sends requests a password reset, no email is sent. The following is from /var/log/apache2/error.log:
ssmtp: RCPT TO:<toaddress@example.com> (550 Sender verify failed)
[Tue May 23 08:16:50.151803 2017] [:error] [pid 18096] [client xxx.xxx.139.246:54768] ERROR: Unable to send mail: Unknown error, referer: https://xxx.xxx.org/social/
ssmtp has been verified to work successfully with the following code:
<?php
$address = "toaddress@example.com";
$subject = 'Test email.';
$body = 'If you can read this, your email is working.';
echo "Attempting to email $address...<br />\n";
if (mail($address, $subject, $body)) {
echo 'SUCCESS! PHP successfully delivered email to your MTA. If you don\'t see the email in your inbox in a few minutes, there is a problem with your MTA.';
} else {
echo 'ERROR! PHP could not deliver email to your MTA. Check that your PHP settings are correct for your MTA and your MTA will deliver email.';
}
I have inserted logging statements in the elgg/engine/lib/notification.php file and the email from and to addresses, and message body are being created correctly, I think.
It gets to the function "_elgg_notify_user" and seems to fail in the following function call (line 423).
try {
$result[$guid][$method] = call_user_func(
$handler,
$from ? get_entity($from) : null,
get_entity($guid),
$subject,
$message,
$params
);
} catch (Exception $e) {
error_log($e->getMessage());
}
I am not that familiar with Zend\Mail which I am assuming is being called in the above code. Is there configuration info on Zend\Mail transport options somewhere? If no one has any ideas, I may replace the above call with a straight PHP mail function call to get this working. I suspect that would break other notification methods, but I would rather have email working by itself than nothing.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Dirk@zenga
Dirk - 0 likes
- ihayredinov@ihayredinov
ihayredinov - 0 likes
- Dirk@zenga
Dirk - 0 likes
You must log in to post replies.Zend Mail is a decorator for sendmail. Does mail() work on its own?
The standalone PHP code shown in my initial post did send an email with my server configuration.
Try toggling broken mta in Elgg settings.
Zend Mail has pretty extensive documentation if you google for it. You can register your own notification handler and use SMTP, or better yet use a proxy such as SendGrid or Mailgun.
Try installing hypeNotifications to see if it works, there is an admin interface to send emails and configure the transport.
Try toggling broken mta in Elgg settings? I do not see any mta in Elgg settings.