If mailbox (ex uvd-office@example.org) is part of a forward list (ex: office@example.org), the following check fails:
MailboxService::processMail($rawEmail) {
// ...
foreach ($addresses['to'] as $mailboxEmail) {
if ($this->getMailboxByToEmail(strtolower($mailboxEmail))) {
$mailData['replyTo'] = $mailboxEmail;
}
}
// Process Mail - References
$addresses['to'][0] = strtolower($mailData['replyTo']) ?? strtolower($addresses['to'][0]);
// ...
ErrorException with message "Notice: Undefined index: replyTo" on line 325 is thrown because $mailData['replyTo'] is not set and when strtolower() is called, error is throwed and further processing of the message is halted.
Proposed solution:
MailboxService::processMail($rawEmail) {
// ...
$mailData['replyTo'] = ''; // Set replyTo empty by default to prevent the error.
foreach ($addresses['to'] as $mailboxEmail) {
if ($this->getMailboxByToEmail(strtolower($mailboxEmail))) {
$mailData['replyTo'] = $mailboxEmail;
}
}
// Process Mail - References
$addresses['to'][0] = strtolower($mailData['replyTo']) ?? strtolower($addresses['to'][0]);
// ...
If mailbox (ex uvd-office@example.org) is part of a forward list (ex: office@example.org), the following check fails:
ErrorException with message "Notice: Undefined index: replyTo" on line 325 is thrown because $mailData['replyTo'] is not set and when strtolower() is called, error is throwed and further processing of the message is halted.
Proposed solution: