Skip to content

Commit e84ff4e

Browse files
committed
STARTTLS encryption alias added
1 parent e4b03f5 commit e84ff4e

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
1313
### Added
1414
- Message::getFolder() method
1515
- Create a fast count method for queries #216
16+
- STARTTLS encryption alias added
1617

1718
### Affected Classes
1819
- [Message::class](src/IMAP/Message.php)
1920
- [Query::class](src/IMAP/Query/Query.php)
21+
- [Client::class](src/IMAP/Client.php)
2022

2123
### Breaking changes
2224
- NaN

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ The following encryption methods are supported:
111111
- `false` — Disable encryption
112112
- `ssl` — Use SSL
113113
- `tls` — Use TLS
114+
- `starttls` — Use STARTTLS (alias TLS)
114115
- `notls` — Use NoTLS
115116

116117
Detailed [config/imap.php](src/config/imap.php) configuration:

src/IMAP/Client.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ protected function getAddress() {
540540
}
541541
if (in_array($this->encryption,['tls', 'notls', 'ssl'])) {
542542
$address .= '/'.$this->encryption;
543+
} elseif ($this->encryption === "starttls") {
544+
$address .= '/tls';
543545
}
544546

545547
$address .= '}';

src/config/imap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
'host' => env('IMAP_HOST', 'localhost'),
5151
'port' => env('IMAP_PORT', 993),
5252
'protocol' => env('IMAP_PROTOCOL', 'imap'), //might also use imap, [pop3 or nntp (untested)]
53-
'encryption' => env('IMAP_ENCRYPTION', 'ssl'), // Supported: false, 'ssl', 'tls', 'notls'
53+
'encryption' => env('IMAP_ENCRYPTION', 'ssl'), // Supported: false, 'ssl', 'tls', 'notls', 'starttls'
5454
'validate_cert' => env('IMAP_VALIDATE_CERT', true),
5555
'username' => env('IMAP_USERNAME', '[email protected]'),
5656
'password' => env('IMAP_PASSWORD', ''),
@@ -60,7 +60,7 @@
6060
'gmail' => [ // account identifier
6161
'host' => 'imap.gmail.com',
6262
'port' => 993,
63-
'encryption' => 'ssl', // Supported: false, 'ssl', 'tls'
63+
'encryption' => 'ssl',
6464
'validate_cert' => true,
6565
'username' => '[email protected]',
6666
'password' => 'PASSWORD',
@@ -69,7 +69,7 @@
6969
'another' => [ // account identifier
7070
'host' => '',
7171
'port' => 993,
72-
'encryption' => false, // Supported: false, 'ssl', 'tls'
72+
'encryption' => false,
7373
'validate_cert' => true,
7474
'username' => '',
7575
'password' => '',

0 commit comments

Comments
 (0)