[smokeping-users] smokealert error in Date header of other language
Tobias Oetiker
tobi at oetiker.ch
Wed Oct 23 15:31:29 CEST 2013
Antonio,
how about just adding code to switch the locale back to 'C' prior
to calling strftime ?
cheers
tobi
Today Antonio Casado Rodriguez wrote:
> Hi,
>
> The problem is in "smokeping/lib/Smokeping.pm" line 1946:
> my $rfc2822stamp = POSIX::strftime("%a, %e %b %Y %H:%M:%S %z", @stamp);
>
> I've got 3 patch for this:
>
> a) my $rfc2822stamp = `date --rfc-2822`;
>
> b) my @weekday = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
> my $rfc2822stamp = $weekday[$stamp[6]];
> $rfc2822stamp .= POSIX::strftime(", %e %b %Y %H:%M:%S %z", @stamp);
>
> c) use DateTime;
> use DateTime::Format::Mail;
> my $rfc2822stamp = DateTime::Format::Mail->format_datetime(
> DateTime->now() );
>
> A similar error is comment here:
> http://comments.gmane.org/gmane.comp.version-control.git/23337
>
> El 22/10/2013 11:25, Antonio Casado Rodriguez escribió:
> > Hi all,
> >
> > Server: RHEL 6.4 (spanish)
> > Smokeping: 2.6.9
> >
> > When I receive a message of smokealert, the Date header is set in
> > spanish, the correct is set in english. Trace:
> >
> > From: smokealert at ual.es
> > Date: mar, 22 oct 2013 10:00:12 +0200
> > Subject: [SmokeAlert] someloss is active on network.interna.switch
> >
> >
> > But, "mar" is "martes" (in spanish). The correct will be:
> >
> > Date: Tue, 22 Oct 2013 10:00:12 +0200
> >
> >
> > Then, my thunderbird (mail client) don't sort correctly the message.
> > It's put in March.
> > If I run: echo hello | mail foo at ual.es, it's work ok.
> >
> > Is it a bug?
> >
> > Thanks you.
>
>
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
More information about the smokeping-users
mailing list