Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Add SMTP_AUTH config #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion root/usr/local/src/osticket/setup/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
'smtp_tls_certs' => getenv("SMTP_TLS_CERTS") ?: '/etc/ssl/certs/ca-certificates.crt',
'smtp_user' => getenv("SMTP_USER"),
'smtp_pass' => getenv("SMTP_PASSWORD"),
'smtp_auth' => getenv("SMTP_AUTH"),

'cron_interval' => getenv("CRON_INTERVAL") ?: 5,

Expand Down Expand Up @@ -82,7 +83,7 @@ function convertStrToBool($varName, $default) {
$mailConfig = str_replace('%SMTP_TLS_CERTS%', $vars['smtp_tls_certs'], $mailConfig);

$mailConfig = str_replace('%SMTP_TLS%', boolToOnOff(convertStrToBool('smtp_tls',true)), $mailConfig);
$mailConfig = str_replace('%SMTP_AUTH%', boolToOnOff($vars['smtp_user'] != ''), $mailConfig);
$mailConfig = str_replace('%SMTP_AUTH%', !empty($vars['smtp_auth']) ? $vars['smtp_auth'] : boolToOnOff(getenv("SMTP_USER") != ''), $mailConfig);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change from $vars['smtp_user'] to getenv("SMTP_USER") in boolToOnOff call?


if (!file_put_contents(MAIL_CONFIG_FILE, $mailConfig) || !chown(MAIL_CONFIG_FILE,'www-data')
|| !chgrp(MAIL_CONFIG_FILE,'www-data') || !chmod(MAIL_CONFIG_FILE,0600)) {
Expand Down