aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-12-03 05:42:57 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-12-03 05:42:57 +0000
commita694f25943adda181db8954e8351d21fe8bec964 (patch)
tree675c46783160c15099320c8eb057a93fd4e15768
parenta3266193deaf5e76210124359e92dc99137162ea (diff)
downloadfetchmail-a694f25943adda181db8954e8351d21fe8bec964.tar.gz
fetchmail-a694f25943adda181db8954e8351d21fe8bec964.tar.bz2
fetchmail-a694f25943adda181db8954e8351d21fe8bec964.zip
Generate RFC822 dates.
svn path=/trunk/; revision=1555
-rw-r--r--NEWS4
-rw-r--r--configure.in2
-rw-r--r--driver.c9
3 files changed, 13 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 9595e541..fc0601c3 100644
--- a/NEWS
+++ b/NEWS
@@ -22,8 +22,10 @@ fetchmail-4.3.4 ()
* Improved POP3 protocol-synchronization error messages.
* Allow fetchmail to proceed even if DNS is down or unavailable, if all
multidrop entries have `no dns'.
+* Added Robert de Bath's "fetchspool" script to contrib.
+* Use strftime(3) to gen a proper RFC822 date into fetchmail's Received header.
-There are 274 people on fetchmail-friends and 95 on fetchmail-announce.
+There are 272 people on fetchmail-friends and 96 on fetchmail-announce.
fetchmail-4.3.3 (Sat Nov 22 01:51:41 EST 1997)
* Robert Hardy <rhardy@webcon.net>'s patch to use IMAP EXAMINE in check mode.
diff --git a/configure.in b/configure.in
index a8275080..c9a10f1b 100644
--- a/configure.in
+++ b/configure.in
@@ -80,7 +80,7 @@ AC_SUBST(EXTRAOBJ)
AC_CHECK_FUNCS(tcsetattr stty setsid seteuid gethostbyname res_search herror \
strrchr strerror setlinebuf syslog snprintf vprintf vsnprintf vsyslog \
- atexit inet_aton)
+ atexit inet_aton strftime)
# Under Red Hat 4.0 (and many other Linuxes) -lresolv is seriously flaky
# and breaks gethostbyname(2). It's better to use the bind stuff in the C
diff --git a/driver.c b/driver.c
index 7e5824ce..7607004b 100644
--- a/driver.c
+++ b/driver.c
@@ -1214,7 +1214,16 @@ int num; /* index of message */
buf[1] = '\0';
time(&now);
+#ifdef STRFTIME
+ /* conform to RFC822 */
+ strftime(buf, sizeof(buf), "%a, %d b %Y %H:%M:%S %Z\n", localtime(&now));
+#else
+ /*
+ * This is really just a fallback, as the date format ctime(3)
+ * emits is not RFC822 conformant.
+ */
strcat(buf, ctime(&now));
+#endif /* STRFTIME */
n = stuffline(ctl, buf);
}
}