Commit b511eb70 authored by Robert Ricci's avatar Robert Ricci

Support 'mailfrom' option

parent b122f458
......@@ -168,6 +168,12 @@ my @archivemail = get_config("archivemail",undef);
#
my $replyto = get_config("replyto",undef);
#
# If set, set the 'From' header in the mail - useful when being called
# from outside to set make the sender look right
#
my $mailfrom = get_config("mailfrom",undef);
#
# If set to true, detach and run in background - the push doesn't return until
# the hook finishes, so doing this means the pusher doesn't have to wait for
......@@ -1121,6 +1127,11 @@ sub send_mail($$$@) {
open(MAIL, "| $SENDMAIL -odb -oem -t");
}
# If requested, set the From header
if (defined($mailfrom)) {
print MAIL "From: $mailfrom\n";
}
print MAIL "To: " . join(", ",@$mailto) . "\n";
print MAIL "Subject: $subject\n";
print MAIL "Message-Id: $messageid\n";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment