[PATCH / request for vote ] traptoemail script breaks date in mail header

Josef Ridky <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
traptoemail Perl script emits a locale-dependent Date header, which does not conform to RFC 5322 in general. This happens because strftime() is locale-dependent, and could be solved for example by temporarily resetting the locale to C for the strftime() call.

Actual results: Date: Ăšt,  5 ÄŤen 2018 09:11:05 +0200

See https://sourceforge.net/p/net-snmp/bugs/2631/

---
diff -urNp a/local/traptoemail b/local/traptoemail
--- a/local/traptoemail	2018-06-20 09:32:10.202489526 +0200
+++ b/local/traptoemail	2018-06-20 09:32:36.261432167 +0200
@@ -63,7 +63,6 @@ $message->to(@ARGV) || die "failed to se
 $message->data();
 $message->datasend("To: " . join(", ",@ARGV) . "\n");
 $message->datasend("From: $opts{f}\n");
-$message->datasend("Date: ".strftime("%a, %e %b %Y %X %z", localtime())."\n");
 $message->datasend("Subject: trap received from $hostname: $values[1]\n");
 $message->datasend("\n");
 $message->datasend("Host: $hostname ($ipaddress)\n");
---

Josef Ridky
Associate Software Engineer
Core Services Team
Red Hat Czech, s.r.o.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.