PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | back/Libraries/Imap2/Connection.php +15 -3 10.2.2 → 11.1.0 View file →
@@ -14,8 +14,13 @@
14 14 use AcyMailing\Libraries\Imap2\Roundcube\ImapClient;
15 15
16 16 class Connection
17 17 {
18 + const DEFAULT_MAILBOX = 'INBOX';
19 + const DEFAULT_MAILBOX_GMAIL = '[Gmail]/All Mail';
20 + const DEFAULT_OUTLOOK = 'Inbox';
21 + const GMAIL_TRASH_MAILBOX = '[Gmail]/Trash';
22 +
18 23 protected $mailbox;
19 24 protected $user;
20 25 protected $password;
21 26 protected $flags;
@@ -142,11 +147,18 @@
142 147 }
143 148
144 149 if (empty($this->currentMailbox)) {
145 150 $mailboxes = $this->client->listMailboxes('', '*');
146 - if (in_array('INBOX', $mailboxes)) {
147 - $this->currentMailbox = 'INBOX';
148 - $this->mailbox .= 'INBOX';
151 +
152 + if (in_array(self::DEFAULT_MAILBOX_GMAIL, $mailboxes)) {
153 + $this->currentMailbox = self::DEFAULT_MAILBOX_GMAIL;
154 + $this->mailbox .= self::DEFAULT_MAILBOX_GMAIL;
155 + } elseif (in_array(self::DEFAULT_OUTLOOK, $mailboxes)) {
156 + $this->currentMailbox = self::DEFAULT_OUTLOOK;
157 + $this->mailbox .= self::DEFAULT_OUTLOOK;
158 + } elseif (in_array(self::DEFAULT_MAILBOX, $mailboxes)) {
159 + $this->currentMailbox = self::DEFAULT_MAILBOX;
160 + $this->mailbox .= self::DEFAULT_MAILBOX;
149 161 }
150 162 }
151 163
152 164 $this->rewriteMailbox();