Hi folks,

hope this hasn't been posted already.
I use a Debian Sarge server with german locales.
I run a backported qpsmtpd 0.32-6 from Debian Sid.

By the change from April to May i discovered that all newly received emails where sorted and displayed as received from 1. January 2007 by all Outlook Client of our customers.

I found out, that qpsmtpd is using the date format of currently set locale to generate the date in it's received line, which Outlook uses to
check when the message has arrived at the last mailserver.
So solve this problem i wrote a small patch for Qpstmpd::SMTP.
My patch just sets the standard C locale before generating the Date string.

Hope this patch can be usefull to someone. Comments are also welcome but please be gentle with me, because this is my first patch.

cya
 Dominik



--- SMTP.pm.old 2007-05-03 16:43:50.000000000 +0200
+++ SMTP.pm     2007-05-03 16:47:25.000000000 +0200
@@ -15,7 +15,7 @@
 
 use Mail::Header ();
 #use Data::Dumper;
-use POSIX qw(strftime);
+use POSIX qw(strftime setlocale LC_ALL);
 use Net::DNS;
 
 # this is only good for forkserver
@@ -534,6 +534,9 @@
   my $authheader = (defined $self->{_auth} and $self->{_auth} == OK) ?
     "(smtp-auth username $self->{_auth_user}, mechanism 
$self->{_auth_mechanism})\n" : "";
 
+   #me need the english/C Locale here otherwise problems with outlook client
+   my $loc = setlocale( LC_ALL, "C" );
+
   $header->add("Received", "from ".$self->connection->remote_info
                ." (HELO ".$self->connection->hello_host . ") 
(".$self->connection->remote_ip
                . ")\n  $authheader  by ".$self->config('me')." 
(qpsmtpd/".$self->version

Reply via email to