[Pkg-net-snmp-devel] Bug#785380: traptoemail: incorrect date format
Gabor Kiss
kissg at ssg.ki.iif.hu
Fri May 15 13:24:41 UTC 2015
Package: snmp
Version: 5.4.3~dfsg-2.8+deb7u1
Severity: minor
Dear Maintainer,
/usr/bin/traptoemail contains this line:
$message->datasend("Date: ".strftime("%a, %e %b %Y %X %z", localtime())."\n");
Unfortunately %a, %b, %X are all locale dependents.
Let's see what does 'date' with different LANG settings. ('date' also
uses strftime().)
$ LANG=C date +'%a, %e %b %Y %X %z'
Fri, 15 May 2015 15:12:07 +0200 <--- correct
$ LANG=hu_HU date +'%a, %e %b %Y %X %z'
p, 15 máj 2015 15.12.17 +0200 <--- incorrect
$ LANG=en_US date +'%a, %e %b %Y %X %z'
Fri, 15 May 2015 03:12:26 PM +0200 <--- incorrect
$
Section 3.3 of RFC 5322 specifies format of Date header in mails.
The rules are quite rigid.
I think only the "C" locale guarantees the RFC conform date.
I suggest to insert an
$ENV{LANG} = 'C';
assignment at the very beginning of the script.
Regards
Gabor
-- System Information:
Debian Release: 7.8
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable-proposed-updates'), (500, 'oldstable')
Architecture: i386 (i686)
Kernel: Linux 3.10-1-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/bash
Versions of packages snmp depends on:
ii libc6 2.13-38+deb7u8
ii libsnmp15 5.4.3~dfsg-2.8+deb7u1
ii libssl1.0.0 1.0.1e-2+deb7u16
Versions of packages snmp recommends:
ii perl-modules 5.14.2-21+deb7u2
snmp suggests no packages.
-- no debconf information
More information about the Pkg-net-snmp-devel
mailing list