UksusoFF/webtrees-reminder

Can't send email

Closed this issue · 6 comments

When try to send notification with url, email can't be send because module try to send email with admin's email address.
Webtrees logs:

MailService: Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients "

Mail Server Logs:

NOQUEUE: reject: RCPT from hostname[ip]: 553 5.7.1 <myadminemail@domain.com>: Sender address rejected: not owned by user mail@domain.com; from=<myadminemail@domain.com> to=<myadminemail@domain.com> proto=ESMTP helo=<domain.com>
NOQUEUE: reject: RCPT from hostname[ip]: 553 5.7.1 <myadminemail@domain.com>: Sender address rejected: not owned by user mail@domain.com; from=<myadminemail@domain.com> to=<someuser@outlook.com> proto=ESMTP helo=<domain.com>

It works when i give permission to send email as myadminemail@domain.com to mail@domain.com

Can you post screenshot of your /admin/email page?

I guess the problem is this module send email as contact user.

$author = $this->users->find((int)$tree->getPreference('CONTACT_USER_ID')) ?: new SiteUser();
should be change as $author = $this->users->find((int)$tree->getPreference('SMTP_FROM_NAME')) ?: new SiteUser();
There is a to do here;
$author, //TODO: Maybe use Site::getPreference('SMTP_FROM_NAME');

Can you try latest master?

Its now working with master

Seems it's better way. In my instance CONTACT_USER_ID equals SMTP_FROM_NAME so it's worked.