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

E-Mail: Automatically set 'allow_self_signed=true' for 'mail_smtphost = localhost' #41935

Open
Cybso opened this issue Nov 30, 2023 · 1 comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement

Comments

@Cybso
Copy link

Cybso commented Nov 30, 2023

The newer versions of Nextcloud use StartTLS per default, resulting in many bug reports when used with self-signed certificates:

#37329
#37694
#38957
#39452
#39538
#40073

There is a workaround to allow self signed certificates by manually editing config.php:

  "mail_smtpstreamoptions" => array(
    'ssl' => array(
        'allow_self_signed' => true,
        'verify_peer' => false,
        'verify_peer_name' => false
    )   
  ),  

But since many users will stumble across this problem let me suggest a small change:

If "mail_smtphost" is set to "localhost" or "127.0.0.1" and the above parameters are not explicitly configured, then assume that the user wants to accept unverified self-signed certificates by default - or do not use StartTLS at all for local connections.

@Cybso Cybso added enhancement 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Nov 30, 2023
@Cybso
Copy link
Author

Cybso commented Nov 30, 2023

I have written a short POC patch, works perfectly for me:

nextcloud-41935-poc.patch.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement
Projects
None yet
Development

No branches or pull requests

1 participant