Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
helper.php
1<?php
2
3namespace Bitrix\Mail;
4
9
10class Helper
11{
12 const SYNC_TIMEOUT = 300;
13
15 {
16 $userMailboxes = \Bitrix\Mail\MailboxTable::getList([
17 'select' => [
18 'ID'
19 ],
20 'filter' => [
21 '=ACTIVE' => 'Y',
22 '=SERVER_TYPE' => 'imap',
23 ],
24 ])->fetchAll();
25
26 if (empty($userMailboxes))
27 {
28 return '';
29 }
30
31 $numberOfUnSynchronizedMailboxes = count($userMailboxes);
32
33 foreach ($userMailboxes as $mailbox)
34 {
35 $mailboxID = $mailbox['ID'];
36 $mailboxHelper = Helper\Mailbox::createInstance($mailboxID, false);
37 if (empty($mailboxHelper))
38 {
39 $numberOfUnSynchronizedMailboxes--;
40 continue;
41 }
42
43 $keyRow = [
44 'MAILBOX_ID' => $mailboxID,
45 'ENTITY_TYPE' => 'MAILBOX',
46 'ENTITY_ID' => $mailboxID,
47 'PROPERTY_NAME' => 'SYNC_FIRST_DAY',
48 ];
49
50 $filter = [
51 '=MAILBOX_ID' => $keyRow['MAILBOX_ID'],
52 '=ENTITY_TYPE' => $keyRow['ENTITY_TYPE'],
53 '=ENTITY_ID' => $keyRow['ENTITY_ID'],
54 '=PROPERTY_NAME' => $keyRow['PROPERTY_NAME'],
55 ];
56
57 $startValue = 'started_for_id_'.$mailboxID;
58
59 if(\Bitrix\Mail\Internals\MailEntityOptionsTable::getCount($filter))
60 {
61 if(Internals\MailEntityOptionsTable::getList([
62 'select' => [
63 'VALUE',
64 ],
65 'filter' => $filter,
66 ])->fetchAll()[0]['VALUE'] !== 'completed')
67 {
68 \Bitrix\Mail\Internals\MailEntityOptionsTable::update(
69 $keyRow,
70 ['VALUE' => $startValue]
71 );
72
73 $synchronizationSuccess = $mailboxHelper->syncFirstDay();
74
75 if($synchronizationSuccess)
76 {
77 \Bitrix\Mail\Internals\MailEntityOptionsTable::update(
78 $keyRow,
79 ['VALUE' => 'completed']
80 );
81 $numberOfUnSynchronizedMailboxes--;
82 }
83 }
84 else
85 {
86 $numberOfUnSynchronizedMailboxes--;
87 }
88 }
89 else
90 {
91 $fields = $keyRow;
92 $fields['VALUE'] = $startValue;
93 \Bitrix\Mail\Internals\MailEntityOptionsTable::add(
94 $fields
95 );
96 $synchronizationSuccess = $mailboxHelper->syncFirstDay();
97
98 if($synchronizationSuccess)
99 {
100 \Bitrix\Mail\Internals\MailEntityOptionsTable::update(
101 $keyRow,
102 ['VALUE' => 'completed']
103 );
104 $numberOfUnSynchronizedMailboxes--;
105 }
106 }
107 }
108
109 if($numberOfUnSynchronizedMailboxes === 0)
110 {
111 return '';
112 }
113 else
114 {
115 return 'Bitrix\Mail\Helper::syncAllDirsInMailboxForTheFirstSyncDayAgent();';
116 }
117 }
118
119 public static function syncMailboxAgent($id)
120 {
121 $mailboxHelper = Helper\Mailbox::createInstance($id, false);
122
123 if (empty($mailboxHelper))
124 {
125 return '';
126 }
127
128 $mailbox = $mailboxHelper->getMailbox();
129
130 if ($mailbox['OPTIONS']['next_sync'] <= time())
131 {
132 $mailboxHelper->sync();
133
134 $mailbox = $mailboxHelper->getMailbox();
135 }
136
137 global $pPERIOD;
138
139 $pPERIOD = min($pPERIOD, max($mailbox['OPTIONS']['next_sync'] - time(), 60));
140
141 return sprintf('Bitrix\Mail\Helper::syncMailboxAgent(%u);', $id);
142 }
143
144 public static function syncOutgoingAgent($id)
145 {
146 $mailboxHelper = Helper\Mailbox::createInstance($id, false);
147
148 $result = empty($mailboxHelper) ? false : $mailboxHelper->syncOutgoing();
149
150 return '';
151 }
152
153 public static function markOldMessagesAgent()
154 {
155 $userMailboxes = \Bitrix\Mail\MailboxTable::getList([
156 'select' => [
157 'ID'
158 ],
159 'filter' => [
160 '=ACTIVE' => 'Y',
161 '=SERVER_TYPE' => 'imap',
162 ],
163 ])->fetchAll();
164
165 if (empty($userMailboxes))
166 {
167 return '';
168 }
169
170 $numberOfUnSynchronizedMailboxes = count($userMailboxes);
171
172 foreach ($userMailboxes as $mailbox)
173 {
174 $mailboxID = $mailbox['ID'];
175 $mailboxHelper = Helper\Mailbox::createInstance($mailboxID, false);
176 if (empty($mailboxHelper))
177 {
178 $numberOfUnSynchronizedMailboxes--;
179 continue;
180 }
181
182 $keyRow = [
183 'MAILBOX_ID' => $mailboxID,
184 'ENTITY_TYPE' => 'MAILBOX',
185 'ENTITY_ID' => $mailboxID,
186 'PROPERTY_NAME' => 'SYNC_IS_OLD_STATUS',
187 ];
188
189 $filter = [
190 '=MAILBOX_ID' => $keyRow['MAILBOX_ID'],
191 '=ENTITY_TYPE' => $keyRow['ENTITY_TYPE'],
192 '=ENTITY_ID' => $keyRow['ENTITY_ID'],
193 '=PROPERTY_NAME' => $keyRow['PROPERTY_NAME'],
194 ];
195
196 $startValue = 'started_for_id_'.$mailboxID;
197
198 if(\Bitrix\Mail\Internals\MailEntityOptionsTable::getCount($filter))
199 {
200 if(Internals\MailEntityOptionsTable::getList([
201 'select' => [
202 'VALUE',
203 ],
204 'filter' => $filter,
205 ])->fetchAll()[0]['VALUE'] !== 'completed')
206 {
207 \Bitrix\Mail\Internals\MailEntityOptionsTable::update(
208 $keyRow,
209 ['VALUE' => $startValue]
210 );
211
212 $synchronizationSuccess = $mailboxHelper->resyncIsOldStatus();
213
214 if($synchronizationSuccess)
215 {
216 \Bitrix\Mail\Internals\MailEntityOptionsTable::update(
217 $keyRow,
218 ['VALUE' => 'completed']
219 );
220 $numberOfUnSynchronizedMailboxes--;
221 }
222 }
223 else
224 {
225 $numberOfUnSynchronizedMailboxes--;
226 }
227 }
228 else
229 {
230 $fields = $keyRow;
231 $fields['VALUE'] = $startValue;
232 \Bitrix\Mail\Internals\MailEntityOptionsTable::add(
233 $fields
234 );
235 $synchronizationSuccess = $mailboxHelper->resyncIsOldStatus();
236
237 if($synchronizationSuccess)
238 {
239 \Bitrix\Mail\Internals\MailEntityOptionsTable::update(
240 $keyRow,
241 ['VALUE' => 'completed']
242 );
243 $numberOfUnSynchronizedMailboxes--;
244 }
245 }
246 }
247
248 if($numberOfUnSynchronizedMailboxes === 0)
249 {
250 return '';
251 }
252 else
253 {
254 return 'Bitrix\Mail\Helper::markOldMessagesAgent();';
255 }
256 }
257
258 public static function cleanupMailboxAgent($id)
259 {
260 $mailboxHelper = Helper\Mailbox::rawInstance($id, false);
261
262 if (empty($mailboxHelper))
263 {
264 return '';
265 }
266
267 $mailboxHelper->setCheckpoint();
268
270 [
271 '=MAILBOX_ID' => $id,
272 '=IS_OLD' => 'R',
273 ]
274 );
275
276 $stage1 = $mailboxHelper->dismissOldMessages();
277 $stage2 = $mailboxHelper->dismissDeletedUidMessages();
278 $stage3 = $mailboxHelper->cleanup();
279
280 global $pPERIOD;
281
282 $pPERIOD = min($pPERIOD, max($stage1 && $stage2 && $stage3 ? $pPERIOD : 600, 60));
283
284 if ($pPERIOD === null)
285 {
286 $pPERIOD = 60;
287 }
288
289 return sprintf('Bitrix\Mail\Helper::cleanupMailboxAgent(%u);', $id);
290 }
291
295 public static function resortTreeAgent($id)
296 {
297 $mailboxHelper = Helper\Mailbox::createInstance($id, false);
298
299 $result = empty($mailboxHelper) ? false : $mailboxHelper->resortTree();
300
301 return '';
302 }
303
304 public static function deleteMailboxAgent($id)
305 {
306 return \CMailbox::delete($id) ? '' : sprintf('Bitrix\Mail\Helper::deleteMailboxAgent(%u);', $id);
307 }
308
309 public static function resyncDomainUsersAgent()
310 {
311 $res = MailServicesTable::getList(array(
312 'filter' => array(
313 '=ACTIVE' => 'Y',
314 '@SERVICE_TYPE' => array('domain', 'crdomain'),
315 )
316 ));
317 while ($item = $res->fetch())
318 {
319 if ($item['SERVICE_TYPE'] == 'domain')
320 {
321 $lockName = sprintf('domain_users_sync_lock_%u', $item['ID']);
322 $syncLock = \Bitrix\Main\Config\Option::get('mail', $lockName, 0);
323
324 if ($syncLock < time()-3600)
325 {
326 \Bitrix\Main\Config\Option::set('mail', $lockName, time());
327 \CMailDomain2::getDomainUsers($item['TOKEN'], $item['SERVER'], $error, true);
328 \Bitrix\Main\Config\Option::set('mail', $lockName, 0);
329 }
330 }
331 else if ($item['SERVICE_TYPE'] == 'crdomain')
332 {
333 \CControllerClient::executeEvent('OnMailControllerResyncMemberUsers', array('DOMAIN' => $item['SERVER']));
334 }
335 }
336
337 return 'Bitrix\Mail\Helper::resyncDomainUsersAgent();';
338 }
339
340 public static function syncMailbox($id, &$error)
341 {
342 $mailboxHelper = Helper\Mailbox::createInstance($id, false);
343
344 return empty($mailboxHelper) ? false : $mailboxHelper->sync();
345 }
346
347 public static function listImapDirs($mailbox, &$error = [], &$errors = null)
348 {
349 $error = null;
350 $errors = null;
351
352 $client = static::createClient($mailbox);
353
354 $list = $client->listMailboxes('*', $error, true);
355 $errors = $client->getErrors();
356
357 if ($list === false)
358 return false;
359
360 $k = count($list);
361 for ($i = 0; $i < $k; $i++)
362 {
363 $item = $list[$i];
364
365 $list[$i] = array(
366 'path' => $item['name'],
367 'name' => $item['title'],
368 'level' => $item['level'],
369 'disabled' => (bool) preg_grep('/^ \x5c Noselect $/ix', $item['flags']),
370 'income' => mb_strtolower($item['name']) == 'inbox',
371 'outcome' => (bool) preg_grep('/^ \x5c Sent $/ix', $item['flags']),
372 );
373 }
374
375 return $list;
376 }
377
378 public static function getImapUIDsForSpecificDay($mailboxID, $dirPath = 'inbox', $internalDate)
379 {
380 $error = null;
381 $errors = null;
382
383 $mailbox = Helper\Mailbox::prepareMailbox([
384 '=ID'=>$mailboxID,
385 '=ACTIVE'=>'Y'
386 ]);
387
388 $client = static::createClient($mailbox);
389
390 $result = $client->getUIDsForSpecificDay($dirPath, $internalDate);
391
392 return $result;
393 }
394
395 public static function getLastDeletedOldMessageInternaldate($mailboxId,$dirPath,$filter = [])
396 {
397 $firstSyncUID = MailMessageUidTable::getList(
398 [
399 'select' => [
400 'INTERNALDATE'
401 ],
402 'filter' => array_merge(
403 [
404 '!=IS_OLD' => 'D',
405 '=MESSAGE_ID' => 0,
406 '=MAILBOX_ID' => $mailboxId,
407 '=DIR_MD5' => md5($dirPath),
408 ],
409 $filter
410 ),
411 'order' => [
412 'INTERNALDATE' => 'DESC',
413 ],
414 'limit' => 1,
415 ]
416 )->fetchAll();
417
418 if(isset($firstSyncUID[0]['INTERNALDATE']))
419 {
420 return $firstSyncUID[0]['INTERNALDATE'];
421 }
422 else
423 {
424 return false;
425 }
426 }
427
428 public static function getStartInternalDateForDir(
429 $mailboxId,
430 $dirPath,
431 $order = 'ASC',
432 $filter =
433 [
434 '!=MESSAGE_UID.IS_OLD' => 'Y',
435 '==MESSAGE_UID.DELETE_TIME' => 0,
436 '!@MESSAGE_UID.IS_OLD' => ['M', 'R'],
437 ]
438 )
439 {
440 $firstSyncUID = MailMessageTable::getList(
441 [
442 'runtime' => [
443 new ORM\Fields\Relations\Reference(
444 'MESSAGE_UID', MailMessageUidTable::class, [
445 '=this.MAILBOX_ID' => 'ref.MAILBOX_ID',
446 '=this.ID' => 'ref.MESSAGE_ID',
447 ], [
448 'join_type' => 'INNER',
449 ]
450 ),
451 ],
452 'select' => [
453 'INTERNALDATE' => 'MESSAGE_UID.INTERNALDATE',
454 ],
455 'filter' => array_merge(
456 [
457 '=MAILBOX_ID' => $mailboxId,
458 '=MESSAGE_UID.DIR_MD5' => md5(Emoji::encode($dirPath)),
459 ],
460 $filter
461 ),
462 'order' => [
463 'FIELD_DATE' => $order,
464 ],
465 'limit' => 1,
466 ]
467 )->fetchAll();
468
469 if(isset($firstSyncUID[0]['INTERNALDATE']))
470 {
471 return $firstSyncUID[0]['INTERNALDATE'];
472 }
473 else
474 {
475 return false;
476 }
477 }
478
479 public static function getImapUnseenSyncForDir($mailbox = null, $dirPath ,$mailboxID = null)
480 {
481 //for testing via mailbox id
482 if(is_int($mailboxID) && is_null($mailbox))
483 {
484 $mailbox = Helper\Mailbox::prepareMailbox([
485 '=ID'=>$mailboxID,
486 '=ACTIVE'=>'Y'
487 ]);
488 }
489
490 $startInternalDate = static::getStartInternalDateForDir($mailbox['ID'],$dirPath);
491
492 if($startInternalDate)
493 {
494 $error = [];
495 $errors = [];
496 return static::getImapUnseen($mailbox, $dirPath,$error,$errors, $startInternalDate);
497 }
498 else
499 {
500 return 0;
501 }
502
503 return false;
504 }
505
506 public static function setMailboxUnseenCounter($mailboxId,$count)
507 {
508 $keyRow = [
509 'MAILBOX_ID' => $mailboxId,
510 'ENTITY_TYPE' => 'MAILBOX',
511 'ENTITY_ID' => $mailboxId
512 ];
513
514 $filter = [
515 '=MAILBOX_ID' => $keyRow['MAILBOX_ID'],
516 '=ENTITY_TYPE' => $keyRow['ENTITY_TYPE'],
517 '=ENTITY_ID' => $keyRow['ENTITY_ID']
518 ];
519
520 $rowValue = ['VALUE' => $count];
521
522 if(Internals\MailCounterTable::getCount($filter))
523 {
524 Internals\MailCounterTable::update($keyRow, $rowValue);
525 }
526 else
527 {
528 Internals\MailCounterTable::add(array_merge($rowValue,$keyRow));
529 };
530
531 \CPullWatch::addToStack(
532 'mail_mailbox_' .$mailboxId,
533 [
534 'module_id' => 'mail',
535 'params' => [
536 'mailboxId' => $mailboxId,
537 ],
538 'command' => 'counters_updated',
539 ]
540 );
541 \Bitrix\Pull\Event::send();
542 }
543
544 public static function updateMailboxUnseenCounter($mailboxId)
545 {
546 $count = Internals\MailCounterTable::getList([
547 'filter' => [
548 'ENTITY_TYPE' => 'DIR',
549 'MAILBOX_ID' => $mailboxId,
550 ],
551 'runtime' => [
552 new \Bitrix\Main\Entity\ExpressionField('COUNT', 'SUM(%s)', 'VALUE'),
553 ],
554 'select' => [
555 'COUNT'
556 ]
557 ])->fetchAll();
558
559 if(!is_null($count[0]["COUNT"]))
560 {
561 static::setMailboxUnseenCounter($mailboxId,(int)$count[0]["COUNT"]);
562 }
563 }
564
565 public static function updateMailCounters($mailbox)
566 {
567 $mailboxId = $mailbox['ID'];
568
569 $directoryHelper = new Helper\MailboxDirectoryHelper($mailboxId);
570 $syncDirs = $directoryHelper->getSyncDirs();
571
572 $totalCount = 0;
573
574 foreach ($syncDirs as $dir)
575 {
576 if($dir->isInvisibleToCounters())
577 {
578 continue;
579 }
580
581 $dirPath = $dir->getPath();
582
583 //since we work with internalDate inside the method
584 \CTimeZone::Disable();
585 $dirCount = static::getImapUnseenSyncForDir($mailbox,$dirPath);
586 \CTimeZone::Enable();
587
588 if($dirCount !== false)
589 {
590 $totalCount += $dirCount;
591
592 $keyRow = [
593 'MAILBOX_ID' => $mailboxId,
594 'ENTITY_TYPE' => 'DIR',
595 'ENTITY_ID'=>$dir->getId()
596 ];
597
598 $filter = [
599 '=MAILBOX_ID' => $keyRow['MAILBOX_ID'],
600 '=ENTITY_TYPE' => $keyRow['ENTITY_TYPE'],
601 '=ENTITY_ID' => $keyRow['ENTITY_ID']
602 ];
603
604 $rowValue = ['VALUE' => $dirCount];
605
606 if(Internals\MailCounterTable::getCount($filter))
607 {
608 Internals\MailCounterTable::update($keyRow, $rowValue);
609 }
610 else
611 {
612 Internals\MailCounterTable::add(array_merge($rowValue,$keyRow));
613 };
614 }
615 }
616
617 return $totalCount;
618 }
619
620 public static function getImapUnseen($mailbox, $dirPath = 'inbox', &$error = [], &$errors = null, $startInternalDate = null)
621 {
622 $error = null;
623 $errors = null;
624
625 $client = static::createClient($mailbox);
626
627 $result = $client->getUnseen($dirPath, $error, $startInternalDate);
628 $errors = $client->getErrors();
629
630 return $result;
631 }
632
633 public static function addImapMessage($id, $data, &$error)
634 {
635 $error = null;
636
637 $id = (int) (is_array($id) ? $id['ID'] : $id);
638
639 $mailbox = MailboxTable::getList(array(
640 'filter' => array('ID' => $id, 'ACTIVE' => 'Y'),
641 'select' => array('*', 'LANG_CHARSET' => 'SITE.CULTURE.CHARSET')
642 ))->fetch();
643
644 if (empty($mailbox))
645 return;
646
647 if (!in_array($mailbox['SERVER_TYPE'], array('imap', 'controller', 'domain', 'crdomain')))
648 return;
649
650 if (in_array($mailbox['SERVER_TYPE'], array('controller', 'crdomain')))
651 {
652 // @TODO: request controller
653 $result = \CMailDomain2::getImapData();
654
655 $mailbox['SERVER'] = $result['server'];
656 $mailbox['PORT'] = $result['port'];
657 $mailbox['USE_TLS'] = $result['secure'];
658 }
659 elseif ($mailbox['SERVER_TYPE'] == 'domain')
660 {
661 $result = \CMailDomain2::getImapData();
662
663 $mailbox['SERVER'] = $result['server'];
664 $mailbox['PORT'] = $result['port'];
665 $mailbox['USE_TLS'] = $result['secure'];
666 }
667
668 $client = static::createClient($mailbox, $mailbox['LANG_CHARSET'] ?: $mailbox['CHARSET']);
669
670 $dir = MailboxDirectory::fetchOneOutcome($mailbox['ID']);
671 $path = $dir ? $dir->getPath() : 'INBOX';
672
673 return $client->addMessage($path, $data, $error);
674 }
675
676 public static function updateImapMessage($userId, $hash, $data, &$error)
677 {
678 $error = null;
679
680 $res = MailMessageUidTable::getList(array(
681 'select' => array(
682 'ID', 'MAILBOX_ID', 'IS_SEEN',
683 'MAILBOX_USER_ID' => 'MAILBOX.USER_ID',
684 'MAILBOX_OPTIONS' => 'MAILBOX.OPTIONS',
685 ),
686 'filter' => array(
687 '=HEADER_MD5' => $hash,
688 '==DELETE_TIME' => 0,
689 ),
690 ));
691
692 while ($item = $res->fetch())
693 {
694 $isOwner = $item['MAILBOX_USER_ID'] == $userId;
695 $isPublic = in_array('crm_public_bind', (array) $item['MAILBOX_OPTIONS']['flags']);
696 $inQueue = in_array($userId, (array) $item['MAILBOX_OPTIONS']['crm_lead_resp']);
697 if (!$isOwner && !$isPublic && !$inQueue)
698 {
699 continue;
700 }
701
702 if (in_array($item['IS_SEEN'], array('Y', 'S')) != $data['seen'])
703 {
704 MailMessageUidTable::update(
705 array(
706 'ID' => $item['ID'],
707 'MAILBOX_ID' => $item['MAILBOX_ID'],
708 ),
709 array(
710 'IS_SEEN' => $data['seen'] ? 'S' : 'U',
711 )
712 );
713 }
714 }
715 }
716
717 private static function createClient($mailbox, $langCharset = null)
718 {
719 return new Imap(
720 $mailbox['SERVER'], $mailbox['PORT'],
721 $mailbox['USE_TLS'] == 'Y' || $mailbox['USE_TLS'] == 'S',
722 $mailbox['USE_TLS'] == 'Y',
723 $mailbox['LOGIN'], $mailbox['PASSWORD'],
724 $langCharset ? $langCharset : LANG_CHARSET
725 );
726 }
727}
728
730{
731
732 public function initSettings()
733 {
734 parent::initSettings();
735
736 $this->settingServerMsSmtp = false;
737 $this->settingMailFillToEmail = false;
738 $this->settingMailConvertMailHeader = true;
739 $this->settingConvertNewLineUnixToWindows = true;
740 $this->useBlacklist = false;
741 }
742
743 public static function getMailEol()
744 {
745 return "\r\n";
746 }
747
748 public function __toString()
749 {
750 return sprintf("%s\r\n\r\n%s", $this->getHeaders(), $this->getBody());
751 }
752
756 public static function overwriteMessageHeaders(Main\Mail\Mail $message, array $headers)
757 {
758 foreach ($headers as $name => $value)
759 {
760 $message->headers[$name] = $value;
761 }
762 }
763
764}
static overwriteMessageHeaders(Main\Mail\Mail $message, array $headers)
Definition helper.php:756
static resortTreeAgent($id)
Definition helper.php:295
static syncMailboxAgent($id)
Definition helper.php:119
static resyncDomainUsersAgent()
Definition helper.php:309
static markOldMessagesAgent()
Definition helper.php:153
static syncMailbox($id, &$error)
Definition helper.php:340
static updateImapMessage($userId, $hash, $data, &$error)
Definition helper.php:676
static getLastDeletedOldMessageInternaldate($mailboxId, $dirPath, $filter=[])
Definition helper.php:395
static getStartInternalDateForDir( $mailboxId, $dirPath, $order='ASC', $filter=['!=MESSAGE_UID.IS_OLD'=> 'Y', '==MESSAGE_UID.DELETE_TIME'=> 0, '! @MESSAGE_UID.IS_OLD'=>['M', 'R'],])
Definition helper.php:428
static setMailboxUnseenCounter($mailboxId, $count)
Definition helper.php:506
static deleteMailboxAgent($id)
Definition helper.php:304
static updateMailCounters($mailbox)
Definition helper.php:565
static addImapMessage($id, $data, &$error)
Definition helper.php:633
static updateMailboxUnseenCounter($mailboxId)
Definition helper.php:544
static syncOutgoingAgent($id)
Definition helper.php:144
static getImapUnseen($mailbox, $dirPath='inbox', &$error=[], &$errors=null, $startInternalDate=null)
Definition helper.php:620
static syncAllDirsInMailboxForTheFirstSyncDayAgent()
Definition helper.php:14
static listImapDirs($mailbox, &$error=[], &$errors=null)
Definition helper.php:347
static cleanupMailboxAgent($id)
Definition helper.php:258
static getImapUnseenSyncForDir($mailbox=null, $dirPath, $mailboxID=null)
Definition helper.php:479
static getImapUIDsForSpecificDay($mailboxID, $dirPath='inbox', $internalDate)
Definition helper.php:378
static deleteList(array $filter, array $messages=[], $limit=false)
static fetchOneOutcome($mailboxId)
static getCount($filter=array(), array $cache=array())