@@ -318,16 +318,16 @@ discard block |
||
318 | 318 | public function globalDelete(): bool |
319 | 319 | { |
320 | 320 | $dateArr = \explode('-', $this->deleteMsgDate); // date format is yyyy-mm-dd |
321 | - $delDate = \mktime(0, 0, 0, (int) ($dateArr[1]), (int) ($dateArr[2]), (int) ($dateArr[0])); |
|
321 | + $delDate = \mktime(0, 0, 0, (int)($dateArr[1]), (int)($dateArr[2]), (int)($dateArr[0])); |
|
322 | 322 | |
323 | - $port = $this->port . '/' . $this->service . '/' . $this->serviceOption; |
|
324 | - $mboxt = \imap_open('{' . $this->mailhost . ':' . $port . '}', $this->mailboxUserName, $this->mailboxPassword, OP_HALFOPEN); |
|
323 | + $port = $this->port.'/'.$this->service.'/'.$this->serviceOption; |
|
324 | + $mboxt = \imap_open('{'.$this->mailhost.':'.$port.'}', $this->mailboxUserName, $this->mailboxPassword, OP_HALFOPEN); |
|
325 | 325 | |
326 | 326 | if ($mboxt === false) { |
327 | 327 | return false; |
328 | 328 | } |
329 | 329 | |
330 | - $list = \imap_getmailboxes($mboxt, '{' . $this->mailhost . ':' . $port . '}', '*'); |
|
330 | + $list = \imap_getmailboxes($mboxt, '{'.$this->mailhost.':'.$port.'}', '*'); |
|
331 | 331 | |
332 | 332 | if (\is_array($list)) { |
333 | 333 | foreach ($list as $key => $val) { |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $nameRaw = $nameArr[\count($nameArr) - 1]; |
337 | 337 | |
338 | 338 | if (\stripos($nameRaw, 'sent') === false) { |
339 | - $mboxd = \imap_open('{' . $this->mailhost . ':' . $port . '}' . $nameRaw, $this->mailboxUserName, $this->mailboxPassword, CL_EXPUNGE); |
|
339 | + $mboxd = \imap_open('{'.$this->mailhost.':'.$port.'}'.$nameRaw, $this->mailboxUserName, $this->mailboxPassword, CL_EXPUNGE); |
|
340 | 340 | $messages = \imap_sort($mboxd, SORTDATE, 0); |
341 | 341 | |
342 | 342 | foreach ($messages as $message) { |
@@ -412,19 +412,19 @@ discard block |
||
412 | 412 | if (\trim($mailbox) === '') { |
413 | 413 | // this is a critical error with either the mailbox name blank or an invalid mailbox name |
414 | 414 | // need to stop processing and exit at this point |
415 | - echo 'Invalid mailbox name for move operation. Cannot continue: ' . $mailbox . "<br />\n"; |
|
415 | + echo 'Invalid mailbox name for move operation. Cannot continue: '.$mailbox."<br />\n"; |
|
416 | 416 | exit(); |
417 | 417 | } |
418 | 418 | |
419 | - $port = $this->port . '/' . $this->service . '/' . $this->serviceOption; |
|
419 | + $port = $this->port.'/'.$this->service.'/'.$this->serviceOption; |
|
420 | 420 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
421 | - $mbox = @\imap_open('{' . $this->mailhost . ':' . $port . '}', $this->mailboxUserName, $this->mailboxPassword, OP_HALFOPEN); |
|
421 | + $mbox = @\imap_open('{'.$this->mailhost.':'.$port.'}', $this->mailboxUserName, $this->mailboxPassword, OP_HALFOPEN); |
|
422 | 422 | |
423 | 423 | if ($mbox === false) { |
424 | 424 | return false; |
425 | 425 | } |
426 | 426 | |
427 | - $list = \imap_getmailboxes($mbox, '{' . $this->mailhost . ':' . $port . '}', '*'); |
|
427 | + $list = \imap_getmailboxes($mbox, '{'.$this->mailhost.':'.$port.'}', '*'); |
|
428 | 428 | $mailboxFound = false; |
429 | 429 | |
430 | 430 | if (\is_array($list)) { |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | |
440 | 440 | if ($mailboxFound === false && $create) { |
441 | 441 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
442 | - @\imap_createmailbox($mbox, \imap_utf7_encode('{' . $this->mailhost . ':' . $port . '}' . $mailbox)); |
|
442 | + @\imap_createmailbox($mbox, \imap_utf7_encode('{'.$this->mailhost.':'.$port.'}'.$mailbox)); |
|
443 | 443 | /** @noinspection UnusedFunctionResultInspection */ |
444 | 444 | \imap_errors(); |
445 | 445 | /** @noinspection UnusedFunctionResultInspection */ |
@@ -485,13 +485,13 @@ discard block |
||
485 | 485 | } |
486 | 486 | |
487 | 487 | if (!$this->mailboxLink) { |
488 | - $this->errorMessage = 'Cannot open the mailbox file to ' . $filePath . $this->bmhNewLine . 'Error MSG: ' . \imap_last_error(); |
|
488 | + $this->errorMessage = 'Cannot open the mailbox file to '.$filePath.$this->bmhNewLine.'Error MSG: '.\imap_last_error(); |
|
489 | 489 | $this->output(); |
490 | 490 | |
491 | 491 | return false; |
492 | 492 | } |
493 | 493 | |
494 | - $this->output('Opened ' . $filePath); |
|
494 | + $this->output('Opened '.$filePath); |
|
495 | 495 | |
496 | 496 | return true; |
497 | 497 | } |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | { |
506 | 506 | // before starting the processing, let's check the delete flag and do global deletes if true |
507 | 507 | if (\trim($this->deleteMsgDate) !== '') { |
508 | - echo 'processing global delete based on date of ' . $this->deleteMsgDate . '<br />'; |
|
508 | + echo 'processing global delete based on date of '.$this->deleteMsgDate.'<br />'; |
|
509 | 509 | $this->globalDelete(); |
510 | 510 | } |
511 | 511 | |
@@ -515,24 +515,24 @@ discard block |
||
515 | 515 | $this->moveHard = false; |
516 | 516 | } |
517 | 517 | |
518 | - $port = $this->port . '/' . $this->service . '/' . $this->serviceOption; |
|
518 | + $port = $this->port.'/'.$this->service.'/'.$this->serviceOption; |
|
519 | 519 | |
520 | 520 | \set_time_limit(self::SECONDS_TIMEOUT); |
521 | 521 | |
522 | 522 | if (!$this->testMode) { |
523 | - $this->mailboxLink = \imap_open('{' . $this->mailhost . ':' . $port . '}' . $this->boxname, $this->mailboxUserName, $this->mailboxPassword, CL_EXPUNGE); |
|
523 | + $this->mailboxLink = \imap_open('{'.$this->mailhost.':'.$port.'}'.$this->boxname, $this->mailboxUserName, $this->mailboxPassword, CL_EXPUNGE); |
|
524 | 524 | } else { |
525 | - $this->mailboxLink = \imap_open('{' . $this->mailhost . ':' . $port . '}' . $this->boxname, $this->mailboxUserName, $this->mailboxPassword, OP_READONLY); |
|
525 | + $this->mailboxLink = \imap_open('{'.$this->mailhost.':'.$port.'}'.$this->boxname, $this->mailboxUserName, $this->mailboxPassword, OP_READONLY); |
|
526 | 526 | } |
527 | 527 | |
528 | 528 | if (!$this->mailboxLink) { |
529 | - $this->errorMessage = 'Cannot create ' . $this->service . ' connection to ' . $this->mailhost . $this->bmhNewLine . 'Error MSG: ' . \imap_last_error(); |
|
529 | + $this->errorMessage = 'Cannot create '.$this->service.' connection to '.$this->mailhost.$this->bmhNewLine.'Error MSG: '.\imap_last_error(); |
|
530 | 530 | $this->output(); |
531 | 531 | |
532 | 532 | return false; |
533 | 533 | } |
534 | 534 | |
535 | - $this->output('Connected to: ' . $this->mailhost . ' (' . $this->mailboxUserName . ')'); |
|
535 | + $this->output('Connected to: '.$this->mailhost.' ('.$this->mailboxUserName.')'); |
|
536 | 536 | |
537 | 537 | return true; |
538 | 538 | } |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | { |
548 | 548 | if ($this->verbose >= $verboseLevel) { |
549 | 549 | if ($msg) { |
550 | - echo $msg . $this->bmhNewLine; |
|
550 | + echo $msg.$this->bmhNewLine; |
|
551 | 551 | } else { |
552 | - echo $this->errorMessage . $this->bmhNewLine; |
|
552 | + echo $this->errorMessage.$this->bmhNewLine; |
|
553 | 553 | } |
554 | 554 | } |
555 | 555 | } |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | break; |
636 | 636 | |
637 | 637 | default: // un-support Content-type |
638 | - $this->output('Msg #' . $pos . ' is unsupported Content-Type:' . $structure->type, self::VERBOSE_REPORT); |
|
638 | + $this->output('Msg #'.$pos.' is unsupported Content-Type:'.$structure->type, self::VERBOSE_REPORT); |
|
639 | 639 | |
640 | 640 | return false; |
641 | 641 | } |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | } |
683 | 683 | |
684 | 684 | if ($this->testMode) { |
685 | - $this->output('Match: ' . $ruleNumber . ':' . $ruleCategory . '; ' . $bounceType . '; ' . $email); |
|
685 | + $this->output('Match: '.$ruleNumber.':'.$ruleCategory.'; '.$bounceType.'; '.$email); |
|
686 | 686 | } else { |
687 | 687 | // code below will use the Callback function, but return no value |
688 | 688 | $params = [ |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | } else { |
708 | 708 | // match rule, do bounce action |
709 | 709 | if ($this->testMode) { |
710 | - $this->output('Match: ' . $ruleNumber . ':' . $ruleCategory . '; ' . $bounceType . '; ' . $email); |
|
710 | + $this->output('Match: '.$ruleNumber.':'.$ruleCategory.'; '.$bounceType.'; '.$email); |
|
711 | 711 | |
712 | 712 | return true; |
713 | 713 | } |
@@ -773,12 +773,12 @@ discard block |
||
773 | 773 | $unprocessedCount = 0; |
774 | 774 | $deletedCount = 0; |
775 | 775 | $movedCount = 0; |
776 | - $this->output('Total: ' . $totalCount . ' messages '); |
|
776 | + $this->output('Total: '.$totalCount.' messages '); |
|
777 | 777 | |
778 | 778 | // process maximum number of messages |
779 | 779 | if ($fetchedCount > $this->maxMessages) { |
780 | 780 | $fetchedCount = $this->maxMessages; |
781 | - $this->output('Processing first ' . $fetchedCount . ' messages '); |
|
781 | + $this->output('Processing first '.$fetchedCount.' messages '); |
|
782 | 782 | } |
783 | 783 | |
784 | 784 | if ($this->testMode) { |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | $processedResult = $this->processBounce($x, 'DSN', $totalCount); |
821 | 821 | } else { |
822 | 822 | // not standard DSN msg |
823 | - $this->output('Msg #' . $x . ' is not a standard DSN message', self::VERBOSE_REPORT); |
|
823 | + $this->output('Msg #'.$x.' is not a standard DSN message', self::VERBOSE_REPORT); |
|
824 | 824 | |
825 | 825 | if ($this->debugBodyRule) { |
826 | 826 | if ($structure->ifdescription) { |
@@ -846,7 +846,7 @@ discard block |
||
846 | 846 | $processedResult = $this->processBounce($x, 'DSN', $totalCount); |
847 | 847 | } else { |
848 | 848 | // not standard DSN msg |
849 | - $this->output('Msg #' . $x . ' is not a standard DSN message', self::VERBOSE_REPORT); |
|
849 | + $this->output('Msg #'.$x.' is not a standard DSN message', self::VERBOSE_REPORT); |
|
850 | 850 | |
851 | 851 | if ($this->debugBodyRule) { |
852 | 852 | $this->output(" Content-Type : {$match[1]}", self::VERBOSE_DEBUG); |
@@ -856,10 +856,10 @@ discard block |
||
856 | 856 | } |
857 | 857 | } else { |
858 | 858 | // didn't get content-type header |
859 | - $this->output('Msg #' . $x . ' is not a well-formatted MIME mail, missing Content-Type', self::VERBOSE_REPORT); |
|
859 | + $this->output('Msg #'.$x.' is not a well-formatted MIME mail, missing Content-Type', self::VERBOSE_REPORT); |
|
860 | 860 | |
861 | 861 | if ($this->debugBodyRule) { |
862 | - $this->output(' Headers: ' . $this->bmhNewLine . $header . $this->bmhNewLine, self::VERBOSE_DEBUG); |
|
862 | + $this->output(' Headers: '.$this->bmhNewLine.$header.$this->bmhNewLine, self::VERBOSE_DEBUG); |
|
863 | 863 | } |
864 | 864 | |
865 | 865 | $processedResult = $this->processBounce($x, 'BODY', $totalCount); |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | // move the message |
891 | 891 | if (!$this->testMode) { |
892 | 892 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
893 | - @\imap_mail_move($this->mailboxLink, (string) $x, $this->hardMailbox); |
|
893 | + @\imap_mail_move($this->mailboxLink, (string)$x, $this->hardMailbox); |
|
894 | 894 | } |
895 | 895 | |
896 | 896 | $moveFlag[$x] = true; |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | // move the message |
905 | 905 | if (!$this->testMode) { |
906 | 906 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
907 | - @\imap_mail_move($this->mailboxLink, (string) $x, $this->softMailbox); |
|
907 | + @\imap_mail_move($this->mailboxLink, (string)$x, $this->softMailbox); |
|
908 | 908 | } |
909 | 909 | |
910 | 910 | $moveFlag[$x] = true; |
@@ -937,18 +937,18 @@ discard block |
||
937 | 937 | \flush(); |
938 | 938 | } |
939 | 939 | |
940 | - $this->output($this->bmhNewLine . 'Closing mailbox, and purging messages'); |
|
940 | + $this->output($this->bmhNewLine.'Closing mailbox, and purging messages'); |
|
941 | 941 | |
942 | 942 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
943 | 943 | @\imap_expunge($this->mailboxLink); |
944 | 944 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
945 | 945 | @\imap_close($this->mailboxLink); |
946 | 946 | |
947 | - $this->output('Read: ' . $fetchedCount . ' messages'); |
|
948 | - $this->output($processedCount . ' action taken'); |
|
949 | - $this->output($unprocessedCount . ' no action taken'); |
|
950 | - $this->output($deletedCount . ' messages deleted'); |
|
951 | - $this->output($movedCount . ' messages moved'); |
|
947 | + $this->output('Read: '.$fetchedCount.' messages'); |
|
948 | + $this->output($processedCount.' action taken'); |
|
949 | + $this->output($unprocessedCount.' no action taken'); |
|
950 | + $this->output($deletedCount.' messages deleted'); |
|
951 | + $this->output($movedCount.' messages moved'); |
|
952 | 952 | |
953 | 953 | return true; |
954 | 954 | } |