-
Notifications
You must be signed in to change notification settings - Fork 284
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
Allow use of internal CA signed certificates for msmtp #1498
base: develop
Are you sure you want to change the base?
Conversation
By default, msmtp checks the validity of the certificate chain of the mail server. The new option "CMS_SMTP_CHECK_TLS_CERTIFICATE" allows use of TLS certificates signed by internal Certificate Authority that do not pass the default check. If the user sets "CMS_SMTP_CHECK_TLS_CERTIFICATE" to "NO" then the line "tls_nocertcheck" will be added to /etc/msmtprc (see dagonix/ xibo-docker/config.env.template commit).
For this to work, I think we also need to add the environment variable to |
By default, msmtp checks the validity of the certificate chain of the mail server. The new option "CMS_SMTP_CHECK_TLS_CERTIFICATE" allows use of TLS certificates signed by internal Certificate Authority that do not pass the default check. If the user sets "CMS_SMTP_CHECK_TLS_CERTIFICATE" to "NO" then the line "tls_nocertcheck" will be added to /etc/msmtprc
Yes ! You're right, I added the line there. Thank you. |
@@ -289,6 +289,11 @@ then | |||
/bin/sed -i "s/tls_starttls .*$/tls_starttls off/" /etc/msmtprc | |||
fi | |||
|
|||
if [ "$CMS_SMTP_CHECK_TLS_CERTIFICATE" == "NO" ] | |||
then | |||
/bin/sed -i "s/tls .*$/tls_nocertcheck/" /etc/msmtprc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will match the line:
tls on
and replace it with tls_nocertcheck
?
But I think the correct syntax would be to have both? ie
tls on
tls_nocertcheck
Perhaps it might be better to have in the template msmtprc
file
# CMS_SMTP_USE_TLS
tls on
#CMS_SMTP_CHECK_TLS_CERTIFICATE
#tls_nocertcheck
and then update the sed command to remove the comment if necessary?
/bin/sed -i "s/#tls_nocertcheck.*$/tls_nocertcheck/" /etc/msmtprc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, absolutly. Both options are necessary :
tls on
tls_nocertcheck
You are right Alex.
I've moved this to 3.3.2 to allow more time to ensure we get it right. Issue: xibosignage/xibo#2939 |
Thank you Dan, Alex is right, both options are necessary. |
By default, msmtp checks the validity of the certificate chain of the mail server. The new option "CMS_SMTP_CHECK_TLS_CERTIFICATE" allows use of TLS certificates signed by internal Certificate Authority that do not pass the default check. If the user sets "CMS_SMTP_CHECK_TLS_CERTIFICATE" to "NO" then the line "tls_nocertcheck" will be added to /etc/msmtprc (see dagonix/ xibo-docker/config.env.template commit).