add check before sending mail to avoid mail warning
This commit is contained in:
parent
7ab784ea38
commit
365b378f4b
@ -1501,9 +1501,13 @@ sub send_mail {
|
||||
my $mailprog = "/bin/mail";
|
||||
my $sendmail = "echo \"$content\"";
|
||||
send_msg(2, "begin to send mail , the contents is $sendmail\n");
|
||||
my $send = $sendmail." | $mailprog -s \"$subject\" \"$confkeys{mailgroup}\" ";
|
||||
system($send);
|
||||
send_msg(2, "finish sending mail, $send\n");
|
||||
if ($confkeys{mailgroup}) {
|
||||
my $send = "$sendmail"." | $mailprog -s \"$subject\" \"$confkeys{mailgroup}\" ";
|
||||
system($send);
|
||||
send_msg(2, "finish sending mail, $send\n");
|
||||
} else {
|
||||
send_msg(1, "can't send mail to nobody ");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user