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

Fix self-signed cert for SMTP servers #2574

Merged
merged 1 commit into from
Sep 30, 2023
Merged
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
15 changes: 14 additions & 1 deletion addons/smtp-mail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ fi
# Enter the recipient
RECIPIENT=$(input_box_flow "Please enter the recipient email address that shall receive all mails.\nE.g. [email protected]")

# Check if the server use self-signed certificates
if yesno_box_no "Does the SMTP-server use self-signed certificates?"
then
SELF_SIGNED_CERT=yes
nextcloud_occ config:system:set mail_smtpstreamoptions ssl allow_self_signed --value=true
nextcloud_occ config:system:set mail_smtpstreamoptions ssl verify_peer --value=false
nextcloud_occ config:system:set mail_smtpstreamoptions ssl verify_peer_name --value=false
else
SELF_SIGNED_CERT=no
fi

# Present what we gathered, if everything okay, write to files
msg_box "These are the settings that will be used. Please check that everything seems correct.

Expand All @@ -156,11 +167,13 @@ Encryption=$PROTOCOL
SMTP Port=$SMTP_PORT
SMTP Username=$MAIL_USERNAME
SMTP Password=$MAIL_PASSWORD
Recipient=$RECIPIENT"
Recipient=$RECIPIENT
Self-signed TLS/SSL certificate=$SELF_SIGNED_CERT"

# Ask if everything is okay
if ! yesno_box_yes "Does everything look correct?"
then
msg_box "OK, please start over by running this script again."
exit
fi

Expand Down
Loading