+ if ( ( (buf[0] == 13) || (buf[0] == 10)) && (in_body == 0) ) {
+ in_body = 1;
+ if (from_header == 0) {
+ fprintf(fp, "%s%s", fromline, buf);
+ }
+ }
+ if (in_body == 0 && !strncasecmp(buf, "From:", 5)) {
+ strcpy(fromline, buf);
+ from_header = 1;
+ }
+
+ if (read_recipients_from_headers) {
+ add_these_recipients = NULL;
+ if ((isspace(buf[0])) && (to_or_cc)) {
+ add_these_recipients = buf;
+ }
+ else {
+ if ((!strncasecmp(buf, "To:", 3)) || (!strncasecmp(buf, "Cc:", 3))) {
+ to_or_cc = 1;
+ }
+ else {
+ to_or_cc = 0;
+ }
+ if (to_or_cc) {
+ add_these_recipients = &buf[3];
+ }
+ }
+
+ if (add_these_recipients) {
+ int num_recp_on_this_line;
+ char this_recp[256];
+
+ num_recp_on_this_line = num_tokens(add_these_recipients, ',');
+ for (i=0; i<num_recp_on_this_line; ++i) {
+ extract_token(this_recp, add_these_recipients,
+ i, ',', sizeof this_recp);
+ striplt(this_recp);
+ if (!IsEmptyStr(this_recp)) {
+ ++num_recipients;
+ recipients = realloc(recipients,
+ (num_recipients * sizeof (char *)));
+ recipients[num_recipients - 1] = strdup(this_recp);
+ }
+ }
+ }
+ }
+