From 5215371bb9a05786e4d05b64d7fe9eead8d1a955 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Sep 2008 13:12:02 -0500 Subject: [PATCH] Import version as of 2008-09-03 for upload-ftp-v1.1.pl --- upload-ftp-v1.1.pl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/upload-ftp-v1.1.pl b/upload-ftp-v1.1.pl index 7b51bb3..6247395 100755 --- a/upload-ftp-v1.1.pl +++ b/upload-ftp-v1.1.pl @@ -902,14 +902,14 @@ sub install_files { sub success_upload { my ($sig_file,$upload_file,$directive_file) = @_; - &mail ("upload of $upload_file and $sig_file complete"); + &mail ("upload of $upload_file and $sig_file complete",1); unlink ($directive_file) || ftp_warn("unlink($directive_file) failed: $!"); } sub success_directive { my ($directive_file) = shift; - &mail ("processing of $directive_file complete"); + &mail ("processing of $directive_file complete",1); unlink ($directive_file) || ftp_warn("unlink($directive_file) failed: $!"); } @@ -1004,13 +1004,19 @@ sub mail { # Some messages should be sent to the user, some should not push (@email_list, @{$info{email}}) if (defined $info{email} && $send_to_user); + shift(@email_list) if ($send_to_user); + + my $sender = 'ftp-upload-script@gnu.org'; + $sender = 'ftp-upload@gnu.org' if ($send_to_user); # We really want replies to go to the ftp-upload queue + # print STDERR "final emails: @email_list\n"; # return @_; my $smtp = Net::SMTP->new ("127.0.0.1"); ftp_die("FATAL: SMTP connection failed") unless $smtp; - $smtp->mail ("ftp-upload-script\@gnu.org"); + $smtp->mail ($sender); + $smtp->bcc ($email_always) if ($send_to_user); $smtp->recipient (@email_list, { SkipBad => 1}); ftp_syslog('warning', "Sending email to @email_list"); @@ -1019,7 +1025,7 @@ sub mail { $smtp->data (); $smtp->datasend ("To: " . join (", ", @email_list) . "\n"); - $smtp->datasend ("From: ftp-upload-script\@gnu.org\n"); + $smtp->datasend ("From: $sender\n"); $smtp->datasend ("Reply-To: ftp-upload\@gnu.org\n"); if ($subject ne '') { $smtp->datasend ("Subject: [gnu-ftp-upload] $subject"); -- 2.25.1