summaryrefslogtreecommitdiffstats
path: root/src/global/mail_date.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:42:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:42:06 +0000
commit426ff88c97805d5359804bcfd7186dcd2c9fbf47 (patch)
tree048956abd950b325107bcc2febb1ba6763d770e1 /src/global/mail_date.c
parentAdding debian version 3.8.6-1. (diff)
downloadpostfix-426ff88c97805d5359804bcfd7186dcd2c9fbf47.tar.xz
postfix-426ff88c97805d5359804bcfd7186dcd2c9fbf47.zip
Merging upstream version 3.9.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/global/mail_date.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/global/mail_date.c b/src/global/mail_date.c
index 55d8907..439a0ea 100644
--- a/src/global/mail_date.c
+++ b/src/global/mail_date.c
@@ -10,7 +10,7 @@
/* time_t when;
/* DESCRIPTION
/* mail_date() converts the time specified in \fIwhen\fR to the
-/* form: "Mon, 9 Dec 1996 05:38:26 -0500 (EST)" and returns
+/* form: "Mon, 09 Dec 1996 05:38:26 -0500 (EST)" and returns
/* a pointer to the result. The result is overwritten upon
/* each call.
/* DIAGNOSTICS
@@ -98,8 +98,13 @@ const char *mail_date(time_t when)
* First, format the date and wall-clock time. XXX The %e format (day of
* month, leading zero replaced by blank) isn't in my POSIX book, but
* many vendors seem to support it.
+ *
+ * The RFC 5322 Date and Time Specification recommends (i.e., should) "that
+ * a single space be used in each place that FWS appears". To avoid a
+ * potentially breaking change, we prefer the %d (two-digit day) format,
+ * i.e. days 1-9 now have a leading zero instead of a leading space.
*/
-#ifdef MISSING_STRFTIME_E
+#if defined(MISSING_STRFTIME_E) || defined(TWO_DIGIT_DAY_IN_DATE_TIME)
#define STRFTIME_FMT "%a, %d %b %Y %H:%M:%S "
#else
#define STRFTIME_FMT "%a, %e %b %Y %H:%M:%S "