Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 <[email protected]>
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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants