Skip Menu |

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

Report information
The Basics
Id: 39911
Status: open
Priority: 0/
Queue: Mail-DWIM

People
Owner: Nobody in particular
Requestors: wolfgang [...] kinkeldei.de
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.03
Fixed in: (no value)



Subject: automatically add a date header
Hi Mike, some mail-servers do not add a 'date' header when sending out mails. Therefore, it would be great to get a 'Guess the "date"' logic inside of Mail::DWIM like you guess the 'from' address. a patch (which I did against version 0.02) could look like this: <snip> --- DWIM.pm 2008-10-09 08:11:55.000000000 +0200 +++ DWIM_orig.pm 2008-10-09 08:06:21.000000000 +0200 @@ -16,7 +16,6 @@ use Mail::Mailer; use Sys::Hostname; use File::Basename; -use POSIX qw(strftime); my $error; @@ -54,11 +53,6 @@ $self->{from} = "$user\@$domain"; } - # Guess the 'date' - if (!exists $self->{date}) { - $self->{date} = strftime("%a, %e %b %Y %H:%M:%S %Z", localtime(time)); - } - for my $cfg (qw(global_cfg_file user_cfg_file)) { if(-f $self->{$cfg}) { my $yml = LoadFile( $self->{$cfg} ); <snap> I really like to use Mail::DWIM but I always forget to add the date header and it would be very convenient to get this little function in :-)
On Thu Oct 09 02:34:25 2008, WKI wrote: Show quoted text
> a patch (which I did against version 0.02) could look like this:
Applied and released as Mail::DWIM 0.04 to CPAN. Thanks for the patch! -- Mike
Sorry, but I did my diff against a version, a collegue already has modified -- should not have happened... Still another line of code has to get modified in order to make my wish become entirely true :-( when building the Mail-Header, there is a restrictive list of headers a Mail::DWIM user may use which initially does not contain 'date' <snip> --- DWIM.pm 2008-10-10 08:46:21.000000000 +0200 +++ DWIM_orig.pm 2008-10-10 08:45:33.000000000 +0200 @@ -120,7 +120,7 @@ my $mailer = Mail::Mailer->new(@options); my %headers; - for (qw(from to cc bcc subject date)) { + for (qw(from to cc bcc subject)) { $headers{ucfirst($_)} = $self->{$_} if exists $self->{$_}; } <snap>
Subject: Re: [rt.cpan.org #39911] automatically add a date header
Date: Fri, 10 Oct 2008 07:51:38 -0700 (PDT)
To: Wolfgang Kinkeldei via RT <bug-Mail-DWIM [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Fri, 10 Oct 2008, Wolfgang Kinkeldei via RT wrote: Show quoted text
> Sorry, but I did my diff against a version, a collegue already has > modified -- should not have happened...
Ok, here's 0.05 with your latest fix, please verify: http://perlmeister.com/tmp/Mail-DWIM-0.05.tar.gz -- Mike Mike Schilli m@perlmeister.com
Subject: Re: [rt.cpan.org #39911] automatically add a date header
Date: Fri, 10 Oct 2008 17:02:04 +0200
To: bug-Mail-DWIM [...] rt.cpan.org
From: Wolfgang Kinkeldei <kinkeldei [...] nureg.de>
Am 10.10.2008 um 16:52 schrieb Mike Schilli via RT: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=39911 > > > On Fri, 10 Oct 2008, Wolfgang Kinkeldei via RT wrote: >
>> Sorry, but I did my diff against a version, a collegue already has >> modified -- should not have happened...
> > Ok, here's 0.05 with your latest fix, please verify: > > http://perlmeister.com/tmp/Mail-DWIM-0.05.tar.gz
now it looks perfect. Thanks alot. I should have loaded a fresh version from CPAN before doing a diff. Next time I definitely will do :-) Regards, Wolfgang Kinkeldei -- ' /\_/\ ' .print[split??,"".(($/=q|Cms)+-03467:;<=|)=~tr!C-z -B! -z!)x '( o.o )' .$/]->[hex]foreach split qr<>,qq+1ecd039ad65b025b8063475b+|| ' > ^ < ' .q<!-- Wolfgang Kinkeldei - mailto:wolfgang@kinkeldei.de -->
Download smime.p7s
application/pkcs7-signature 2.4k

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #39911] automatically add a date header
Date: Fri, 10 Oct 2008 09:07:39 -0700 (PDT)
To: Wolfgang Kinkeldei via RT <bug-Mail-DWIM [...] rt.cpan.org>
From: Mike Schilli <m [...] perlmeister.com>
On Fri, 10 Oct 2008, Wolfgang Kinkeldei via RT wrote: Show quoted text
> now it looks perfect. Thanks alot. I should have loaded a fresh > version from CPAN before doing a diff. Next time I definitely will do > :-)
No worries, 0.05 is on its way to CPAN. -- Mike Mike Schilli m@perlmeister.com