getStatus() === LocalMessage::STATUS_IMAP_SENT_MAILBOX_FAIL || $localMessage->getStatus() === LocalMessage::STATUS_PROCESSED) { return $this->processNext($account, $localMessage, $client); } $user = $this->userManager->get($account->getUserId()); if ($user === null) { $this->logger->error('User {user} for mail account {id} does not exist', [ 'user' => $account->getUserId(), 'id' => $account->getId(), ]); // What to do here? return $localMessage; } $this->service->onBeforeMessageSent( $user, $localMessage, ); // We don't react to a ratelimited message / a message that has too many recipients // at this point. // Any future improvement from https://github.com/f7cloud/mail/issues/6461 // should refactor the chain to stop at this point unless the force send option is true return $this->processNext($account, $localMessage, $client); } }