Commit 34863414 authored by Robert Ricci's avatar Robert Ricci

Get actual mail sending working

parent 39a023b9
......@@ -37,6 +37,13 @@ use strict;
# Port to run on - made up crap
my $PORT = 4579;
# Who the mail should claim to come from
my $FROM = getpwuid( $< ) . "@" . `hostname -A`;
chomp($FROM);
# Path to sendmail
my $SENDMAIL = "/usr/sbin/sendmail";
#
# End settable options
#
......@@ -165,10 +172,19 @@ sub send_mail($$) {
print "Will mail to $mailto\n";
print "Subject: $subject\n";
print "Contents:\n";
print $json->pretty->encode( $data );
print $body;
print "\n\n";
}
open(MAIL, "| $SENDMAIL -odb -oem -f'$FROM' -t");
print MAIL "From: $FROM\n";
print MAIL "To: $mailto\n";
print MAIL "Subject: $subject\n";
print MAIL "\n";
print MAIL $body;
print MAIL "\n";
close(MAIL);
return 1;
}
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