]> git.decadent.org.uk Git - dak.git/blobdiff - tools/debianqueued-0.9/debianqueued
Merge from sgran, so we add the date header, as the exim setup debian uses doesnt...
[dak.git] / tools / debianqueued-0.9 / debianqueued
index c4dec406b82b789fa8e4f982f1930c35a3238cd7..fce611e9df1643a76741a6c409de0e56f76f3149 100755 (executable)
 require 5.002;
 use strict;
 use POSIX;
-use POSIX qw( sys_stat_h sys_wait_h signal_h );
+use POSIX qw( strftime sys_stat_h sys_wait_h signal_h );
 use Net::Ping;
 use Net::FTP;
 use Socket qw( PF_INET AF_INET SOCK_STREAM );
@@ -276,6 +276,7 @@ $junk = $conf::no_changes_timeout;
 $junk = @conf::nonus_packages;
 $junk = @conf::test_binaries;
 $junk = @conf::maintainer_mail;
+$junk = $conf::mail ||= '/usr/sbin/sendmail';
 $conf::target = "localhost" if $conf::upload_method eq "copy";
 package main;
 
@@ -2090,7 +2091,6 @@ sub init_mail(;$) {
 # then send out
 #
 sub finish_mail() {
-       local( *MAIL );
 
        debug( "No mail for $main::mail_addr" )
                if $main::mail_addr && !$main::mail_text;
@@ -2127,12 +2127,17 @@ sub send_mail($$$) {
        my $package = keys %main::packages ? join(' ', keys %main::packages) : "";
 
        use Email::Send;
-       $Email::Send::Sendmail::SENDMAIL = '/usr/sbin/sendmail';
 
+        unless (defined($Email::Send::Sendmail::SENDMAIL)) {
+               $Email::Send::Sendmail::SENDMAIL = $conf::mail;
+       }
+
+       my $date = sprintf "%s", strftime("%a, %d %B %Y %T %z", (localtime(time)));
        my $message = <<__MESSAGE__;
 To: $addr
-From: dak\@ftp-master.debian.org
+From: Archive Administrator <dak\@ftp-master.debian.org>
 Subject: $subject
+Date: $date
 X-Debian: DAK
 __MESSAGE__