Opened 6 years ago

Closed 6 years ago

#1484348 closed Bugs (duplicate)

"Date:" header is not RFC 2822 compliant

Reported by: rasky@… Owned by:
Priority: 5 Milestone:
Component: Client Scripts Version: 0.1-beta2
Severity: normal Keywords:
Cc:

Description

The "Date:" header generated by sendmail.inc is not RFC 2822 compliant. The RFC grammar says:

hour            =       2DIGIT / obs-hour
minute          =       2DIGIT / obs-minute
second          =       2DIGIT / obs-second

but the code is using:

     date('D, j M Y G:i:s O')

where "G" means "24-hour format of an hour without leading zeros", according to http://it.php.net/date. This patch fixes the problem:

Index: sendmail.inc
===================================================================
--- sendmail.inc        (revision 515)
+++ sendmail.inc        (working copy)
@@ -107,7 +107,8 @@
   $identity_arr['string'] = $from;

 // compose headers array
-$headers = array('Date' => date('D, j M Y G:i:s O'),
+// rasky: use "H" instead of "G" to add leading zeros
+$headers = array('Date' => date('D, j M Y H:i:s O'),
                  'From' => $identity_arr['string'],
                  'To'   => rcube_charset_convert($mailto, $input_charset, $message_charset));

Change History (1)

comment:1 Changed 6 years ago by thomasb

  • Resolution set to duplicate
  • Status changed from new to closed

This is already fixed in Trunk. Duplicate of #1484125

Note: See TracTickets for help on using tickets.