my $c_Zone_Tag = ''; # CONF_Zone_Tag
my $c_Email_Blacklist; # CONF_Email_Blacklist
my $c_Email_MaintainerMap; # CONF_Email_Maintainers
+ my $c_Email_SourceAddress; # CONF_Email_SourceAddress
+ my $c_Email_ReturnAddress; # CONF_Email_ReturnAddress
my $c_Email_ArchiveBox; # CONF_Email_PublicArchive
my $c_Email_InternalBox; # CONF_Email_InternalArchive
my $c_Package_Config; # CONF_DIR_ConfigBase
$c_Email_Blacklist = File::Spec->catfile($base, 'email.blacklist');
$c_Email_MaintainerMap = File::Spec->catfile($base, 'm.bypkg');
+ $c_Email_SourceAddress = 'ftp-upload-script@gnu.org';
+ $c_Email_ReturnAddress = 'ftp-upload@gnu.org';
+
$c_Email_ArchiveBox = 'ftp-upload-report@gnu.org';
$c_Email_InternalBox = 'ftp-upload-script@gnu.org';
$c_Email_Blacklist = $EmailConfig{blacklist};
$c_Email_MaintainerMap = $EmailConfig{maintainermap};
+ $c_Email_SourceAddress = $EmailConfig{sourcebox};
+ $c_Email_ReturnAddress = $EmailConfig{returnbox};
+
$c_Email_ArchiveBox = $EmailConfig{archivebox};
$c_Email_InternalBox = $EmailConfig{internalbox};
[archivedir => $c_dir_Archive])
{ print $item->[0],' = ',$item->[1],"\n" if $item->[1] }
if ($c_Email_Blacklist || $c_Email_MaintainerMap
+ || $c_Email_SourceAddress || $c_Email_ReturnAddress
|| $c_Email_ArchiveBox || $c_Email_InternalBox) {
print "\n[email]\n";
print "blacklist = $c_Email_Blacklist\n"
if $c_Email_MaintainerMap;
print "\n"
if ($c_Email_Blacklist || $c_Email_MaintainerMap)
+ && ($c_Email_SourceAddress || $c_Email_ReturnAddress);
+ print "sourcebox = $c_Email_SourceAddress\n"
+ if $c_Email_SourceAddress;
+ print "returnbox = $c_Email_ReturnAddress\n"
+ if $c_Email_ReturnAddress;
+ print "\n"
+ if ($c_Email_SourceAddress || $c_Email_ReturnAddress)
&& ($c_Email_ArchiveBox || $c_Email_InternalBox);
print "archivebox = $c_Email_ArchiveBox\n"
if $c_Email_ArchiveBox;
die "gatekeeper: required configuration parameter(s) not set\n"
unless $ok;
}
-
- exit 0 if $CheckConfigurationParse;
-
} # end of configuration handling skipped for --help and --version
constant->import(CONF_Log_Tag => $c_Log_Tag);
constant->import(CONF_Email_Blacklist => $c_Email_Blacklist);
constant->import(CONF_Email_Maintainers => $c_Email_MaintainerMap || '');
+ constant->import(CONF_Email_SourceAddress => $c_Email_SourceAddress);
+ constant->import(CONF_Email_ReturnAddress =>
+ $c_Email_ReturnAddress || $c_Email_SourceAddress);
constant->import(CONF_Email_PublicArchive => $c_Email_ArchiveBox);
constant->import(CONF_Email_InternalArchive => $c_Email_InternalBox);
constant->import(CONF_DIR_Archive => $c_dir_Archive);
constant->import(CONF_FILE_Serials => $c_Serials_FileName);
+
+ exit 0 if $CheckConfigurationParse; # stop here if checking parser
}
if (WANT_VERSION) {
my $msg = shift;
my %args = @_;
+ return unless CONF_Email_SourceAddress;
+
$args{subject} = 'generic failure' unless $args{subject};
my @email_list = (CONF_Email_InternalArchive);
# value in the address list. Remove it.
@email_list = grep defined, @email_list;
- my $sender = 'ftp-upload-script@gnu.org';
- $sender = 'ftp-upload@gnu.org'
- if defined $args{to}; # We really want replies to go to the ftp-upload queue
+ my $sender = CONF_Email_SourceAddress;
+ $sender = CONF_Email_ReturnAddress
+ if defined $args{to}; # We really want replies to go to the return box.
@email_list = exclude_mail_blacklist(CONF_Email_Blacklist, @email_list)
if CONF_Email_Blacklist;
[From => $sender],
[Date => strftime("%a, %e %b %Y %H:%M:%S %z", localtime)],
[Subject => $args{subject}],
- ['Reply-To' => 'ftp-upload@gnu.org'],
+ ['Reply-To' => CONF_Email_ReturnAddress],
['Message-ID'=> Email::MessageID->new->in_brackets],
],
wrap('','',$msg));
my $msg = shift;
my $package_name = shift;
- return unless CONF_Email_PublicArchive;
+ return unless CONF_Email_PublicArchive && CONF_Email_SourceAddress;
- sendmail('ftp-upload-script@gnu.org',
+ sendmail(CONF_Email_SourceAddress,
[CONF_Email_PublicArchive],
[[To => CONF_Email_PublicArchive],
- [From => 'ftp-upload-script@gnu.org'],
+ [From => CONF_Email_SourceAddress],
[Date => strftime("%a, %e %b %Y %H:%M:%S %z", localtime)],
[Subject => ("[".CONF_Zone_Tag." gnu-ftp-debug] "
."new upload processed: $package_name")],
- ['Reply-To' => 'ftp-upload@gnu.org'],
+ ['Reply-To' => CONF_Email_ReturnAddress],
['Message-ID'=> Email::MessageID->new->in_brackets],
],
$msg);
blacklist = /srv/gatetest/config/email.blacklist
maintainermap = /srv/gatetest/config/maintainers.bypkg
+sourcebox = upload-handler@example.org
+returnbox = upload-admin@example.org
+
archivebox = public@example.org
internalbox = internal@example.org
}
proc run_email_option_coverage_test {} {
global configuration_file
- for { set i 0 } { $i <= 15 } { incr i } {
+ for { set i 0 } { $i <= 63 } { incr i } {
set cnf $configuration_file(basic-email)
if { $i & 1<<0 } { regsub -line {^blacklist = .*\n} $cnf "" cnf }
if { $i & 1<<1 } { regsub -line {^maintainermap = .*\n} $cnf "" cnf }
- if { $i & 1<<2 } { regsub -line {^archivebox = .*\n} $cnf "" cnf }
- if { $i & 1<<3 } { regsub -line {^internalbox = .*\n} $cnf "" cnf }
+ if { $i & 1<<2 } { regsub -line {^sourcebox = .*\n} $cnf "" cnf }
+ if { $i & 1<<3 } { regsub -line {^returnbox = .*\n} $cnf "" cnf }
+ if { $i & 1<<4 } { regsub -line {^archivebox = .*\n} $cnf "" cnf }
+ if { $i & 1<<5 } { regsub -line {^internalbox = .*\n} $cnf "" cnf }
do_configuration_test \
"email configuration coverage $i" "email-$i.conf" $cnf {} {0 {}}
}