Skip to content

Commit

Permalink
STARTTLS encryption alias added
Browse files Browse the repository at this point in the history
  • Loading branch information
Webklex committed Jun 30, 2019
1 parent e4b03f5 commit e84ff4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/IMAP/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 .= '}';
Expand Down
6 changes: 3 additions & 3 deletions src/config/imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', ''),
Expand All @@ -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',
Expand All @@ -69,7 +69,7 @@
'another' => [ // account identifier
'host' => '',
'port' => 993,
'encryption' => false, // Supported: false, 'ssl', 'tls'
'encryption' => false,
'validate_cert' => true,
'username' => '',
'password' => '',
Expand Down

0 comments on commit e84ff4e

Please sign in to comment.