-
Notifications
You must be signed in to change notification settings - Fork 0
/
class.settingimapbounce.php
202 lines (180 loc) · 3.96 KB
/
class.settingimapbounce.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?php
/**
* ImapBounce - PHP parse bounced emails.
* PHP Version 5
* @package SettingImapBounce
* @link https://github.com/archieDeveloper/ImapBounce/ The ImapBounce GitHub project
* @author Arkady Kozhedub (archie) <arkadij.ok@gmail.com>
* @copyright 2015, Arkady Kozhedub
* @license GPL licensed
*/
class SettingImapBounce
{
/**
* Mailbox host (default - localhost)
* @var string
*/
private $_mailbox_host = 'localhost';
/**
* Mailbox port (default - 143)
* @var integer
*/
private $_mailbox_port = 143;
/**
* Mailbox protocols (default - ['imap'])
* @var array
*/
private $_mailbox_protocols = ['imap'];
/**
* Mailbox type (default - INBOX)
* @var string
*/
private $_mailbox_type = 'INBOX';
/**
* Mailbox username
* @var string
*/
private $_mailbox_user = '';
/**
* Mailbox password
* @var string
*/
private $_mailbox_password = '';
/**
* SMTP RFC standard line ending.
*/
const CRLF = "\r\n";
/**
* Setting mailbox
* @param array $options setting authorization
* @access public
* @return void
*/
public function set(array $options)
{
if (isset($options) && is_array($options)) {
foreach ($options as $field => $value) {
$methodName = 'setMailbox'.ucfirst($field);
if(method_exists($this, $methodName)) {
$this->$methodName($value);
} else {
echo 'Не существующая настройка: '.$field, self::CRLF;
}
}
}
}
/**
* Get mailbox host
* @access public
* @return string
*/
public function getMailboxHost()
{
return $this->_mailbox_host;
}
/**
* Get mailbox port
* @access public
* @return integer
*/
public function getMailboxPort()
{
return $this->_mailbox_port;
}
/**
* Get mailbox protocols
* @access public
* @return array
*/
public function getMailboxProtocols()
{
return $this->_mailbox_protocols;
}
/**
* Get mailbox type
* @access public
* @return string
*/
public function getMailboxType()
{
return $this->_mailbox_type;
}
/**
* Get mailbox user
* @access public
* @return string
*/
public function getMailboxUser()
{
return $this->_mailbox_user;
}
/**
* Get mailbox password
* @access public
* @return string
*/
public function getMailboxPassword()
{
return $this->_mailbox_password;
}
/**
* Set mailbox host
* @access public
* @param string $host
* @return void
*/
public function setMailboxHost($host)
{
$this->_mailbox_host = (string)$host;
}
/**
* Set mailbox port
* @access public
* @param integer $port
* @return void
*/
public function setMailboxPort($port)
{
$this->_mailbox_port = (integer)$port;
}
/**
* Set mailbox protocols
* @access public
* @param array $protocols
* @return void
*/
public function setMailboxProtocols($protocols)
{
$this->_mailbox_protocols = (array)$protocols;
}
/**
* Set mailbox type
* @access public
* @param string $type
* @return void
*/
public function setMailboxType($type)
{
$this->_mailbox_type = (string)$type;
}
/**
* Set mailbox user
* @access public
* @param string $user
* @return void
*/
public function setMailboxUser($user)
{
$this->_mailbox_user = (string)$user;
}
/**
* Set mailbox password
* @access public
* @param string $password
* @return void
*/
public function setMailboxPassword($password)
{
$this->_mailbox_password = (string)$password;
}
}