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

Conversation

MichaelGooden
Copy link

Allow setting the msmtp auth mode with the SMTP_AUTH environmental variable.
If SMTP_AUTH is not set, the original logic is used to determine the value.

Allow setting the msmtp auth mode with the SMTP_AUTH environmental variable.
If SMTP_AUTH is not set, the original logic is used to determine the value.

Signed-off-by: Michael Gooden <me@michaelgooden.net>
Copy link
Member

@adam-dej adam-dej left a comment

Choose a reason for hiding this comment

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

Please document the new env var in the README. Please also update docs for SMTP_USER, since the original contains the following statement:

Specifying a value here will enable SMTP authentication.

This may not be true anymore.

@@ -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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants