Commit c29b241b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Return error when we can't get "To" info

parent 6c399753
Pipeline #72991 passed with stage
in 25 minutes and 10 seconds
......@@ -159,10 +159,12 @@ void AkonadiSender::sendOrQueueMessage(const KMime::Message::Ptr &message, Messa
const Transport *transport = TransportManager::self()->transportById(transportId);
if (!transport) {
qCDebug(MESSAGECOMPOSER_LOG) << " No transport defined. Need to create it";
qjob->deleteLater();
return;
}
if ((method == MessageComposer::MessageSender::SendImmediate) && !MessageComposer::Util::sendMailDispatcherIsOnline()) {
qjob->deleteLater();
return;
}
......@@ -183,6 +185,12 @@ void AkonadiSender::sendOrQueueMessage(const KMime::Message::Ptr &message, Messa
qjob->addressAttribute().setCc(cc);
qjob->addressAttribute().setBcc(bcc);
if (qjob->addressAttribute().to().isEmpty()) {
qCWarning(MESSAGECOMPOSER_LOG) << " Impossible to specify TO! It's a bug";
qjob->deleteLater();
return;
}
if (transport && transport->specifySenderOverwriteAddress()) {
qjob->addressAttribute().setFrom(
KEmailAddress::extractEmailAddress(KEmailAddress::normalizeAddressesAndEncodeIdn(transport->senderOverwriteAddress())));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment