}
efree(tempMailTo);
+ if (mailCc && *mailCc) {
+ tempMailTo = estrdup(mailCc);
+ /* Send mail to all rcpt's */
+ token = strtok(tempMailTo, ",");
+ while(token != NULL)
+ {
+ snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
+ if ((res = Post(Buffer)) != SUCCESS) {
+ efree(tempMailTo);
+ return (res);
+ }
+ if ((res = Ack(&server_response)) != SUCCESS) {
+ SMTP_ERROR_RESPONSE(server_response);
+ efree(tempMailTo);
+ return (res);
+ }
+ token = strtok(NULL, ",");
+ }
+ efree(tempMailTo);
+ }
/* Send mail to all Cc rcpt's */
- if (headers && (pos1 = strstr(headers_lc, "cc:"))) {
+ else if (headers && (pos1 = strstr(headers_lc, "cc:"))) {
/* Real offset is memaddress from the original headers + difference of
* string found in the lowercase headrs + 3 characters to jump over
* the cc: */
efree(tempMailTo);
}
- if (mailCc && *mailCc) {
- tempMailTo = estrdup(mailCc);
+ /* Send mail to all Bcc rcpt's
+ This is basically a rip of the Cc code above.
+ Just don't forget to remove the Bcc: from the header afterwards. */
+ if (mailBcc && *mailBcc) {
+ tempMailTo = estrdup(mailBcc);
/* Send mail to all rcpt's */
token = strtok(tempMailTo, ",");
while(token != NULL)
}
efree(tempMailTo);
}
-
- /* Send mail to all Bcc rcpt's
- This is basically a rip of the Cc code above.
- Just don't forget to remove the Bcc: from the header afterwards. */
- if (headers) {
+ else if (headers) {
if (pos1 = strstr(headers_lc, "bcc:")) {
/* Real offset is memaddress from the original headers + difference of
* string found in the lowercase headrs + 4 characters to jump over
}
}
- if (mailBcc && *mailBcc) {
- tempMailTo = estrdup(mailBcc);
- /* Send mail to all rcpt's */
- token = strtok(tempMailTo, ",");
- while(token != NULL)
- {
- snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);
- if ((res = Post(Buffer)) != SUCCESS) {
- efree(tempMailTo);
- return (res);
- }
- if ((res = Ack(&server_response)) != SUCCESS) {
- SMTP_ERROR_RESPONSE(server_response);
- efree(tempMailTo);
- return (res);
- }
- token = strtok(NULL, ",");
- }
- efree(tempMailTo);
- }
-
if ((res = Post("DATA\r\n")) != SUCCESS) {
efree(stripped_header);
return (res);