PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.0.1
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.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 / back / Libraries / Imap2 / bootstrap.php

bootstrap.php in AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress 11.0.1, at back/Libraries/Imap2/bootstrap.php

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