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

Feature request: Email function should also have an option to accept any SSL certificate #15

Closed
GH-User opened this issue Sep 13, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@GH-User
Copy link

GH-User commented Sep 13, 2018

Feature request: Email function should also have an option to accept any SSL certificate like a self signed cert. At the moment it only accepts certificates quite strict. Therefore I can't use my own email server that just uses self signed cert. Every email client has such an option and it would be great to have that here too.
Thanks!

@jeffaco
Copy link
Owner

jeffaco commented Sep 14, 2018

So, to be clear, you're asking that the mail package just accept the certificate that the E-Mail server is offering and not verify it, right?

If so, it's easy to do that. However, there's a change in flight (issue #14) that is changing the format of the global initialization file slightly for mail configuration. It's a trivial editing change, but I have a preference of making the change AFTER #14 goes in, and thus only supporting this feature request (and any other new features) in the new format.

The full story is this:

  • I decided that I set up the mail flags incorrectly in the global configuration file. Rather than prefixing all the email settings with email, they should have been in an email section (i.e. email.*). I noted that but didn't feel compelled to change it.

  • Boudewijn (@boedy) graciously offered a pull request for duplicacy-util (in Groundwork for multiple notification channels #14) for multiple notification channels (something that I've wanted too, but didn't get to). That's currently being worked on. He noted the error I made in email configuration, so he fixed it. We decided to accept old or new format for now, and deprecate the old format. But that code isn't in yet.

So here, I want to make a change (something like email.acceptInsecureCertificate: true would be in the global configuration file). Default would be to do what we do today, but if you set acceptInsecureCertificate to true, then we'll accept a self-signed certificate. The default should clearly be false for this.

Rather than support this in both the old and new formats, I'd rather just add this to the new format.

So, @GH-User this is easy to do. But would you mind waiting a few weeks (however long @boedy needs to finish up the framework for his new feature) before I made this change? If urgent for you, I'll work something out, but waiting a bit would make this somewhat easier for me (and avoids @boedy doing merges) if we wait a bit.

Let me know, thanks.

@jeffaco jeffaco added the enhancement New feature or request label Sep 14, 2018
@GH-User
Copy link
Author

GH-User commented Sep 14, 2018

Many thanks for your quick response!

you're asking that the mail package just accept the certificate that the E-Mail server is offering and not verify it, right?

Yes, that's right.

But would you mind waiting a few weeks before I made this change?

No problem at all to wait. At the moment I'm using a free SMTP relay service with a valid certificate for sending the emails as a workaround and it works well.

Thanks again!

jeffaco added a commit that referenced this issue Sep 19, 2018
If a local email server is being used, it's likely that the email
server is using a self-signed certficate. Allow insecure certficates
based on new configuration setting email.acceptInsecureCerts.

Fixes issue #15
@jeffaco
Copy link
Owner

jeffaco commented Sep 19, 2018

Added new global configuration flag for this. Note that this is ONLY supported via the new configuration format. Instructions will be in the 1.4 release on how to change this, but briefly, the email settings in the global configuration setting should be something like this:

email:
  fromAddress: "Donald Duck <[email protected]>"
  toAddress: "Donald Duck <[email protected]>"
  serverHostname: smtp.gmail.com
  serverPort: 465
  authUsername: [email protected]
  authPassword: gaozqlwbztypagwt
  acceptInsecureCerts: true

Only set this if you build from source or download 1.4, once it's released.

acceptInsecureCerts is the setting that will allow self-signed certificates.

Closing this issue since it's resolved and pushed to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants