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: $!");
}
# 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");
$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");