Skip to content

Conversation

@sophie-h
Copy link

Quickly looked at the new code and noted that setting sslmode to something like true disables encryption, if I'm right? This PR is not tested at all, but I don't wanted to sketch what might be a better solution.

@violoncelloCH

This comment has been minimized.

Copy link
Member

@violoncelloCH violoncelloCH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, thanks for your PR!
though I'm not sure if I understand it correctly: see my comments in the review...

if ($this->sslmode === 'tls') {
curl_setopt($ch, CURLOPT_USE_SSL, CURLUSESSL_ALL);

if ($this->sslmode !== 'tls') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't people with tls set use STARTTLS by default? - this would exclude them, right?

curl_setopt($ch, CURLOPT_USE_SSL, CURLUSESSL_ALL);
}
} else {
$protocol = 'imaps';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you set the $protocol two times to imaps but for starttls (and insecure connections) we would need imap, right?

$protocol = ($this->sslmode === "ssl") ? "imaps" : "imap";
$url = "{$protocol}://{$this->mailbox}:{$this->port}";
$ch = curl_init();
if ($this->sslmode === 'tls') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a simpler solution: how about just changing this line to include everything expect:

  • explicit ssl (and also TRUE),
  • explicit nossl, notls, maybe "empty string" (and also FALSE)
    so everything else (including tls) would be handled as STARTTLS...
    what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants