- handle messages without recipients
- remove the the original message when we finished our job.
CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM, QP_EADDR);
CtdlFreeMessage(msg);
}
CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM, QP_EADDR);
CtdlFreeMessage(msg);
}
+ else
+ CtdlDeleteMessages(SMTP_SPOOLOUT_ROOM, &Msg->MyQItem->MessageID, 1, "");
RemoveQItem(Msg->MyQItem);
}
RemoveQItem(Msg->MyQItem);
}
+ if ((SendMsg==NULL) ||
+ (SendMsg->MyQEntry == NULL) ||
+ (StrLength(SendMsg->MyQEntry->Recipient) == 0)) {
+ return 0;
+ }
+
/* Parse out the host portion of the recipient address */
process_rfc822_addr(ChrPtr(SendMsg->MyQEntry->Recipient),
SendMsg->user,
/* Parse out the host portion of the recipient address */
process_rfc822_addr(ChrPtr(SendMsg->MyQEntry->Recipient),
SendMsg->user,
SendMsg->envelope_from = SendMsg->mailfrom;
}
SendMsg->envelope_from = SendMsg->mailfrom;
}
else
SendMsg->msgtext = NewStrBufDup(MsgText);
else
SendMsg->msgtext = NewStrBufDup(MsgText);
- smtp_resolve_recipients(SendMsg);
-
- QueueEventContext(SendMsg,
- &SendMsg->IO,
- resolve_mx_records);
+ if (smtp_resolve_recipients(SendMsg)) {
+ QueueEventContext(SendMsg,
+ &SendMsg->IO,
+ resolve_mx_records);
+ }
+ else {
+ if ((SendMsg==NULL) ||
+ (SendMsg->MyQEntry == NULL)) {
+ SendMsg->MyQEntry->Status = 5;
+ StrBufPlain(SendMsg->MyQEntry->StatusMessage,
+ HKEY("Invalid Recipient!"));
+ }
+ FinalizeMessageSend(SendMsg);
+ }