aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--driver.c54
2 files changed, 35 insertions, 22 deletions
diff --git a/NEWS b/NEWS
index 2eebe8b5..6acd93ad 100644
--- a/NEWS
+++ b/NEWS
@@ -17,8 +17,9 @@
fetchmail-4.2.5 ()
* Greg Stark's patch for better autoconfiguration on mixed libc5/libc6 systems.
* We no longer mess with CFLAGS/LDFLAGS to get Kerberos support linked.
+* fetchmail now generates its own Received header for bug-tracking.
-There are 287 people on the fetchmail-friends list.
+There are 284 people on the fetchmail-friends list.
fetchmail-4.2.4 (Fri Sep 19 19:48:50 EDT 1997)
* Small compilation cleanups, thanks to Florian laRoche.
diff --git a/driver.c b/driver.c
index 79a95b64..fab75611 100644
--- a/driver.c
+++ b/driver.c
@@ -1042,31 +1042,43 @@ int num; /* index of message */
}
}
+ /* utter any per-message Received information we need here */
+ {
+ time_t now;
+
+ /* write a line describing fetchmail's processing of the message */
+ sprintf(buf,
+ "Received: from %s\r\n\tby %s (fetchmail-%s/%s) running as %s\r\n",
+ ctl->server.truename,
+ fetchmailhost,
+ RELEASE_ID,
+ protocol->name,
+ ctl->remotename);
+ if (!good_addresses)
+ sprintf(buf + strlen(buf),
+ "\tfor <%s@%s> (by default); ",
+ user, desthost);
+ if (good_addresses == 1)
+ {
+ for (idp = xmit_names; idp; idp = idp->next)
+ if (idp->val.num == XMIT_ACCEPT)
+ {
+ sprintf(buf + strlen(buf),
+ "\tfor <%s@%s>; ", idp->id, desthost);
+ break;
+ }
+ }
+ time(&now);
+ strcat(buf, ctime(&now));
+ strcpy(buf + strlen(buf) - 1, "\r\n");
+ }
+
/* tell it we're ready to send data */
SMTP_data(ctl->smtp_socket);
}
- /* we may need to strip carriage returns */
- if (ctl->stripcr)
- {
- char *sp, *tp;
-
- for (sp = tp = headers; *sp; sp++)
- if (*sp != '\r')
- *tp++ = *sp;
- *tp = '\0';
-
- }
-
- /* write all the headers */
- n = 0;
- if (ctl->mda && sinkfp)
- n = fwrite(headers, 1, strlen(headers), sinkfp);
- else if (ctl->smtp_socket != -1)
- n = SockWrite(ctl->smtp_socket, headers, strlen(headers));
- free(headers);
-
- if (n < 0)
+ /* ship out the synthetic Received line and the headers */
+ if (stuffline(ctl, buf) < 0 || stuffline(ctl, headers) < 0)
{
error(0, errno, "writing RFC822 headers");
if (ctl->mda)