PHP error related to Mail App when parsing IMAP message

NC 28.0.3

Error message on logs:

Out of memory (allocated 8602521600 bytes) (tried to allocate 17179869192 bytes) at /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Ids.php#366

Detailed brute message:
{"reqId":"fIN72XyxaRdjxlYixqpz","level":3,"time":"2024-04-03T05:01:20+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"Out of memory (allocated 8602521600 bytes) (tried to allocate 17179869192 bytes) at /var/www/nextcloud/apps/mail/vendor/bytestream/horde-imap-client/lib/Horde/Imap/Client/Ids.php#366","userAgent":"--","version":"28.0.3.2","data":{"app":"PHP"},"id":"660d4d9571d41"}

Line 366 of the Ids.php file refers to a function that parses IMAP message sequence string into a list of indices:

**
     * Parse an IMAP message sequence string into a list of indices.
     *
     * @see _toSequenceString()
     *
     * @param string $str  The IMAP message sequence string.
     *
     * @return array  An array of indices.
     */
    protected function _fromSequenceString($str)
    {
        $ids = array();
        $str = trim($str);

        if (!strlen($str)) {
            return $ids;
        }

        $idarray = explode(',', $str);

        foreach ($idarray as $val) {
            $range = explode(':', $val);
            if (isset($range[1])) {
                for ($i = min($range), $j = max($range); $i <= $j; ++$i) {
>>>> LINE 366 >>>> $ids[] = (int)$i;
                }
            } else {
                $ids[] = (int)$val;
            }
        }

        return $ids;
    }

So basically, Nextcloud’s Mail app, attempted to allocate more memory than is available. Tried to allocate 17 Gigabytes to memory and crashed when it reached 8Gb. It’s a Zimbra server. Don’t get me wrong, the MaillApp works fine, it is correctly integrated and I can send and receive e-mails using it, but I am trying to eliminate every error I find on the registry.

Any thoughts? Thanks in advance.