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 :-)