You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Gerald Richter <ri...@ecos.de> on 2005/10/02 17:56:45 UTC

RE: Date patch for Embperl::Mail

Hi,

I have made a similar version of your patch, that moves the date generation
into C code, because a similar routine is already there. It also handles the
timezone.

It's in the CVS and will be in 2.0.1

Gerald


---------------------------------------------------------------------------
Besuchen Sie uns auf der Systems 2005 in München, Halle B2, Stand 704
---------------------------------------------------------------------------
Gerald Richter            ecos electronic communication services gmbh
IT-Securitylösungen * Webapplikationen mit Apache/Perl/mod_perl/Embperl

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
---------------------------------------------------------------------------
ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
---------------------------------------------------------------------------

  

> -----Original Message-----
> From: RobertCZ [mailto:robert@robert.cz] 
> Sent: Thursday, September 15, 2005 10:45 AM
> To: embperl@perl.apache.org
> Subject: Date patch for Embperl::Mail
> 
> Hi,
> 
>   as I reported, I have problems with mails sent from 
> Embperl::Mail and Thunderbird/Netscape - mails are dated 
> 1.1.1970.  I don't know what deep cause of the problem is 
> butI fixed it simply by adding Date: header manually. I guess 
> more people will have similar problem so I propose patch 
> Embperl::Mail with something like (I use Date::Calc because I 
> need it anyway but as not to add addtional dependency):
> 
> ... [ around line 130 ]...
> 
> ($Second, $Minute, $Hour, $Day, $Month, $Year, $DoW) = 
> localtime(time) ;
> 
> @month = qw( January February March April May June July 
> August September October November December );
> 
> @dow   = qw( Monday Tuesday Wednesday Thursday Friday 
> Saturday Sunday );
> 
> $MonthStr = substr($month[ $Month ], 0, 3);
> 
> $DoWStr = substr($dow[ $DoW ], 0, 3);
> 
> $Year += 1900;
> 
> $DateHeader = qq(Date: $DoWStr, $Day $MonthStr $Year 
> $Hour:$Minute:$Second);
> 
> 'Date' =~ join(':',@$headers) or push @headers, $DateHeader;
> 
> 
> My Thunderbird shows Date header as
> 
> Date: Thu, 15 Sep 2005 08:41:06 +0200 (CEST)
> 
> 
> I don't know what to do with the time zone so I just ignore 
> it and hope for the best ;-)
> 
> Could you comment and if it's OK - Gerald perhaps add it to 
> the next release? It's bother to add it to every single mail 
> form manually...
> 
> - Robert
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Date patch for Embperl::Mail

Posted by RobertCZ <ro...@robert.cz>.
Gerald Richter wrote:

>I have made a similar version of your patch, that moves the date generation
>into C code, because a similar routine is already there. It also handles the
>timezone.
>
>It's in the CVS and will be in 2.0.1
>  
>

Thanks for patching it - I'm back from holiday just to download and test 
2.0.1...

- Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Date patch for Embperl::Mail

Posted by Gerald Richter <ri...@ecos.de>.
HI,

> strftime is actually available in both C and Perl (it's part 
> of the POSIX module, and all IEEE Std 1003.1-1990 compliant 
> languages[1] have to support it).  I'd meant to send a note 
> in response to Robert's message, but I wanted to actually 
> have the actual strftime code worked out and tested; other 
> things (work) prevented me from doing so.
> 

Strftime return the day and month as locale dependend strings, so Thu will
become Die, when  I send it with a german server. That's the reason why I
didn't used strftime, but my own implementation (which is also only a few
lines)

Gerald



