return $data;
}
-# simplify_date(datestring)
+# simplify_date(datestring, [format])
# Given a date from an email header, convert to the user's preferred format
sub simplify_date
{
-local $u = &parse_mail_date($_[0]);
+local ($date, $fmt) = @_;
+local $u = &parse_mail_date($date);
if ($u) {
- local $fmt = $userconfig{'date_fmt'} || $config{'date_fmt'} || "dmy";
+ $fmt ||= $userconfig{'date_fmt'} || $config{'date_fmt'} || "dmy";
local $strf = $fmt eq "dmy" ? "%d/%m/%Y" :
$fmt eq "mdy" ? "%m/%d/%Y" :
"%Y/%m/%d";
return strftime("$strf %H:%M", localtime($u));
}
-elsif ($_[0] =~ /^(\S+),\s+0*(\d+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+)/) {
+elsif ($date =~ /^(\S+),\s+0*(\d+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+)/) {
return "$2/$3/$4 $5:$6";
}
-elsif ($_[0] =~ /^0*(\d+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+)/) {
+elsif ($date =~ /^0*(\d+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+)/) {
return "$1/$2/$3 $4:$5";
}
-return $_[0];
+return $date;
}
# simplify_from(from)
$7 < 50 ? $7+100 : $7 < 1000 ? $7 : $7-1900);
return $tm;
}
+ elsif ($str =~ /^(\S+)\s+(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)/) {
+ # Format like Tue Dec 7 12:58:52
+ local @now = localtime(time());
+ local $tm = timelocal($6, $5, $4, $3, &month_to_number($2),
+ $now[5]);
+ return $tm;
+ }
elsif ($str =~ /^(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\d+)\s+(\S+)/) {
# Format like Dec 7 12:58:52 2004 GMT
local $tm = timelocal($5, $4, $3, $2, &month_to_number($1),
Autoreply messages containing non-ASCII characters are now properly quoted-printable encoded.
---- Changes since 1.440 ----
Added a module config option to control if the user is prompted for confirmation before deleting queued messages.
+---- Changes since 1.450 ----
+Changed the mail queue date format to yyyy/mm/dd, for easier sorting.
---- Changes since 1.440 ----
Added a Module Config option to control if the user is prompted for confirmation before deleting queued messages.
A custom command to rebuild all maps can be specified on the Module Config page, to be used instead of makemap or newaliases.
+---- Changes since 1.450 ----
+Changed the mail queue date format to yyyy/mm/dd, for easier sorting.
else {
push(@cols, $n);
}
- push(@cols, "<font size=1>$mail->{'header'}->{'date'}</font>") if ($show{'Date'});
+ push(@cols, "<font size=1>".&simplify_date($mail->{'header'}->{'date'}, "ymd")."</font>") if ($show{'Date'});
push(@cols, "<font size=1>$mail->{'header'}->{'from'}</font>") if ($show{'From'});
push(@cols, "<font size=1>$mail->{'header'}->{'to'}</font>") if ($show{'To'});
push(@cols, "<font size=1>$mail->{'header'}->{'cc'}</font>") if ($show{'Cc'});