Skip to content

Commit 8aa64bb

Browse files
committed
win32/sendmail.c/SendText(): move posting of DATA prior to stripped header computation
Removes some error handling and work if it fails
1 parent 004c630 commit 8aa64bb

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

win32/sendmail.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,14 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, const
504504
efree(tempMailTo);
505505
}
506506

507+
if (!Post("DATA\r\n")) {
508+
return (FAILED_TO_SEND);
509+
}
510+
if ((res = Ack(&server_response)) != SUCCESS) {
511+
SMTP_ERROR_RESPONSE(server_response);
512+
return (res);
513+
}
514+
507515
/* Send mail to all Bcc rcpt's
508516
This is basically a rip of the Cc code above.
509517
Just don't forget to remove the Bcc: from the header afterwards. */
@@ -578,20 +586,6 @@ static int SendText(char *RPath, const char *Subject, const char *mailTo, const
578586
}
579587
}
580588

581-
if (!Post("DATA\r\n")) {
582-
if (stripped_header) {
583-
efree(stripped_header);
584-
}
585-
return (FAILED_TO_SEND);
586-
}
587-
if ((res = Ack(&server_response)) != SUCCESS) {
588-
SMTP_ERROR_RESPONSE(server_response);
589-
if (stripped_header) {
590-
efree(stripped_header);
591-
}
592-
return (res);
593-
}
594-
595589
/* send message header */
596590
if (Subject == NULL) {
597591
res = PostHeader(RPath, "No Subject", mailTo, stripped_header);

0 commit comments

Comments
 (0)