Skip to content
Permalink
Browse files

Allow unauthenticated smtp

  • Loading branch information...
NEMS Linux
NEMS Linux committed Mar 7, 2019
1 parent 789a1fb commit 5abcc6dc810b497ef48e138b497a4825ed102d34
Showing with 16 additions and 6 deletions.
  1. +8 −3 data/1.5/nagios/plugins/nems_sendmail_host
  2. +8 −3 data/1.5/nagios/plugins/nems_sendmail_service
@@ -508,9 +508,14 @@ $mail->isSMTP();
$mailserver = explode(':',$nems['resource']['USER7']);
$mail->Host = $mailserver[0];
$mail->Port = $mailserver[1];
$mail->SMTPAuth = true;
$mail->Username = $nems['resource']['USER9'];
$mail->Password = $nems['resource']['USER10'];
// if user has an empty username, treat as no SMTP auth
if (strlen($nems['resource']['USER9']) > 0) {
$mail->SMTPAuth = true;
$mail->Username = $nems['resource']['USER9'];
$mail->Password = $nems['resource']['USER10'];
} else {
$mail->SMTPAuth = false;
}
if ($nems['resource']['USER15'] == 1 || !isset($nems['resource']['USER15'])) {
$mail->SMTPSecure = 'tls';
}
@@ -535,9 +535,14 @@ $mail->isSMTP();
$mailserver = explode(':',$nems['resource']['USER7']);
$mail->Host = $mailserver[0];
$mail->Port = $mailserver[1];
$mail->SMTPAuth = true;
$mail->Username = $nems['resource']['USER9'];
$mail->Password = $nems['resource']['USER10'];
// if user has an empty username, treat as no SMTP auth
if (strlen($nems['resource']['USER9']) > 0) {
$mail->SMTPAuth = true;
$mail->Username = $nems['resource']['USER9'];
$mail->Password = $nems['resource']['USER10'];
} else {
$mail->SMTPAuth = false;
}
if ($nems['resource']['USER15'] == 1 || !isset($nems['resource']['USER15'])) {
$mail->SMTPSecure = 'tls';
}

0 comments on commit 5abcc6d

Please sign in to comment.
You can’t perform that action at this time.