R5872 - in rt/branches/3.6-RELEASE: . lib/RT/Action

  1. Date in the mail should be in RFC2822 date time format
  2. RFC2822 is locale independant format
  3. perldoc POSIX: “the specifiers “aAbBcpZ” change according to the
    locale settings of the user”
  4. we have simple and I belive fast RFC2822 formatter in 3.7 branch
    which could be backported to 3.6 with minimal changes.

An exmaple:

perl -MPOSIX -e 'print strftime(“%a, %d %b %Y %H:%M:%S %z”,

localtime()), “\n”;’
Чтв, 07 Сен 2006 05:54:53 +0400
^^^ Russian localeOn 9/6/06, jesse@bestpractical.com jesse@bestpractical.com wrote:

Author: jesse
Date: Wed Sep 6 15:07:22 2006
New Revision: 5872

Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm
rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in

Log:
r27203@pinglin: jesse | 2006-09-06 15:07:04 -0400
RT-Ticket: 7848
RT-Status: resolved
RT-Update: correspond

  • POSIX::strftime on Solaris isn’t robust enough to deal with our Date: header generation.
    Switched to Date::Format::strftime instead. - ADDED DEPENDENCY: Date::Format
    Fix thanks to Tim Bishop

Modified: rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm

— rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm (original)
+++ rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm Wed Sep 6 15:07:22 2006
@@ -56,7 +56,7 @@

use RT::EmailParser;
use Mail::Address;
-use POSIX qw(strftime);
+use Date::Format qw(strftime);

=head1 NAME

@@ -252,8 +252,9 @@
}

 unless ($MIMEObj->head->get('Date')) {
  •  $self->SetHeader('Date',
    
  •                   strftime('%a, %d %b %Y %H:%M:%S %z', localtime()));
    
  •    # We coerce localtime into an array since strftime has a flawed prototype that only accepts
    
  •    # a list
    
  •  $self->SetHeader('Date', strftime('%a, %d %b %Y %H:%M:%S %z', @{[localtime()]}));
    

    }

    my $SendmailArguments = $RT::SendmailArguments;

Modified: rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in

— rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in (original)
+++ rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in Wed Sep 6 15:07:22 2006
@@ -159,6 +159,7 @@
DBI 1.37
Test::Inline
Class::ReturnValue 0.40
+Date::Format
DBIx::SearchBuilder 1.39
Text::Template
File::Spec 0.8


Rt-commit mailing list
Rt-commit@lists.bestpractical.com
rt-commit Info Page

Best regards, Ruslan.

  1. Date in the mail should be in RFC2822 date time format
  2. RFC2822 is locale independant format
  3. perldoc POSIX: “the specifiers “aAbBcpZ” change according to the
    locale settings of the user”
  4. we have simple and I belive fast RFC2822 formatter in 3.7 branch
    which could be backported to 3.6 with minimal changes.

An exmaple:

perl -MPOSIX -e 'print strftime(“%a, %d %b %Y %H:%M:%S %z”,

localtime()), “\n”;’
Чтв, 07 Сен 2006 05:54:53 +0400
^^^ Russian locale

However:
LC_ALL=ru_RU.UTF-8 perl -MPOSIX -e ‘print strftime(“%a, %d %b %Y %H:%M:%S %z”, localtime()), “\n”;’
ср, 06 сен 2006 21:55:25 -0400

LC_ALL=ru_RU.UTF-8 perl -MDate::Format -e ‘print strftime(“%a, %d %b %Y %H:%M:%S %z”, @{[localtime()]})’;
Wed, 06 Sep 2006 21:54:32 -0400

Date::Format is locale-ignorant, so fixes this issue :wink:

  1. Date in the mail should be in RFC2822 date time format
  2. RFC2822 is locale independant format
  3. perldoc POSIX: “the specifiers “aAbBcpZ” change according to the
    locale settings of the user”
  4. we have simple and I belive fast RFC2822 formatter in 3.7 branch
    which could be backported to 3.6 with minimal changes.

An exmaple:

perl -MPOSIX -e 'print strftime(“%a, %d %b %Y %H:%M:%S %z”,

localtime()), “\n”;’
Чтв, 07 Сен 2006 05:54:53 +0400
^^^ Russian locale

However:
LC_ALL=ru_RU.UTF-8 perl -MPOSIX -e ‘print strftime(“%a, %d %b %Y %H:%M:%S %z”, localtime()), “\n”;’
ср, 06 сен 2006 21:55:25 -0400

LC_ALL=ru_RU.UTF-8 perl -MDate::Format -e ‘print strftime(“%a, %d %b %Y %H:%M:%S %z”, @{[localtime()]})’;
Wed, 06 Sep 2006 21:54:32 -0400

Date::Format is locale-ignorant, so fixes this issue :wink:

:)))

Author: jesse
Date: Wed Sep 6 15:07:22 2006
New Revision: 5872

Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm
rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in

Log:
r27203@pinglin: jesse | 2006-09-06 15:07:04 -0400
RT-Ticket: 7848
RT-Status: resolved
RT-Update: correspond

  • POSIX::strftime on Solaris isn’t robust enough to deal with our Date:
    header generation.
    Switched to Date::Format::strftime instead. - ADDED DEPENDENCY:
    Date::Format
    Fix thanks to Tim Bishop

Modified: rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm

— rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm (original)
+++ rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm Wed Sep 6
15:07:22 2006
@@ -56,7 +56,7 @@

use RT::EmailParser;
use Mail::Address;
-use POSIX qw(strftime);
+use Date::Format qw(strftime);

=head1 NAME

@@ -252,8 +252,9 @@
}

unless ($MIMEObj->head->get('Date')) {
  •  $self->SetHeader('Date',
    
  •                   strftime('%a, %d %b %Y %H:%M:%S %z', localtime()));
    
  •    # We coerce localtime into an array since strftime has a flawed
    

prototype that only accepts

  •    # a list
    
  •  $self->SetHeader('Date', strftime('%a, %d %b %Y %H:%M:%S %z',
    

@{[localtime()]}));
}

my $SendmailArguments = $RT::SendmailArguments;

Modified: rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in

— rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in (original)
+++ rt/branches/3.6-RELEASE/sbin/rt-test-dependencies.in Wed Sep 6
15:07:22 2006
@@ -159,6 +159,7 @@
DBI 1.37
Test::Inline
Class::ReturnValue 0.40
+Date::Format
DBIx::SearchBuilder 1.39
Text::Template
File::Spec 0.8


Rt-commit mailing list
Rt-commit@lists.bestpractical.com
rt-commit Info Page


Best regards, Ruslan.

Best regards, Ruslan.