Skip to content

Commit d00f7b9

Browse files
committed
Protocol option added #124
1 parent 4152da6 commit d00f7b9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/IMAP/Client.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ class Client {
4444
*/
4545
public $port;
4646

47+
/**
48+
* Service protocol.
49+
*
50+
* @var int
51+
*/
52+
public $protocol;
53+
4754
/**
4855
* Server encryption.
4956
* Supported: none, ssl or tls.
@@ -431,7 +438,7 @@ protected function getOptions() {
431438
* @return string
432439
*/
433440
protected function getAddress() {
434-
$address = "{".$this->host.":".$this->port."/imap";
441+
$address = "{".$this->host.":".$this->port."/".($this->protocol ? $this->protocol : 'imap');
435442
if (!$this->validate_cert) {
436443
$address .= '/novalidate-cert';
437444
}

src/config/imap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'default' => [// account identifier
3737
'host' => env('IMAP_HOST', 'localhost'),
3838
'port' => env('IMAP_PORT', 993),
39+
'protocol' => env('IMAP_PROTOCOL', 'imap'), //might also use imap, pop3 or nntp (untested)
3940
'encryption' => env('IMAP_ENCRYPTION', 'ssl'), // Supported: false, 'ssl', 'tls'
4041
'validate_cert' => env('IMAP_VALIDATE_CERT', true),
4142
'username' => env('IMAP_USERNAME', '[email protected]'),

0 commit comments

Comments
 (0)