zendframework / zend-mail

Mail component from Zend Framework
BSD 3-Clause "New" or "Revised" License
96 stars 111 forks source link

Error parsing response - FETCH ENVELOPE #89

Open luigimeclea opened 8 years ago

luigimeclea commented 8 years ago

PHP $protocol->requestAndResponse('FETCH', ['3596', $protocol->escapeList(['ENVELOPE'])], false);

IMAP response

ZEND response

Notice: Uninitialized string offset: 0 in vendor/zendframework/zend-mail/src/Protocol/Imap.php on line 189

Notice: Uninitialized string offset: 0 in /vendor/zendframework/zend-mail/src/Protocol/Imap.php on line 194

Notice: Uninitialized string offset: 0 in /vendor/zendframework/zend-mail/src/Protocol/Imap.php on line 201

Notice: Uninitialized string offset: -1 in /vendor/zendframework/zend-mail/src/Protocol/Imap.php on line 221

array (
  0 => 
  array (
    0 => '3596',
    1 => 'FETCH',
    2 => 
    array (
      0 => 'ENVELOPE',
      1 => 
      array (
        0 => 'Mon, 07 Apr 2014 08:32:39 +0000',
        1 => 'Igor Presnyakov: \\',
        2 => 'Kansas',
        3 => '-',
        4 => 'Dust',
        5 => 'In',
        6 => 'The',
        7 => 'Wind',
        8 => 
        array (
          0 => '',
          1 => 'guitar&vocal',
          2 => 'edition',
        ),
        9 => '-',
        10 => 'Igor',
        11 => 'Presnyakov\\""',
        12 => 
        array (
          0 => 
          array (
            0 => 'YouTube',
            1 => 'NIL',
            2 => 'noreply',
            3 => 'youtube.com',
          ),
        ),
        13 => 
        array (
          0 => 
          array (
            0 => 'YouTube',
            1 => 'NIL',
            2 => 'noreply',
            3 => 'youtube.com',
          ),
        ),
        14 => 
        array (
          0 => 
          array (
            0 => 'YouTube',
            1 => 'NIL',
            2 => 'noreply',
            3 => 'youtube.com',
          ),
        ),
        15 => 
        array (
          0 => 
          array (
            0 => 'My Name',
            1 => 'NIL',
            2 => 'username',
            3 => 'gmail.com',
          ),
        ),
        16 => 'NIL',
        17 => 'NIL',
        18 => 'NIL',
        19 => '<****@google.com>',
      ),
    ),
  ),
)

* Expected ZEND response**

array (
      0 => 'Mon, 07 Apr 2014 08:32:39 +0000',
      1 => 'Igor Presnyakov: \\"Kansas - Dust In The Wind ( guitar&vocal edition ) - Igor Presnyakov\\"',
      2 => 
      array (
        0 => 
        array (
          0 => 'YouTube',
          1 => 'NIL',
          2 => 'noreply',
          3 => 'youtube.com',
        ),
      ),
      3 => 
      array (
        0 => 
        array (
          0 => 'YouTube',
          1 => 'NIL',
          2 => 'noreply',
          3 => 'youtube.com',
        ),
      ),
      4 => 
      array (
        0 => 
        array (
          0 => 'YouTube',
          1 => 'NIL',
          2 => 'noreply',
          3 => 'youtube.com',
        ),
      ),
      5 => 
      array (
        0 => 
        array (
          0 => 'My Name',
          1 => 'NIL',
          2 => 'username',
          3 => 'gmail.com',
        ),
      ),
      6 => 'NIL',
      7 => 'NIL',
      8 => 'NIL',
      9 => '<****@google.com>',
    )

*\ Managed to parse response with the help of: https://github.com/petewarden/handmadeimap

Thanks!

Maks3w commented 8 years ago

Please edit your question and style it for to make it more legible https://guides.github.com/features/mastering-markdown/

luigimeclea commented 8 years ago

@Maks3w done

michalbundyra commented 4 years ago

This repository has been closed and moved to laminas/laminas-mail; a new issue has been opened at https://github.com/laminas/laminas-mail/issues/62.