UksusoFF / webtrees-reminder

webtrees module for sending daily anniversaries list
20 stars 2 forks source link

Can't send email #12

Closed ekremparlak closed 4 years ago

ekremparlak commented 4 years ago

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

UksusoFF commented 4 years ago

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

ekremparlak commented 4 years ago

Screenshot_2020-08-16 Sending email

ekremparlak commented 4 years ago

I guess the problem is this module send email as contact user. https://github.com/UksusoFF/webtrees-reminder/blob/3058d142b6ac77144d0113301360a03fb290466d/src/Http/Controllers/CronController.php#L125 should be change as $author = $this->users->find((int)$tree->getPreference('SMTP_FROM_NAME')) ?: new SiteUser(); There is a to do here; https://github.com/UksusoFF/webtrees-reminder/blob/3058d142b6ac77144d0113301360a03fb290466d/src/Http/Controllers/CronController.php#L135

UksusoFF commented 4 years ago

Can you try latest master?

ekremparlak commented 4 years ago

Its now working with master

UksusoFF commented 4 years ago

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