git subrepo clone https://github.com/mailcow/mailcow-dockerized.git mailcow/src/mailcow-dockerized

subrepo: subdir:   "mailcow/src/mailcow-dockerized"
  merged:   "a832becb"
upstream: origin:   "https://github.com/mailcow/mailcow-dockerized.git"
  branch:   "master"
  commit:   "a832becb"
git-subrepo: version:  "0.4.3"
  origin:   "???"
  commit:   "???"
Change-Id: If5be2d621a211e164c9b6577adaa7884449f16b5
diff --git a/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/ddeboer/imap/src/MessageIterator.php b/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/ddeboer/imap/src/MessageIterator.php
new file mode 100644
index 0000000..c617478
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/ddeboer/imap/src/MessageIterator.php
@@ -0,0 +1,45 @@
+<?php
+
+declare(strict_types=1);
+
+namespace Ddeboer\Imap;
+
+final class MessageIterator extends \ArrayIterator implements MessageIteratorInterface
+{
+    /**
+     * @var ImapResourceInterface
+     */
+    private $resource;
+
+    /**
+     * Constructor.
+     *
+     * @param ImapResourceInterface $resource       IMAP resource
+     * @param array                 $messageNumbers Array of message numbers
+     */
+    public function __construct(ImapResourceInterface $resource, array $messageNumbers)
+    {
+        $this->resource = $resource;
+
+        parent::__construct($messageNumbers);
+    }
+
+    /**
+     * Get current message.
+     */
+    public function current(): MessageInterface
+    {
+        $current = parent::current();
+        if (!\is_int($current)) {
+            throw new Exception\OutOfBoundsException(\sprintf(
+                'The current value "%s" isn\'t an integer and doesn\'t represent a message;'
+                . ' try to cycle this "%s" with a native php function like foreach or with the method getArrayCopy(),'
+                . ' or check it by calling the methods valid().',
+                \is_object($current) ? \get_class($current) : \gettype($current),
+                static::class
+            ));
+        }
+
+        return new Message($this->resource, $current);
+    }
+}