Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Mail-Sender CPAN distribution.

Report information
The Basics
Id: 687
Status: resolved
Priority: 0/
Queue: Mail-Sender

People
Owner: Nobody in particular
Requestors: m.dietrich [...] xpedite.de
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.7.13.1
Fixed in: (no value)



Subject: Changing timezone over midnight
Hi, OS: Windows NT 4.0 Perl: 5.6.1 built for MSWin32-x86-multi-thread Perl Module: Mail-Sender 0.7.31.1 after midnight the the automatic added date field in the header changes the timezone. Here an example: Befor Midnight: Received: from f2m-rcv1.xpedite.de (unverified) by demsw02.xpedite.de (Content Technologies SMTPRS 4.2.5) with SMTP id <T5b2adc71030a676611378@demsw02.xpedite.de> for <m.dietrich@xpedite.de>; Wed, 29 May 2002 22:58:33 +0200 To: "Markus Dietrich" <m.dietrich@xpedite.de> From: F2M Team <f2m@xpedite.de> X-Mailer: Xpedite Fax2Mail Gateway Version 2.0 Date: Wed, 29 May 2002 23:05:23 +0200 ... The same script after midnight: Received: from f2m-rcv1.xpedite.de (unverified) by demsw01.xpedite.de (Content Technologies SMTPRS 4.2.5) with SMTP id <T5b2bfa6bf30a67660d34c@demsw01.xpedite.de> for <m.dietrich@xpedite.de>; Thu, 30 May 2002 04:10:55 +0200 To: "Markus Dietrich" <m.dietrich@xpedite.de> From: F2M Team <f2m@xpedite.de> X-Mailer: Xpedite Fax2Mail Gateway Version 2.0 Date: Thu, 30 May 2002 04:15:42 -2200 Any idea?? Here is my code: $smtp = new Mail::Sender {smtp => $smtp_host, from => $sender_addr, fake_from => "$sender_name <$sender_addr>"}; if (defined ($smtp)){ if ($smtp == $smtp->OpenMultipart({to => $addr, fake_to => $rcpt, subject => "Neues Fax empfangen von $csid", # debug => "debug.txt", boundary => 'F2M_Msg_NextPart_000_01BCC90A.48027DB0'})){ if ($smtp->SendLineEx($multipart_preamble) == 1){ if ($smtp == $smtp->Body({charset => 'iso-8859-1', encoding => 'quoted-printable', ctype => 'text/plain', msg => $msg })){ if (attach_fax($tif_file,$filetype)){ $smtp->Close; undef($smtp); } else { f2m_log ("attach_fax: Error by Attach - $Mail::Sender::Error"); } } else { f2m_log ("send_msg: Body failed ($smtp_host): $Mail::Sender::Error"); } } else { f2m_log ("send_msg: SendLineEx failed"); } } else { f2m_log ("send_msg: OpenMultiPart failed ($smtp_host): $Mail::Sender::Error"); } } else { f2m_log ("send_msg: \$smtp not defined ($smtp_host): $Mail::Sender::Error"); } sub attach_fax { my ($file_name,$file_type) = @_; my $attachment = "fax001.tif"; my $content_type = "image/tiff"; ... while(-e $file_name) { if ($smtp == $smtp->Attach({ctype => $content_type, encoding => 'Base64', disposition => "attachment; filename=\"$attachment\"", file => $file_name})){ } else { return (0); } } return (1); } Greetings from Munich Markus
[guest - Thu May 30 05:39:59 2002]: Show quoted text
> Hi, > > OS: Windows NT 4.0 > Perl: 5.6.1 built for MSWin32-x86-multi-thread > Perl Module: Mail-Sender 0.7.31.1 > > after midnight the the automatic added date field in the header > changes the timezone.
Oops. I had a bug in the timediff code. It will be right in new versions. For now you can fix this in your version by replacing the $GMTdiff computing code by the attached code. Jenda
my $GMTdiff; { my $time = time() + $_[0] * 60*60; my @local = (localtime($time))[2,1,3,4,5]; my @gm = (gmtime($time))[2,1,3,4,5]; my $diffdate = ($gm[4]*512*32 + $gm[3]*32 + $gm[2]) <=> ($local[4]*512*32 + $local[3]*32 + $local[2]); if ($diffdate > 0) {$gm[0]+=24} elsif ($diffdate < 0) {$local[0]+=24} my $hourdiff = $gm[0]-$local[0]; my $mindiff; if (abs($gm[1]-$local[1])<5) { $mindiff = 0 } elsif (abs($gm[1]-$local[1]-30) <5) { $mindiff = 30 } elsif (abs($gm[1]-$local[1]-60) <5) { $mindiff = 0; $hourdiff ++; } $GMTdiff = ($hourdiff < 0 ? '+' : '-') . sprintf "%02d%02d", abs($hourdiff), $mindiff; }