diff --git a/CHANGELOG.md b/CHANGELOG.md index a1ce8b2..99e7c5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,10 +13,12 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ### Added - Message::getFolder() method - Create a fast count method for queries #216 +- STARTTLS encryption alias added ### Affected Classes - [Message::class](src/IMAP/Message.php) - [Query::class](src/IMAP/Query/Query.php) +- [Client::class](src/IMAP/Client.php) ### Breaking changes - NaN diff --git a/README.md b/README.md index 73c7e9d..3186486 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ The following encryption methods are supported: - `false` — Disable encryption - `ssl` — Use SSL - `tls` — Use TLS +- `starttls` — Use STARTTLS (alias TLS) - `notls` — Use NoTLS Detailed [config/imap.php](src/config/imap.php) configuration: diff --git a/src/IMAP/Client.php b/src/IMAP/Client.php index d38ff23..29dd3e4 100644 --- a/src/IMAP/Client.php +++ b/src/IMAP/Client.php @@ -540,6 +540,8 @@ protected function getAddress() { } if (in_array($this->encryption,['tls', 'notls', 'ssl'])) { $address .= '/'.$this->encryption; + } elseif ($this->encryption === "starttls") { + $address .= '/tls'; } $address .= '}'; diff --git a/src/config/imap.php b/src/config/imap.php index 67512b0..183752c 100644 --- a/src/config/imap.php +++ b/src/config/imap.php @@ -50,7 +50,7 @@ 'host' => env('IMAP_HOST', 'localhost'), 'port' => env('IMAP_PORT', 993), 'protocol' => env('IMAP_PROTOCOL', 'imap'), //might also use imap, [pop3 or nntp (untested)] - 'encryption' => env('IMAP_ENCRYPTION', 'ssl'), // Supported: false, 'ssl', 'tls', 'notls' + 'encryption' => env('IMAP_ENCRYPTION', 'ssl'), // Supported: false, 'ssl', 'tls', 'notls', 'starttls' 'validate_cert' => env('IMAP_VALIDATE_CERT', true), 'username' => env('IMAP_USERNAME', 'root@example.com'), 'password' => env('IMAP_PASSWORD', ''), @@ -60,7 +60,7 @@ 'gmail' => [ // account identifier 'host' => 'imap.gmail.com', 'port' => 993, - 'encryption' => 'ssl', // Supported: false, 'ssl', 'tls' + 'encryption' => 'ssl', 'validate_cert' => true, 'username' => 'example@gmail.com', 'password' => 'PASSWORD', @@ -69,7 +69,7 @@ 'another' => [ // account identifier 'host' => '', 'port' => 993, - 'encryption' => false, // Supported: false, 'ssl', 'tls' + 'encryption' => false, 'validate_cert' => true, 'username' => '', 'password' => '',