ktest.pl: No need to print no mailer is specified when mailto is not

If the user doesn't want to send mail, then don't bother them with output
that says they didn't specify a mailer. That can be annoying.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
Steven Rostedt (VMware) 2018-04-06 15:49:43 -04:00
parent eaaa1e283a
commit f5ef488557

View File

@ -4135,12 +4135,14 @@ sub _sendmail_send {
} }
sub send_email { sub send_email {
if (defined($mailto) && defined($mailer)) { if (defined($mailto)) {
if (!defined($mailer)) {
doprint "No email sent: email or mailer not specified in config.\n";
return;
}
if ($mailer eq "mail" || $mailer eq "mailx"){ _mailx_send(@_);} if ($mailer eq "mail" || $mailer eq "mailx"){ _mailx_send(@_);}
elsif ($mailer eq "sendmail" ) { _sendmail_send(@_);} elsif ($mailer eq "sendmail" ) { _sendmail_send(@_);}
else { doprint "\nYour mailer: $mailer is not supported.\n" } else { doprint "\nYour mailer: $mailer is not supported.\n" }
} else {
print "No email sent: email or mailer not specified in config.\n"
} }
} }