mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-01-23 02:14:26 +00:00
refactor: remove dead code in smtp_api (auth always required)
This commit is contained in:
parent
e63e9028ce
commit
7ef052326e
1 changed files with 8 additions and 12 deletions
|
|
@ -3622,18 +3622,14 @@ function smtp_api($action, $data) {
|
|||
$mail->CharSet = 'UTF-8';
|
||||
$mail->XMailer = 'mailcow SMTP API';
|
||||
|
||||
// Enable authentication if password is provided
|
||||
if (!empty($smtp_pass)) {
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = $smtp_user;
|
||||
$mail->Password = $smtp_pass;
|
||||
if ($smtp_port == 465) {
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
|
||||
} elseif ($smtp_port == 587) {
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
}
|
||||
} else {
|
||||
$mail->SMTPAuth = false;
|
||||
// Authentication is required
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = $smtp_user;
|
||||
$mail->Password = $smtp_pass;
|
||||
if ($smtp_port == 465) {
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
|
||||
} elseif ($smtp_port == 587) {
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
}
|
||||
|
||||
// Set sender
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue