PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 10.0.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v10.0.1
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
acymailing / vendor / javanile / php-imap2 / bootstrap.php

bootstrap.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 10.0.1, at vendor/javanile/php-imap2/bootstrap.php

1,355 lines 35.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3
4 use Javanile\Imap2\Connection;
5 use Javanile\Imap2\Errors;
6 use Javanile\Imap2\Mail;
7 use Javanile\Imap2\Mailbox;
8 use Javanile\Imap2\Message;
9 use Javanile\Imap2\Thread;
10 use Javanile\Imap2\Polyfill;
11 use Javanile\Imap2\Timeout;
12 use Javanile\Imap2\Functions;
13
14 define('IMAP2_CHARSET', 'UTF-8');
15 define('IMAP2_RETROFIT_MODE', function_exists('imap_open'));
16
17 if (!defined('NIL')) {
18 define('NIL', 0);
19 }
20 if (!defined('OP_DEBUG')) {
21 define('OP_DEBUG', 1);
22 }
23 if (!defined('OP_READONLY')) {
24 define('OP_READONLY', 2);
25 }
26 if (!defined('OP_ANONYMOUS')) {
27 define('OP_ANONYMOUS', 4);
28 }
29 if (!defined('OP_SHORTCACHE')) {
30 define('OP_SHORTCACHE', 8);
31 }
32 if (!defined('OP_SILENT')) {
33 define('OP_SILENT', 16);
34 }
35 if (!defined('OP_PROTOTYPE')) {
36 define('OP_PROTOTYPE', 32);
37 }
38 if (!defined('OP_HALFOPEN')) {
39 define('OP_HALFOPEN', 64);
40 }
41 if (!defined('OP_EXPUNGE')) {
42 define('OP_EXPUNGE', 128);
43 }
44 if (!defined('OP_SECURE')) {
45 define('OP_SECURE', 256);
46 }
47 if (!defined('OP_XOAUTH2')) {
48 define('OP_XOAUTH2', 512);
49 }
50 if (!defined('CL_EXPUNGE')) {
51 define('CL_EXPUNGE', 32768);
52 }
53 if (!defined('FT_UID')) {
54 define('FT_UID', 1);
55 }
56 if (!defined('FT_PEEK')) {
57 define('FT_PEEK', 2);
58 }
59 if (!defined('FT_NOT')) {
60 define('FT_NOT', 4);
61 }
62 if (!defined('FT_INTERNAL')) {
63 define('FT_INTERNAL', 8);
64 }
65 if (!defined('FT_PREFETCHTEXT')) {
66 define('FT_PREFETCHTEXT', 32);
67 }
68 if (!defined('ST_UID')) {
69 define('ST_UID', 1);
70 }
71 if (!defined('ST_SILENT')) {
72 define('ST_SILENT', 2);
73 }
74 if (!defined('ST_SET')) {
75 define('ST_SET', 4);
76 }
77 if (!defined('CP_UID')) {
78 define('CP_UID', 1);
79 }
80 if (!defined('CP_MOVE')) {
81 define('CP_MOVE', 2);
82 }
83 if (!defined('SE_UID')) {
84 define('SE_UID', 1);
85 }
86 if (!defined('SE_FREE')) {
87 define('SE_FREE', 2);
88 }
89 if (!defined('SE_NOPREFETCH')) {
90 define('SE_NOPREFETCH', 4);
91 }
92 if (!defined('SO_FREE')) {
93 define('SO_FREE', 8);
94 }
95 if (!defined('SO_NOSERVER')) {
96 define('SO_NOSERVER', 16);
97 }
98 if (!defined('SA_MESSAGES')) {
99 define('SA_MESSAGES', 1);
100 }
101 if (!defined('SA_RECENT')) {
102 define('SA_RECENT', 2);
103 }
104 if (!defined('SA_UNSEEN')) {
105 define('SA_UNSEEN', 4);
106 }
107 if (!defined('SA_UIDNEXT')) {
108 define('SA_UIDNEXT', 8);
109 }
110 if (!defined('SA_UIDVALIDITY')) {
111 define('SA_UIDVALIDITY', 16);
112 }
113 if (!defined('SA_ALL')) {
114 define('SA_ALL', 31);
115 }
116 if (!defined('LATT_NOINFERIORS')) {
117 define('LATT_NOINFERIORS', 1);
118 }
119 if (!defined('LATT_NOSELECT')) {
120 define('LATT_NOSELECT', 2);
121 }
122 if (!defined('LATT_MARKED')) {
123 define('LATT_MARKED', 4);
124 }
125 if (!defined('LATT_UNMARKED')) {
126 define('LATT_UNMARKED', 8);
127 }
128 if (!defined('LATT_REFERRAL')) {
129 define('LATT_REFERRAL', 16);
130 }
131 if (!defined('LATT_HASCHILDREN')) {
132 define('LATT_HASCHILDREN', 32);
133 }
134 if (!defined('LATT_HASNOCHILDREN')) {
135 define('LATT_HASNOCHILDREN', 64);
136 }
137 if (!defined('SORTDATE')) {
138 define('SORTDATE', 0);
139 }
140 if (!defined('SORTARRIVAL')) {
141 define('SORTARRIVAL', 1);
142 }
143 if (!defined('SORTFROM')) {
144 define('SORTFROM', 2);
145 }
146 if (!defined('SORTSUBJECT')) {
147 define('SORTSUBJECT', 3);
148 }
149 if (!defined('SORTTO')) {
150 define('SORTTO', 4);
151 }
152 if (!defined('SORTCC')) {
153 define('SORTCC', 5);
154 }
155 if (!defined('SORTSIZE')) {
156 define('SORTSIZE', 6);
157 }
158 if (!defined('TYPETEXT')) {
159 define('TYPETEXT', 0);
160 }
161 if (!defined('TYPEMULTIPART')) {
162 define('TYPEMULTIPART', 1);
163 }
164 if (!defined('TYPEMESSAGE')) {
165 define('TYPEMESSAGE', 2);
166 }
167 if (!defined('TYPEAPPLICATION')) {
168 define('TYPEAPPLICATION', 3);
169 }
170 if (!defined('TYPEAUDIO')) {
171 define('TYPEAUDIO', 4);
172 }
173 if (!defined('TYPEIMAGE')) {
174 define('TYPEIMAGE', 5);
175 }
176 if (!defined('TYPEVIDEO')) {
177 define('TYPEVIDEO', 6);
178 }
179 if (!defined('TYPEMODEL')) {
180 define('TYPEMODEL', 7);
181 }
182 if (!defined('TYPEOTHER')) {
183 define('TYPEOTHER', 8);
184 }
185 if (!defined('ENC7BIT')) {
186 define('ENC7BIT', 0);
187 }
188 if (!defined('ENC8BIT')) {
189 define('ENC8BIT', 1);
190 }
191 if (!defined('ENCBINARY')) {
192 define('ENCBINARY', 2);
193 }
194 if (!defined('ENCBASE64')) {
195 define('ENCBASE64', 3);
196 }
197 if (!defined('ENCQUOTEDPRINTABLE')) {
198 define('ENCQUOTEDPRINTABLE', 4);
199 }
200 if (!defined('ENCOTHER')) {
201 define('ENCOTHER', 5);
202 }
203 if (!defined('IMAP_OPENTIMEOUT')) {
204 define('IMAP_OPENTIMEOUT', 1);
205 }
206 if (!defined('IMAP_READTIMEOUT')) {
207 define('IMAP_READTIMEOUT', 2);
208 }
209 if (!defined('IMAP_WRITETIMEOUT')) {
210 define('IMAP_WRITETIMEOUT', 3);
211 }
212 if (!defined('IMAP_CLOSETIMEOUT')) {
213 define('IMAP_CLOSETIMEOUT', 4);
214 }
215 if (!defined('IMAP_GC_ELT')) {
216 define('IMAP_GC_ELT', 1);
217 }
218 if (!defined('IMAP_GC_ENV')) {
219 define('IMAP_GC_ENV', 2);
220 }
221 if (!defined('IMAP_GC_TEXTS')) {
222 define('IMAP_GC_TEXTS', 4);
223 }
224
225 if (!function_exists('imap_open')) {
226 function imap_open($mailbox, $user, $password, $flags = 0, $retries = 0, $options = [])
227 {
228 return imap2_open($mailbox, $user, $password, $flags, $retries, $options);
229 }
230 }
231 if (!function_exists('imap2_open')) {
232 function imap2_open($mailbox, $user, $password, $flags = 0, $retries = 0, $options = [])
233 {
234 if (IMAP2_RETROFIT_MODE && !($flags & OP_XOAUTH2)) {
235 return imap_open($mailbox, $user, $password, $flags, $retries, $options);
236 }
237
238 return Connection::open($mailbox, $user, $password, $flags, $retries, $options);
239 }
240 }
241
242 if (!function_exists('imap_reopen')) {
243 function imap_reopen($imap, $mailbox, $flags = 0, $retries = 0)
244 {
245 return imap2_reopen($imap, $mailbox, $flags, $retries);
246 }
247 }
248 if (!function_exists('imap2_reopen')) {
249 function imap2_reopen($imap, $mailbox, $flags = 0, $retries = 0)
250 {
251 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
252 return imap_reopen($imap, $mailbox, $flags, $retries);
253 }
254
255 return Connection::reopen($imap, $mailbox, $flags, $retries);
256 }
257 }
258
259 if (!function_exists('imap_ping')) {
260 function imap_ping($imap)
261 {
262 return Connection::ping($imap);
263 }
264 }
265 if (!function_exists('imap2_ping')) {
266 function imap2_ping($imap)
267 {
268 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
269 return imap_ping($imap);
270 }
271
272 return Connection::ping($imap);
273 }
274 }
275
276 if (!function_exists('imap_close')) {
277 function imap_close($imap, $flags = 0)
278 {
279 return Connection::close($imap, $flags);
280 }
281 }
282 if (!function_exists('imap2_close')) {
283 function imap2_close($imap, $flags = 0)
284 {
285 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
286 return imap_close($imap, $flags);
287 }
288
289 return Connection::close($imap, $flags);
290 }
291 }
292
293 if (!function_exists('imap_timeout')) {
294 function imap_timeout($timeoutType, $timeout = -1)
295 {
296 return imap2_timeout($timeoutType, $timeout);
297 }
298 }
299 if (!function_exists('imap2_timeout')) {
300 function imap2_timeout($timeoutType, $timeout = -1)
301 {
302 if (IMAP2_RETROFIT_MODE) {
303 imap_timeout($timeoutType, $timeout);
304 }
305
306 return Timeout::set($timeoutType, $timeout);
307 }
308 }
309
310 if (!function_exists('imap_check')) {
311 function imap_check($imap)
312 {
313 return Mailbox::check($imap);
314 }
315 }
316 if (!function_exists('imap2_check')) {
317 function imap2_check($imap)
318 {
319 return Mailbox::check($imap);
320 }
321 }
322
323 if (!function_exists('imap_status')) {
324 function imap_status($imap, $mailbox, $flags)
325 {
326 return imap2_status($imap, $mailbox, $flags);
327 }
328 }
329 if (!function_exists('imap2_status')) {
330 function imap2_status($imap, $mailbox, $flags)
331 {
332 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
333 return imap_status($imap, $mailbox, $flags);
334 }
335
336 return Mailbox::status($imap, $mailbox, $flags);
337 }
338 }
339
340 if (!function_exists('imap_num_msg')) {
341 function imap_num_msg($imap)
342 {
343 return imap2_num_msg($imap);
344 }
345 }
346 if (!function_exists('imap2_num_msg')) {
347 function imap2_num_msg($imap)
348 {
349 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
350 return imap_num_msg($imap);
351 }
352
353 return Mailbox::numMsg($imap);
354 }
355 }
356
357 if (!function_exists('imap_num_recent')) {
358 function imap_num_recent($imap)
359 {
360 return imap2_num_recent($imap);
361 }
362 }
363 if (!function_exists('imap2_num_recent')) {
364 function imap2_num_recent($imap)
365 {
366 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
367 return imap_num_recent($imap);
368 }
369
370 return Mailbox::numRecent($imap);
371 }
372 }
373
374 if (!function_exists('imap_list')) {
375 function imap_list($imap, $reference, $pattern)
376 {
377 return imap2_list($imap, $reference, $pattern);
378 }
379 }
380 if (!function_exists('imap2_list')) {
381 function imap2_list($imap, $reference, $pattern)
382 {
383 return Mailbox::list($imap, $reference, $pattern);
384 }
385 }
386
387 if (!function_exists('imap_listmailbox')) {
388 function imap_listmailbox($imap, $reference, $pattern)
389 {
390 return imap2_listmailbox($imap, $reference, $pattern);
391 }
392 }
393 if (!function_exists('imap2_listmailbox')) {
394 function imap2_listmailbox($imap, $reference, $pattern)
395 {
396 return Mailbox::list($imap, $reference, $pattern);
397 }
398 }
399
400 if (!function_exists('imap_listscan')) {
401 function imap_listscan($imap, $reference, $pattern, $content)
402 {
403 return imap2_listscan($imap, $reference, $pattern, $content);
404 }
405 }
406 if (!function_exists('imap2_listscan')) {
407 function imap2_listscan($imap, $reference, $pattern, $content)
408 {
409 return Mailbox::listScan($imap, $reference, $pattern, $content);
410 }
411 }
412
413 if (!function_exists('imap_scan')) {
414 function imap_scan($imap, $reference, $pattern, $content)
415 {
416 return imap2_scan($imap, $reference, $pattern, $content);
417 }
418 }
419 if (!function_exists('imap2_scan')) {
420 function imap2_scan($imap, $reference, $pattern, $content)
421 {
422 return Mailbox::listScan($imap, $reference, $pattern, $content);
423 }
424 }
425
426 if (!function_exists('imap_scanmailbox')) {
427 function imap_scanmailbox($imap, $reference, $pattern, $content)
428 {
429 return imap2_scanmailbox($imap, $reference, $pattern, $content);
430 }
431 }
432 if (!function_exists('imap2_scanmailbox')) {
433 function imap2_scanmailbox($imap, $reference, $pattern, $content)
434 {
435 return Mailbox::listScan($imap, $reference, $pattern, $content);
436 }
437 }
438
439 if (!function_exists('imap_getmailboxes')) {
440 function imap_getmailboxes($imap, $reference, $pattern)
441 {
442 return imap2_getmailboxes($imap, $reference, $pattern);
443 }
444 }
445 if (!function_exists('imap2_getmailboxes')) {
446 function imap2_getmailboxes($imap, $reference, $pattern)
447 {
448 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
449 return imap_getmailboxes($imap, $reference, $pattern);
450 }
451
452 return Mailbox::getMailboxes($imap, $reference, $pattern);
453 }
454 }
455
456 if (!function_exists('imap_listsubscribed')) {
457 function imap_listsubscribed($imap, $reference, $pattern)
458 {
459 return imap2_listsubscribed($imap, $reference, $pattern);
460 }
461 }
462 if (!function_exists('imap2_listsubscribed')) {
463 function imap2_listsubscribed($imap, $reference, $pattern)
464 {
465 return Mailbox::listSubscribed($imap, $reference, $pattern);
466 }
467 }
468
469 if (!function_exists('imap_lsub')) {
470 function imap_lsub($imap, $reference, $pattern)
471 {
472 return imap2_lsub($imap, $reference, $pattern);
473 }
474 }
475 if (!function_exists('imap2_lsub')) {
476 function imap2_lsub($imap, $reference, $pattern)
477 {
478 return Mailbox::listSubscribed($imap, $reference, $pattern);
479 }
480 }
481
482 if (!function_exists('imap_getsubscribed')) {
483 function imap_getsubscribed($imap, $reference, $pattern)
484 {
485 return imap2_getsubscribed($imap, $reference, $pattern);
486 }
487 }
488 if (!function_exists('imap2_getsubscribed')) {
489 function imap2_getsubscribed($imap, $reference, $pattern)
490 {
491 return Mailbox::getSubscribed($imap, $reference, $pattern);
492 }
493 }
494
495 if (!function_exists('imap_subscribe')) {
496 function imap_subscribe($imap, $mailbox)
497 {
498 return imap2_subscribe($imap, $mailbox);
499 }
500 }
501 if (!function_exists('imap2_subscribe')) {
502 function imap2_subscribe($imap, $mailbox)
503 {
504 return Mailbox::subscribe($imap, $mailbox);
505 }
506 }
507
508 if (!function_exists('imap_unsubscribe')) {
509 function imap_unsubscribe($imap, $mailbox)
510 {
511 return imap2_unsubscribe($imap, $mailbox);
512 }
513 }
514 if (!function_exists('imap2_unsubscribe')) {
515 function imap2_unsubscribe($imap, $mailbox)
516 {
517 return Mailbox::unsubscribe($imap, $mailbox);
518 }
519 }
520
521 if (!function_exists('imap_createmailbox')) {
522 function imap_createmailbox($imap, $mailbox)
523 {
524 return imap2_createmailbox($imap, $mailbox);
525 }
526 }
527 if (!function_exists('imap2_createmailbox')) {
528 function imap2_createmailbox($imap, $mailbox)
529 {
530 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
531 return imap_createmailbox($imap, $mailbox);
532 }
533
534 return Mailbox::createMailbox($imap, $mailbox);
535 }
536 }
537
538 if (!function_exists('imap_create')) {
539 function imap_create($imap, $mailbox)
540 {
541 return imap2_create($imap, $mailbox);
542 }
543 }
544 if (!function_exists('imap2_create')) {
545 function imap2_create($imap, $mailbox)
546 {
547 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
548 return imap_create($imap, $mailbox);
549 }
550
551 return Mailbox::createMailbox($imap, $mailbox);
552 }
553 }
554
555 if (!function_exists('imap_deletemailbox')) {
556 function imap_deletemailbox($imap, $mailbox)
557 {
558 return imap2_deletemailbox($imap, $mailbox);
559 }
560 }
561 if (!function_exists('imap2_deletemailbox')) {
562 function imap2_deletemailbox($imap, $mailbox)
563 {
564 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
565 return imap_deletemailbox($imap, $mailbox);
566 }
567
568 return Mailbox::deleteMailbox($imap, $mailbox);
569 }
570 }
571
572 if (!function_exists('imap_renamemailbox')) {
573 function imap_renamemailbox($imap, $from, $to)
574 {
575 return imap2_renamemailbox($imap, $from, $to);
576 }
577 }
578 if (!function_exists('imap2_renamemailbox')) {
579 function imap2_renamemailbox($imap, $from, $to)
580 {
581 return Mailbox::renameMailbox($imap, $from, $to);
582 }
583 }
584
585 if (!function_exists('imap_rename')) {
586 function imap_rename($imap, $from, $to)
587 {
588 return imap2_rename($imap, $from, $to);
589 }
590 }
591 if (!function_exists('imap2_rename')) {
592 function imap2_rename($imap, $from, $to)
593 {
594 return Mailbox::renameMailbox($imap, $from, $to);
595 }
596 }
597
598 if (!function_exists('imap_mailboxmsginfo')) {
599 function imap_mailboxmsginfo($imap)
600 {
601 return imap2_mailboxmsginfo($imap);
602 }
603 }
604 if (!function_exists('imap2_mailboxmsginfo')) {
605 function imap2_mailboxmsginfo($imap)
606 {
607 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
608 return imap_mailboxmsginfo($imap);
609 }
610
611 return Mailbox::mailboxMsgInfo($imap);
612 }
613 }
614
615 if (!function_exists('imap_search')) {
616 function imap_search($imap, $criteria, $flags = SE_FREE, $charset = "")
617 {
618 return imap2_search($imap, $criteria, $flags, $charset);
619 }
620 }
621 if (!function_exists('imap2_search')) {
622 function imap2_search($imap, $criteria, $flags = SE_FREE, $charset = "")
623 {
624 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
625 return imap_search($imap, $criteria, $flags, $charset);
626 }
627
628 return Message::search($imap, $criteria, $flags, $charset);
629 }
630 }
631
632 if (!function_exists('imap_headers')) {
633 function imap_headers($imap)
634 {
635 return imap2_headers($imap);
636 }
637 }
638 if (!function_exists('imap2_headers')) {
639 function imap2_headers($imap)
640 {
641 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
642 return imap_headers($imap);
643 }
644
645 return Message::headers($imap);
646 }
647 }
648
649 if (!function_exists('imap_msgno')) {
650 function imap_msgno($imap, $messageUid)
651 {
652 return imap2_msgno($imap, $messageUid);
653 }
654 }
655 if (!function_exists('imap2_msgno')) {
656 function imap2_msgno($imap, $messageUid)
657 {
658 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
659 return imap_msgno($imap, $messageUid);
660 }
661
662 return Message::msgNo($imap, $messageUid);
663 }
664 }
665
666 if (!function_exists('imap_uid')) {
667 function imap_uid($imap, $messageNum)
668 {
669 return imap2_uid($imap, $messageNum);
670 }
671 }
672 if (!function_exists('imap2_uid')) {
673 function imap2_uid($imap, $messageNum)
674 {
675 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
676 return imap_uid($imap, $messageNum);
677 }
678
679 return Message::uid($imap, $messageNum);
680 }
681 }
682
683 if (!function_exists('imap_sort')) {
684 function imap_sort($imap, $criteria, $reverse, $flags = 0, $searchCriteria = null, $charset = null)
685 {
686 return imap2_sort($imap, $criteria, $reverse, $flags, $searchCriteria, $charset);
687 }
688 }
689 if (!function_exists('imap2_sort')) {
690 function imap2_sort($imap, $criteria, $reverse, $flags = 0, $searchCriteria = null, $charset = null)
691 {
692 return Message::sort($imap, $criteria, $reverse, $flags, $searchCriteria, $charset);
693 }
694 }
695
696 if (!function_exists('imap_append')) {
697 function imap_append($imap, $folder, $message, $options = null, $internalDate = null)
698 {
699 return imap2_append($imap, $folder, $message, $options, $internalDate);
700 }
701 }
702 if (!function_exists('imap2_append')) {
703 function imap2_append($imap, $folder, $message, $options = null, $internalDate = null)
704 {
705 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
706 return imap_append($imap, $folder, $message, $options, $internalDate);
707 }
708
709 return Mailbox::append($imap, $folder, $message, $options, $internalDate);
710 }
711 }
712
713 if (!function_exists('imap_headerinfo')) {
714 function imap_headerinfo($imap, $messageNum, $fromLength = 0, $subjectLength = 0, $defaultHost = null)
715 {
716 return imap2_headerinfo($imap, $messageNum, $fromLength, $subjectLength, $defaultHost);
717 }
718 }
719 if (!function_exists('imap2_headerinfo')) {
720 function imap2_headerinfo($imap, $messageNum, $fromLength = 0, $subjectLength = 0, $defaultHost = null)
721 {
722 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
723 return imap_headerinfo($imap, $messageNum, $fromLength, $subjectLength, $defaultHost);
724 }
725
726 return Message::headerInfo($imap, $messageNum, $fromLength, $subjectLength, $defaultHost);
727 }
728 }
729
730 if (!function_exists('imap_header')) {
731 function imap_header($imap, $messageNum, $fromLength = 0, $subjectLength = 0, $defaultHost = null)
732 {
733 return imap2_header($imap, $messageNum, $fromLength, $subjectLength, $defaultHost);
734 }
735 }
736 if (!function_exists('imap2_header')) {
737 function imap2_header($imap, $messageNum, $fromLength = 0, $subjectLength = 0, $defaultHost = null)
738 {
739 return Message::headerInfo($imap, $messageNum, $fromLength, $subjectLength, $defaultHost);
740 }
741 }
742
743 if (!function_exists('imap_body')) {
744 function imap_body($imap, $messageNum, $flags = 0)
745 {
746 return imap2_body($imap, $messageNum, $flags);
747 }
748 }
749 if (!function_exists('imap2_body')) {
750 function imap2_body($imap, $messageNum, $flags = 0)
751 {
752 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
753 return imap_body($imap, $messageNum, $flags);
754 }
755
756 return Message::body($imap, $messageNum, $flags);
757 }
758 }
759
760 if (!function_exists('imap_fetchtext')) {
761 function imap_fetchtext($imap, $messageNum, $flags = 0)
762 {
763 return imap2_fetchtext($imap, $messageNum, $flags);
764 }
765 }
766 if (!function_exists('imap2_fetchtext')) {
767 function imap2_fetchtext($imap, $messageNum, $flags = 0)
768 {
769 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
770 return imap_fetchtext($imap, $messageNum, $flags);
771 }
772
773 return Message::body($imap, $messageNum, $flags);
774 }
775 }
776
777 if (!function_exists('imap_fetchbody')) {
778 function imap_fetchbody($imap, $messageNum, $section, $flags = 0)
779 {
780 return imap2_fetchbody($imap, $messageNum, $section, $flags);
781 }
782 }
783 if (!function_exists('imap2_fetchbody')) {
784 function imap2_fetchbody($imap, $messageNum, $section, $flags = 0)
785 {
786 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
787 return imap_fetchbody($imap, $messageNum, $section, $flags);
788 }
789
790 return Message::fetchBody($imap, $messageNum, $section, $flags);
791 }
792 }
793
794 if (!function_exists('imap_bodystruct')) {
795 function imap_bodystruct($imap, $messageNum, $section)
796 {
797 return imap2_bodystruct($imap, $messageNum, $section);
798 }
799 }
800 if (!function_exists('imap2_bodystruct')) {
801 function imap2_bodystruct($imap, $messageNum, $section)
802 {
803 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
804 return imap_bodystruct($imap, $messageNum, $section);
805 }
806
807 return Message::bodyStruct($imap, $messageNum, $section);
808 }
809 }
810
811 if (!function_exists('imap_savebody')) {
812 function imap_savebody($imap, $file, $messageNum, $section = "", $flags = 0)
813 {
814 return imap2_savebody($imap, $file, $messageNum, $section, $flags);
815 }
816 }
817 if (!function_exists('imap2_savebody')) {
818 function imap2_savebody($imap, $file, $messageNum, $section = "", $flags = 0)
819 {
820 if (IMAP2_RETROFIT_MODE && Functions::isRetrofitResource($imap)) {
821 return imap_savebody($imap, $file, $messageNum, $section, $flags);
822 }
823
824 return Message::saveBody($imap, $file, $messageNum, $section, $flags);
825 }
826 }
827
828 if (!function_exists('imap_fetchstructure')) {
829 function imap_fetchstructure($imap, $messageNum, $flags = 0)
830 {
831 return imap2_fetchstructure($imap, $messageNum, $flags);
832 }
833 }
834 if (!function_exists('imap2_fetchstructure')) {
835 function imap2_fetchstructure($imap, $messageNum, $flags = 0)
836 {
837 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
838 return imap_fetchstructure($imap, $messageNum, $flags);
839 }
840
841 return Message::fetchStructure($imap, $messageNum, $flags);
842 }
843 }
844
845 if (!function_exists('imap_fetchheader')) {
846 function imap_fetchheader($imap, $messageNum, $flags = 0)
847 {
848 return imap2_fetchheader($imap, $messageNum, $flags);
849 }
850 }
851 if (!function_exists('imap2_fetchheader')) {
852 function imap2_fetchheader($imap, $messageNum, $flags = 0)
853 {
854 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
855 return imap_fetchheader($imap, $messageNum, $flags);
856 }
857
858 return Message::fetchHeader($imap, $messageNum, $flags);
859 }
860 }
861
862 if (!function_exists('imap_fetch_overview')) {
863 function imap_fetch_overview($imap, $sequence, $flags = 0)
864 {
865 return imap2_fetch_overview($imap, $sequence, $flags);
866 }
867 }
868 if (!function_exists('imap2_fetch_overview')) {
869 function imap2_fetch_overview($imap, $sequence, $flags = 0)
870 {
871 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
872 return imap_fetch_overview($imap, $sequence, $flags);
873 }
874
875 return Message::fetchOverview($imap, $sequence, $flags);
876 }
877 }
878
879 if (!function_exists('imap_fetchmime')) {
880 function imap_fetchmime($imap, $messageNum, $section, $flags = 0)
881 {
882 return imap2_fetchmime($imap, $messageNum, $section, $flags);
883 }
884 }
885 if (!function_exists('imap2_fetchmime')) {
886 function imap2_fetchmime($imap, $messageNum, $section, $flags = 0)
887 {
888 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
889 return imap_fetchmime($imap, $messageNum, $section, $flags);
890 }
891
892 return Message::fetchMime($imap, $messageNum, $section, $flags);
893 }
894 }
895
896 if (!function_exists('imap_delete')) {
897 function imap_delete($imap, $messageNums, $flags = 0)
898 {
899 return imap2_delete($imap, $messageNums, $flags);
900 }
901 }
902 if (!function_exists('imap2_delete')) {
903 function imap2_delete($imap, $messageNums, $flags = 0)
904 {
905 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
906 return imap_delete($imap, $messageNums, $flags);
907 }
908
909 return Message::delete($imap, $messageNums, $flags);
910 }
911 }
912
913 if (!function_exists('imap_undelete')) {
914 function imap_undelete($imap, $messageNums, $flags = 0)
915 {
916 return imap2_undelete($imap, $messageNums, $flags);
917 }
918 }
919 if (!function_exists('imap2_undelete')) {
920 function imap2_undelete($imap, $messageNums, $flags = 0)
921 {
922 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
923 return imap_undelete($imap, $messageNums, $flags);
924 }
925
926 return Message::undelete($imap, $messageNums, $flags);
927 }
928 }
929
930 if (!function_exists('imap_clearflag_full')) {
931 function imap_clearflag_full($imap, $sequence, $flag, $options = 0)
932 {
933 return imap2_clearflag_full($imap, $sequence, $flag, $options);
934 }
935 }
936 if (!function_exists('imap2_clearflag_full')) {
937 function imap2_clearflag_full($imap, $sequence, $flag, $options = 0)
938 {
939 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
940 return imap_clearflag_full($imap, $sequence, $flag, $options);
941 }
942
943 return Message::clearFlagFull($imap, $sequence, $flag, $options);
944 }
945 }
946
947 if (!function_exists('imap_setflag_full')) {
948 function imap_setflag_full($imap, $sequence, $flag, $options = 0)
949 {
950 return imap2_setflag_full($imap, $sequence, $flag, $options);
951 }
952 }
953 if (!function_exists('imap2_setflag_full')) {
954 function imap2_setflag_full($imap, $sequence, $flag, $options = 0)
955 {
956 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
957 return imap_setflag_full($imap, $sequence, $flag, $options);
958 }
959
960 return Message::setFlagFull($imap, $sequence, $flag, $options);
961 }
962 }
963
964 if (!function_exists('imap_mail_compose')) {
965 function imap_mail_compose($envelope, $bodies)
966 {
967 return imap2_mail_compose($envelope, $bodies);
968 }
969 }
970 if (!function_exists('imap2_mail_compose')) {
971 function imap2_mail_compose($envelope, $bodies)
972 {
973 return Polyfill::mailCompose($envelope, $bodies);
974 }
975 }
976
977 if (!function_exists('imap_mail_copy')) {
978 function imap_mail_copy($imap, $messageNums, $mailbox, $flags = 0)
979 {
980 return imap2_mail_copy($imap, $messageNums, $mailbox, $flags);
981 }
982 }
983 if (!function_exists('imap2_mail_copy')) {
984 function imap2_mail_copy($imap, $messageNums, $mailbox, $flags = 0)
985 {
986 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
987 return imap_mail_copy($imap, $messageNums, $mailbox, $flags);
988 }
989
990 return Mail::copy($imap, $messageNums, $mailbox, $flags);
991 }
992 }
993
994 if (!function_exists('imap_mail_move')) {
995 function imap_mail_move($imap, $messageNums, $mailbox, $flags = 0)
996 {
997 return imap2_mail_move($imap, $messageNums, $mailbox, $flags);
998 }
999 }
1000 if (!function_exists('imap2_mail_move')) {
1001 function imap2_mail_move($imap, $messageNums, $mailbox, $flags = 0)
1002 {
1003 if (IMAP2_RETROFIT_MODE && is_resource($imap) && get_resource_type($imap) == 'imap') {
1004 return imap_mail_move($imap, $messageNums, $mailbox, $flags);
1005 }
1006
1007 return Mail::move($imap, $messageNums, $mailbox, $flags);
1008 }
1009 }
1010
1011 if (!function_exists('imap_mail')) {
1012 function imap_mail($to, $subject, $message, $additionalHeaders = null, $cc = null, $bcc = null, $returnPath = null)
1013 {
1014 return imap2_mail($to, $subject, $message, $additionalHeaders, $cc, $bcc, $returnPath);
1015 }
1016 }
1017 if (!function_exists('imap2_mail')) {
1018 function imap2_mail($to, $subject, $message, $additionalHeaders = null, $cc = null, $bcc = null, $returnPath = null)
1019 {
1020 if (IMAP2_RETROFIT_MODE) {
1021 return imap_mail($to, $subject, $message, $additionalHeaders, $cc, $bcc, $returnPath);
1022 }
1023
1024 return Mail::send($to, $subject, $message, $additionalHeaders, $cc, $bcc, $returnPath);
1025 }
1026 }
1027
1028 if (!function_exists('imap_expunge')) {
1029 function imap_expunge($imap)
1030 {
1031 return imap2_expunge($imap);
1032 }
1033 }
1034 if (!function_exists('imap2_expunge')) {
1035 function imap2_expunge($imap)
1036 {
1037 return Message::expunge($imap);
1038 }
1039 }
1040
1041 if (!function_exists('imap_gc')) {
1042 function imap_gc($imap, $flags)
1043 {
1044 return imap2_gc($imap, $flags);
1045 }
1046 }
1047 if (!function_exists('imap2_gc')) {
1048 function imap2_gc($imap, $flags)
1049 {
1050 return Message::expunge($imap, $flags);
1051 }
1052 }
1053
1054 if (!function_exists('imap_get_quota')) {
1055 function imap_get_quota($imap, $quotaRoot)
1056 {
1057 return imap2_get_quota($imap, $quotaRoot);
1058 }
1059 }
1060 if (!function_exists('imap2_get_quota')) {
1061 function imap2_get_quota($imap, $quotaRoot)
1062 {
1063 return Message::expunge($imap, $quotaRoot);
1064 }
1065 }
1066
1067 if (!function_exists('imap_set_quota')) {
1068 function imap_set_quota($imap, $quotaRoot, $mailboxSize)
1069 {
1070 return imap2_set_quota($imap, $quotaRoot, $mailboxSize);
1071 }
1072 }
1073 if (!function_exists('imap2_set_quota')) {
1074 function imap2_set_quota($imap, $quotaRoot, $mailboxSize)
1075 {
1076 return Message::expunge($imap, $quotaRoot, $mailboxSize);
1077 }
1078 }
1079
1080 if (!function_exists('imap_get_quotaroot')) {
1081 function imap_get_quotaroot($imap, $mailbox)
1082 {
1083 return imap2_get_quotaroot($imap, $mailbox);
1084 }
1085 }
1086 if (!function_exists('imap2_get_quotaroot')) {
1087 function imap2_get_quotaroot($imap, $mailbox)
1088 {
1089 return Message::expunge($imap, $mailbox);
1090 }
1091 }
1092
1093 if (!function_exists('imap_getacl')) {
1094 function imap_getacl($imap, $mailbox)
1095 {
1096 return imap2_getacl($imap, $mailbox);
1097 }
1098 }
1099 if (!function_exists('imap2_getacl')) {
1100 function imap2_getacl($imap, $mailbox)
1101 {
1102 return Message::expunge($imap, $mailbox);
1103 }
1104 }
1105
1106 if (!function_exists('imap_setacl')) {
1107 function imap_setacl($imap, $mailbox, $userId, $rights)
1108 {
1109 return imap2_setacl($imap, $mailbox, $userId, $rights);
1110 }
1111 }
1112 if (!function_exists('imap2_setacl')) {
1113 function imap2_setacl($imap, $mailbox, $userId, $rights)
1114 {
1115 return Message::expunge($imap, $mailbox, $userId, $rights);
1116 }
1117 }
1118
1119 if (!function_exists('imap_thread')) {
1120 function imap_thread($imap, $flags = SE_FREE)
1121 {
1122 return imap2_thread($imap, $flags);
1123 }
1124 }
1125 if (!function_exists('imap2_thread')) {
1126 function imap2_thread($imap, $flags = SE_FREE)
1127 {
1128 return Thread::thread($imap, $flags);
1129 }
1130 }
1131
1132 if (!function_exists('imap_errors')) {
1133 function imap_errors()
1134 {
1135 return imap2_errors();
1136 }
1137 }
1138 if (!function_exists('imap2_errors')) {
1139 function imap2_errors()
1140 {
1141 return Errors::errors();
1142 }
1143 }
1144
1145 if (!function_exists('imap_last_error')) {
1146 function imap_last_error()
1147 {
1148 return imap2_last_error();
1149 }
1150 }
1151 if (!function_exists('imap2_last_error')) {
1152 function imap2_last_error()
1153 {
1154 return Errors::lastError();
1155 }
1156 }
1157
1158 if (!function_exists('imap_alerts')) {
1159 function imap_alerts()
1160 {
1161 return imap2_alerts();
1162 }
1163 }
1164 if (!function_exists('imap2_alerts')) {
1165 function imap2_alerts()
1166 {
1167 return Errors::alerts();
1168 }
1169 }
1170
1171 if (!function_exists('imap_8bit')) {
1172 function imap_8bit($string)
1173 {
1174 return imap2_8bit($string);
1175 }
1176 }
1177 if (!function_exists('imap2_8bit')) {
1178 function imap2_8bit($string)
1179 {
1180 return function_exists('imap_8bit') ? imap_8bit($string) : Polyfill::convert8bit($string);
1181 }
1182 }
1183
1184 if (!function_exists('imap_base64')) {
1185 function imap_base64($string)
1186 {
1187 return imap2_base64($string);
1188 }
1189 }
1190 if (!function_exists('imap2_base64')) {
1191 function imap2_base64($string)
1192 {
1193 if (IMAP2_RETROFIT_MODE) {
1194 return imap_base64($string);
1195 }
1196
1197 return Polyfill::base64($string);
1198 }
1199 }
1200
1201 if (!function_exists('imap_binary')) {
1202 function imap_binary($string)
1203 {
1204 return imap2_binary($string);
1205 }
1206 }
1207 if (!function_exists('imap2_binary')) {
1208 function imap2_binary($string)
1209 {
1210 if (IMAP2_RETROFIT_MODE) {
1211 return imap_binary($string);
1212 }
1213
1214 return Polyfill::binary($string);
1215 }
1216 }
1217
1218 if (!function_exists('imap_mime_header_decode')) {
1219 function imap_mime_header_decode($string)
1220 {
1221 return imap2_mime_header_decode($string);
1222 }
1223 }
1224 if (!function_exists('imap2_mime_header_decode')) {
1225 function imap2_mime_header_decode($string)
1226 {
1227 if (IMAP2_RETROFIT_MODE) {
1228 return imap_mime_header_decode($string);
1229 }
1230
1231 return Polyfill::mimeHeaderDecode($string);
1232 }
1233 }
1234
1235 if (!function_exists('imap_mutf7_to_utf8')) {
1236 function imap_mutf7_to_utf8($string)
1237 {
1238 return imap2_mutf7_to_utf8($string);
1239 }
1240 }
1241 if (!function_exists('imap2_mutf7_to_utf8')) {
1242 function imap2_mutf7_to_utf8($string)
1243 {
1244 if (IMAP2_RETROFIT_MODE) {
1245 return imap_mutf7_to_utf8($string);
1246 }
1247
1248 return Polyfill::mutf7ToUtf8($string);
1249 }
1250 }
1251
1252 if (!function_exists('imap_qprint')) {
1253 function imap_qprint($string)
1254 {
1255 return Polyfill::qPrint($string);
1256 }
1257 }
1258 if (!function_exists('imap2_qprint')) {
1259 function imap2_qprint($string)
1260 {
1261 return imap_qprint($string);
1262 }
1263 }
1264
1265 if (!function_exists('imap_rfc822_parse_adrlist')) {
1266 function imap_rfc822_parse_adrlist($string, $defaultHostname)
1267 {
1268 return Polyfill::rfc822ParseAdrList($string, $defaultHostname);
1269 }
1270 }
1271 if (!function_exists('imap2_rfc822_parse_adrlist')) {
1272 function imap2_rfc822_parse_adrlist($string, $defaultHostname)
1273 {
1274 return imap_rfc822_parse_adrlist($string, $defaultHostname);
1275 }
1276 }
1277
1278 if (!function_exists('imap_rfc822_parse_headers')) {
1279 function imap_rfc822_parse_headers($headers, $defaultHostname = 'UNKNOWN')
1280 {
1281 return Polyfill::rfc822ParseHeaders($headers, $defaultHostname);
1282 }
1283 }
1284 if (!function_exists('imap2_rfc822_parse_headers')) {
1285 function imap2_rfc822_parse_headers($headers, $defaultHostname = 'UNKNOWN')
1286 {
1287 return imap_rfc822_parse_headers($headers, $defaultHostname);
1288 }
1289 }
1290
1291 if (!function_exists('imap_rfc822_write_address')) {
1292 function imap_rfc822_write_address($mailbox, $hostname, $personal)
1293 {
1294 return Polyfill::rfc822WriteHeaders($mailbox, $hostname, $personal);
1295 }
1296 }
1297 if (!function_exists('imap2_rfc822_write_address')) {
1298 function imap2_rfc822_write_address($mailbox, $hostname, $personal)
1299 {
1300 return imap_rfc822_write_address($mailbox, $hostname, $personal);
1301 }
1302 }
1303
1304 if (!function_exists('imap_utf7_decode')) {
1305 function imap_utf7_decode($string)
1306 {
1307 return Polyfill::utf7Decode($string);
1308 }
1309 }
1310 if (!function_exists('imap2_utf7_decode')) {
1311 function imap2_utf7_decode($string)
1312 {
1313 return imap_utf7_decode($string);
1314 }
1315 }
1316
1317 if (!function_exists('imap_utf7_encode')) {
1318 function imap_utf7_encode($string)
1319 {
1320 return Polyfill::utf7Encode($string);
1321 }
1322 }
1323 if (!function_exists('imap2_utf7_encode')) {
1324 function imap2_utf7_encode($string)
1325 {
1326 return imap_utf7_encode($string);
1327 }
1328 }
1329
1330 if (!function_exists('imap_utf8_to_mutf7')) {
1331 function imap_utf8_to_mutf7($string)
1332 {
1333 return Polyfill::utf8ToMutf7($string);
1334 }
1335 }
1336 if (!function_exists('imap2_utf8_to_mutf7')) {
1337 function imap2_utf8_to_mutf7($string)
1338 {
1339 return imap_utf8_to_mutf7($string);
1340 }
1341 }
1342
1343 if (!function_exists('imap_utf8')) {
1344 function imap_utf8($string)
1345 {
1346 return Polyfill::utf8($string);
1347 }
1348 }
1349 if (!function_exists('imap2_utf8')) {
1350 function imap2_utf8(string $string)
1351 {
1352 return imap_utf8($string);
1353 }
1354 }
1355