Onepoll: Prevent errors with invalid mails (#13934)

This commit is contained in:
Michael Vogel 2024-02-24 13:18:44 +01:00 committed by GitHub
parent 1c5681c199
commit 44ce5471b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -213,7 +213,7 @@ class OnePoll
$mbox = null;
$user = DBA::selectFirst('user', ['prvkey'], ['uid' => $importer_uid]);
$condition = ["`server` != '' AND `uid` = ?", $importer_uid];
$condition = ["`server` != ? AND `user` != ? AND `port` != ? AND `uid` = ?", '', '', 0, $importer_uid];
$mailconf = DBA::selectFirst('mailacct', [], $condition);
if (DBA::isResult($user) && DBA::isResult($mailconf)) {
$mailbox = Email::constructMailboxName($mailconf);
@ -249,6 +249,10 @@ class OnePoll
$msgs = array_combine($msgs, $metas);
foreach ($msgs as $msg_uid => $meta) {
if (empty($meta->message_id)) {
continue;
}
Logger::info('Parsing mail', ['message-uid' => $msg_uid]);
$datarray = [