> Ed
> 
> [1] POSIX was drafted as a standard for C programming languages.
> However, a number of C-descended languages have opted to 
> retain POSIX compliance (such as Perl), and I've heard some 
> people say that a few languages have opted to gain POSIX 
> compliance, though they weren't C.  I wouldn't know what 
> those languages are, however.
> 
> On Sun, 2 Oct 2005, Gerald Richter wrote:
> 
> > Hi,
> >
> > I have made a similar version of your patch, that moves the date 
> > generation into C code, because a similar routine is 
> already there. It 
> > also handles the timezone.
> >
> > It's in the CVS and will be in 2.0.1
> >
> > Gerald
> >
> >
> > 
> ----------------------------------------------------------------------
> > ----- Besuchen Sie uns auf der Systems 2005 in München, Halle B2, 
> > Stand 704
> > 
> --------------------------------------------------------------
> -------------
> > Gerald Richter            ecos electronic communication 
> services gmbh
> > IT-Securitylösungen * Webapplikationen mit 
> > Apache/Perl/mod_perl/Embperl
> >
> > Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
> > E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
> > WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
> > 
> ----------------------------------------------------------------------
> > ----- ECOS BB-5000 Firewall- und IT-Security Appliance: 
> > www.bb-5000.info
> > 
> ----------------------------------------------------------------------
> > -----
> >
> >> -----Original Message-----
> >> From: RobertCZ [mailto:robert@robert.cz]
> >> Sent: Thursday, September 15, 2005 10:45 AM
> >> To: embperl@perl.apache.org
> >> Subject: Date patch for Embperl::Mail
> >>
> >> Hi,
> >>
> >>   as I reported, I have problems with mails sent from 
> Embperl::Mail 
> >> and Thunderbird/Netscape - mails are dated 1.1.1970.  I don't know 
> >> what deep cause of the problem is butI fixed it simply by adding 
> >> Date: header manually. I guess more people will have 
> similar problem 
> >> so I propose patch Embperl::Mail with something like (I use 
> >> Date::Calc because I need it anyway but as not to add addtional 
> >> dependency):
> >>
> >> ... [ around line 130 ]...
> >>
> >> ($Second, $Minute, $Hour, $Day, $Month, $Year, $DoW) =
> >> localtime(time) ;
> >>
> >> @month = qw( January February March April May June July August 
> >> September October November December );
> >>
> >> @dow   = qw( Monday Tuesday Wednesday Thursday Friday
> >> Saturday Sunday );
> >>
> >> $MonthStr = substr($month[ $Month ], 0, 3);
> >>
> >> $DoWStr = substr($dow[ $DoW ], 0, 3);
> >>
> >> $Year += 1900;
> >>
> >> $DateHeader = qq(Date: $DoWStr, $Day $MonthStr $Year 
> >> $Hour:$Minute:$Second);
> >>
> >> 'Date' =~ join(':',@$headers) or push @headers, $DateHeader;
> >>
> >>
> >> My Thunderbird shows Date header as
> >>
> >> Date: Thu, 15 Sep 2005 08:41:06 +0200 (CEST)
> >>
> >>
> >> I don't know what to do with the time zone so I just ignore it and 
> >> hope for the best ;-)
> >>
> >> Could you comment and if it's OK - Gerald perhaps add it 
> to the next 
> >> release? It's bother to add it to every single mail form 
> manually...
> >>
> >> - Robert
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 
>  
> ** Virus checked by BB-5000 Mailfilter ** 
> !DSPAM:43418b8c184501256348324!
> 


 
** Virus checked by BB-5000 Mailfilter ** 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Date patch for Embperl::Mail

Posted by Ed Grimm <ed...@dsblade00.wat.us.ray.com>.
strftime is actually available in both C and Perl (it's part of the
POSIX module, and all IEEE Std 1003.1-1990 compliant languages[1] have
to support it).  I'd meant to send a note in response to Robert's
message, but I wanted to actually have the actual strftime code worked
out and tested; other things (work) prevented me from doing so.

Ed

[1] POSIX was drafted as a standard for C programming languages.
However, a number of C-descended languages have opted to retain POSIX
compliance (such as Perl), and I've heard some people say that a few
languages have opted to gain POSIX compliance, though they weren't C.  I
wouldn't know what those languages are, however.

On Sun, 2 Oct 2005, Gerald Richter wrote:

> Hi,
>
> I have made a similar version of your patch, that moves the date
> generation into C code, because a similar routine is already there. It
> also handles the timezone.
>
> It's in the CVS and will be in 2.0.1
>
> Gerald
>
>
> ---------------------------------------------------------------------------
> Besuchen Sie uns auf der Systems 2005 in München, Halle B2, Stand 704
> ---------------------------------------------------------------------------
> Gerald Richter            ecos electronic communication services gmbh
> IT-Securitylösungen * Webapplikationen mit Apache/Perl/mod_perl/Embperl
>
> Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
> E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
> WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
> ---------------------------------------------------------------------------
> ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
> ---------------------------------------------------------------------------
>
>> -----Original Message-----
>> From: RobertCZ [mailto:robert@robert.cz]
>> Sent: Thursday, September 15, 2005 10:45 AM
>> To: embperl@perl.apache.org
>> Subject: Date patch for Embperl::Mail
>>
>> Hi,
>>
>>   as I reported, I have problems with mails sent from
>> Embperl::Mail and Thunderbird/Netscape - mails are dated
>> 1.1.1970.  I don't know what deep cause of the problem is
>> butI fixed it simply by adding Date: header manually. I guess
>> more people will have similar problem so I propose patch
>> Embperl::Mail with something like (I use Date::Calc because I
>> need it anyway but as not to add addtional dependency):
>>
>> ... [ around line 130 ]...
>>
>> ($Second, $Minute, $Hour, $Day, $Month, $Year, $DoW) =
>> localtime(time) ;
>>
>> @month = qw( January February March April May June July
>> August September October November December );
>>
>> @dow   = qw( Monday Tuesday Wednesday Thursday Friday
>> Saturday Sunday );
>>
>> $MonthStr = substr($month[ $Month ], 0, 3);
>>
>> $DoWStr = substr($dow[ $DoW ], 0, 3);
>>
>> $Year += 1900;
>>
>> $DateHeader = qq(Date: $DoWStr, $Day $MonthStr $Year
>> $Hour:$Minute:$Second);
>>
>> 'Date' =~ join(':',@$headers) or push @headers, $DateHeader;
>>
>>
>> My Thunderbird shows Date header as
>>
>> Date: Thu, 15 Sep 2005 08:41:06 +0200 (CEST)
>>
>>
>> I don't know what to do with the time zone so I just ignore
>> it and hope for the best ;-)
>>
>> Could you comment and if it's OK - Gerald perhaps add it to
>> the next release? It's bother to add it to every single mail
>> form manually...
>>
>> - Robert

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org