thsmi / sieve

Sieve Script Editor
GNU Affero General Public License v3.0
729 stars 56 forks source link

Cannot write property 'security' on boolean false #909

Closed CherryDT closed 6 months ago

CherryDT commented 8 months ago

Prerequisites

What happened?

Download latest nightly build. Import from Thunderbird. Observe "hang". Check devtools to find error "Cannot write property 'security' on boolean false":

image

This seems to happen because of this call:

sieve.connect(new SieveUrl(`sieve://${this.hostname}:${port}`), false);

Here, false is passed, however sieve.connect seems to expect an options object as second argument.

What did you expect to happen?

Successful import.

Which Version

Include information about your system, server and most important if it is about the app or webextension.

Seems like this regression was introduced by https://github.com/thsmi/sieve/pull/680

However, I'm not even sure why false is passed here in the first place as opposed to true, because this argument apparently used to be secure and my Thunderbird profile has "SSL/TLS" set for this account!

thsmi commented 6 months ago

Concerning you question:

Sieve uses implicit startTLS means you always start insecure and then update to secure. You normally upgrade before authenticating.

In case you just want to read read the server's capabilities then you don't need to authenticate, and thus you don't upgrade your connection to secure. You just connect ask the server what are your capabilities and then disconnect.

If you got a useful response you know everything is fine and in every other case you know you are not talking to a sieve server and thus the basic configuration is wrong.

thsmi commented 6 months ago

Should be fixed with the following build, the whole import logic is now updated:

https://dev.azure.com/thsmi/1164eec3-b870-4973-8110-5e275d208aac/_apis/build/builds/20076/artifacts?artifactName=Zip%20-%20Windows%20Application&api-version=7.1&%24format=zip