Commit 355f5aa8 authored by Mike Hibler's avatar Mike Hibler

Make sure we use -i for sendmail when we pipe into it.

This prevents a line with a single "." from meaning EOF to sendmail.
How arcane!

I discovered this when I ran a create_image and I didn't get the complete
log mailed to me. This is because create_image did a frisbee download of an
image with a single chunk, which of course printed out:

  Using Multicast 235.252.1.187
  Joined the team after 0 sec. ID is 1586355915. File is 1 chunks (963200 bytes)
  .

Fortunately, "arcane" is my middle name, so it didn't take me long to find
this...
parent 7b1a9c6a
......@@ -94,6 +94,6 @@ Thanks,
@TBOPSEMAIL_NOSLASH@
MESSAGE
) | /usr/sbin/sendmail -t
) | /usr/sbin/sendmail -i -t
done
......@@ -3471,7 +3471,7 @@ sub SetupSendMail($$)
{
my ($isfatal, $msg) = @_;
if (! open(MAIL, "|/usr/sbin/sendmail -t")) {
if (! open(MAIL, "|/usr/sbin/sendmail -i -t")) {
die("*** $0:\n".
" SENDMAIL: Could not start sendmail: $!\n".
" $msg\n");
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -68,7 +68,7 @@ sub SENDMAILWith($$$$;$$@);
sub SENDMAIL($$$;$$@)
{
my($To, $Subject, $Message, $From, $Headers, @Files) = @_;
SENDMAILWith("/usr/sbin/sendmail -t", $To, $Subject, $Message, $From, $Headers, @Files);
SENDMAILWith("/usr/sbin/sendmail -i -t", $To, $Subject, $Message, $From, $Headers, @Files);
}
sub SENDMAILWith($$$$;$$@)
......
#!/usr/bin/perl -w
#
# Copyright (c) 2008-2012 University of Utah and the Flux Group.
# Copyright (c) 2008-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -735,7 +735,7 @@ sub DBError($$;$)
my($f, $message, $nomail) = @_;
if (! defined($nomail)) {
if (open(MAIL, "| /usr/sbin/sendmail -t")) {
if (open(MAIL, "| /usr/sbin/sendmail -i -t")) {
print MAIL "To: $TBOPS\n";
print MAIL "Subject: DBError\n";
print MAIL "\n";
......
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -150,7 +150,7 @@ sub SENDMAILWith($$$$;$$@);
sub SENDMAIL($$$;$$@)
{
my($To, $Subject, $Message, $From, $Headers, @Files) = @_;
SENDMAILWith("/usr/sbin/sendmail -t", $To, $Subject, $Message, $From, $Headers, @Files);
SENDMAILWith("/usr/sbin/sendmail -i -t", $To, $Subject, $Message, $From, $Headers, @Files);
}
sub AnonSENDMAIL($$$;$$@)
......@@ -238,7 +238,7 @@ sub OPENMAIL($$;$$)
my($To, $Subject, $From, $Headers) = @_;
local *MAIL;
if (! open(MAIL, "|/usr/sbin/sendmail -t")) {
if (! open(MAIL, "|/usr/sbin/sendmail -i -t")) {
print STDERR "OPENMAIL: Could not start sendmail: $!\n";
return 0;
}
......
# -*- python -*-
#
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -106,7 +106,7 @@ def SENDMAIL(To, Subj, Msg, From = None, Headers = None, Files = ()):
"""
Tag = MAILTAG.upper()
# damn, no good way to tell if this fails
sm = os.popen("/usr/sbin/sendmail -t", "w")
sm = os.popen("/usr/sbin/sendmail -i -t", "w")
#
# Sendmail will figure this out if not given.
......
#!/usr/bin/perl -w
#
# Copyright (c) 2004-2008 University of Utah and the Flux Group.
# Copyright (c) 2004-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -1831,7 +1831,7 @@ sub SetupSendMail($$)
{
my ($isfatal, $msg) = @_;
if (! open(MAIL, "|/usr/sbin/sendmail -t")) {
if (! open(MAIL, "|/usr/sbin/sendmail -i -t")) {
die("*** $0:\n".
" SENDMAIL: Could not start sendmail: $!\n".
" $msg\n");
......
......@@ -50,9 +50,7 @@ if ($EUID != 0) {
# of the Received lines.
$UID = $EUID;
# Even with the UID and EUID set to 0, sendmail will still manager to
# Even with the UID and EUID set to 0, sendmail will still manage to
# find the real user and use it for the envelope sender unless we
# explicitly set it to root.
exec("/usr/sbin/sendmail -t -froot");
exec("/usr/sbin/sendmail -i -t -froot");
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