За последние 24 часа нас посетили 22464 программиста и 1031 робот. Сейчас ищут 607 программистов ...

imap_fetchstructure не видит раздела с вложениями

Тема в разделе "Работа с почтой", создана пользователем dbocman, 2 дек 2021.

  1. dbocman

    dbocman Активный пользователь

    С нами с:
    30 окт 2017
    Сообщения:
    20
    Симпатии:
    1
    Здравствуйте уважаемые коллеги, долгое время работает модуль по приему писем, но попался один клиент, в письмах которого функция imap_fetchstructure не видит раздел с вложениями, причем, если я перешлю через майлру себе это письмо, разделы есть, вложения определяются. Подскажите пожалуйста кто встречался, куда копать? Версия PHP 5.6.36.
    --- Добавлено ---
    Содержимое проблемного письма с вырезанными заголовками и содержимом
    Код (Text):
    1. Content-Type: multipart/mixed; boundary="=_mixed 0032BCEA43258772_="
    2.  
    3.  
    4. --=_mixed 0032BCEA43258772_=
    5. Content-Type: multipart/related; boundary="=_related 0032BCEA43258772_="
    6.  
    7.  
    8. --=_related 0032BCEA43258772_=
    9. Content-Type: multipart/alternative; boundary="=_alternative 0032BCEA43258772_="
    10.  
    11.  
    12. --=_alternative 0032BCEA43258772_=
    13. Content-Type: text/plain; charset="UTF-8"
    14. Content-Transfer-Encoding: base64
    15.  
    16. содержимое раздела
    17. --=_alternative 0032BCEA43258772_=
    18. Content-Type: text/html; charset="UTF-8"
    19. Content-Transfer-Encoding: base64
    20.  
    21. содержимое раздела
    22. --=_alternative 0032BCEA43258772_=--
    23. --=_related 0032BCEA43258772_=
    24. Content-Type: image/png
    25. Content-ID: <_4_0AD3C8B00AD3C4CC0032BCEA43258772>
    26. Content-Transfer-Encoding: base64
    27.  
    28. содержимое раздела
    29. --=_related 0032BCEA43258772_=
    30. Content-Type: image/png
    31. Content-ID: <_4_0AD3DC380AD3D8540032BCEA43258772>
    32. Content-Transfer-Encoding: base64
    33.  
    34. содержимое раздела
    35. --=_related 0032BCEA43258772_=
    36. Content-Type: image/png
    37. Content-ID: <_4_0AD3E2240AD3DE400032BCEA43258772>
    38. Content-Transfer-Encoding: base64
    39.  
    40. содержимое раздела
    41. --=_related 0032BCEA43258772_=
    42. Content-Type: image/png
    43. Content-ID: <_4_0AD3E8100AD3E42C0032BCEA43258772>
    44. Content-Transfer-Encoding: base64
    45.  
    46. содержимое раздела
    47. --=_related 0032BCEA43258772_=
    48. Content-Type: image/gif
    49. Content-ID: <_1_0AD3FF900AD3FA9C0032BCEA43258772>
    50. Content-Transfer-Encoding: base64
    51.  
    52. содержимое раздела
    53. --=_related 0032BCEA43258772_=
    54. Content-Type: image/png
    55. Content-ID: <_4_0E2F05AC0E2F019C0032BCEA43258772>
    56. Content-Transfer-Encoding: base64
    57.  
    58. содержимое раздела
    59. --=_related 0032BCEA43258772_=--
    60. --=_mixed 0032BCEA43258772_=
    61. Content-Type: application/octet-stream; name="ФАЙЛ.pdf"
    62. Content-Disposition: attachment; filename="ФАЙЛ.pdf"
    63. Content-Transfer-Encoding: base64
    64.  
    65. СОДЕРЖИМОЕ ФАЙЛА PDF
    66. --=_mixed 0032BCEA43258772_=--
    --- Добавлено ---
    Разделы, найденные imap_fetchstructure:
    Код (Text):
    1. stdClass Object
    2. (
    3.     [type] => 1
    4.     [encoding] => 0
    5.     [ifsubtype] => 1
    6.     [subtype] => MIXED
    7.     [ifdescription] => 0
    8.     [ifid] => 0
    9.     [ifdisposition] => 0
    10.     [ifdparameters] => 0
    11.     [ifparameters] => 0
    12.     [parameters] => stdClass Object ()
    13.     [parts] => Array
    14.         (
    15.             [0] => stdClass Object (
    16.                     [type] => 1
    17.                     [encoding] => 0
    18.                     [ifsubtype] => 1
    19.                     [subtype] => _4_0AD3DC380AD3D8540032BCEA43258772
    20.                     [ifdescription] => 0
    21.                     [ifid] => 0
    22.                     [ifdisposition] => 0
    23.                     [ifdparameters] => 0
    24.                     [ifparameters] => 0
    25.                     [parameters] => stdClass Object ()
    26.                     [parts] => Array(
    27.                             [0] => stdClass Object (
    28.                                     [type] => 1
    29.                                     [encoding] => 0
    30.                                     [ifsubtype] => 1
    31.                                     [subtype] => ALTERNATIVE
    32.                                     [ifdescription] => 0
    33.                                     [ifid] => 0
    34.                                     [ifdisposition] => 0
    35.                                     [ifdparameters] => 0
    36.                                     [ifparameters] => 1
    37.                                     [parameters] => Array(
    38.                                             [0] => stdClass Object (
    39.                                                     [attribute] => boundary
    40.                                                     [value] => UNKNOWN
    41.                                                 )
    42.                                         )
    43.                                     [parts] => Array(
    44.                                             [0] => stdClass Object
    45.                                                 (
    46.                                                     [type] => 0
    47.                                                     [encoding] => 3
    48.                                                     [ifsubtype] => 1
    49.                                                     [subtype] => PLAIN
    50.                                                     [ifdescription] => 0
    51.                                                     [ifid] => 0
    52.                                                     [bytes] => 1312
    53.                                                     [ifdisposition] => 0
    54.                                                     [ifdparameters] => 0
    55.                                                     [ifparameters] => 1
    56.                                                     [parameters] => Array (
    57.                                                             [0] => stdClass Object (
    58.                                                                     [attribute] => charset
    59.                                                                     [value] => utf-8
    60.                                                                 )
    61.                                                         )
    62.                                                 )
    63.                                             [1] => stdClass Object(
    64.                                                     [type] => 0
    65.                                                     [encoding] => 3
    66.                                                     [ifsubtype] => 1
    67.                                                     [subtype] => HTML
    68.                                                     [ifdescription] => 0
    69.                                                     [ifid] => 0
    70.                                                     [bytes] => 8514
    71.                                                     [ifdisposition] => 0
    72.                                                     [ifdparameters] => 0
    73.                                                     [ifparameters] => 1
    74.                                                     [parameters] => Array
    75.                                                         (
    76.                                                             [0] => stdClass Object
    77.                                                                 (
    78.                                                                     [attribute] => charset
    79.                                                                     [value] => utf-8
    80.                                                                 )
    81.                                                         )
    82.                                                 )
    83.                                         )
    84.                                 )
    85.                             [1] => stdClass Object (
    86.                                     [type] => 5
    87.                                     [encoding] => 6
    88.                                     [ifsubtype] => 1
    89.                                     [subtype] => PNG
    90.                                     [ifdescription] => 1
    91.                                     [description] => image
    92.                                     [ifid] => 0
    93.                                     [ifdisposition] => 0
    94.                                     [ifdparameters] => 0
    95.                                     [ifparameters] => 1
    96.                                     [parameters] => Array(
    97.                                             [0] => stdClass Object(
    98.                                                     [attribute] => UNKNOWN
    99.                                                     [value] => _4_0AD3C8B00AD3C4CC0032BCEA43258772
    100.                                                 )
    101.                                             [1] => stdClass Object (
    102.                                                     [attribute] => UNKNOWN
    103.                                                     [value] => base64
    104.                                                 )
    105.                                             [2] => stdClass Object(
    106.                                                     [attribute] => UNKNOWN
    107.                                                     [value] => UNKNOWN
    108.                                                 )
    109.                                             [3] => stdClass Object (
    110.                                                     [attribute] => UNKNOWN
    111.                                                     [value] => UNKNOWN
    112.                                                 )
    113.                                             [4] => stdClass Object (
    114.                                                     [attribute] => UNKNOWN
    115.                                                     [value] => UNKNOWN
    116.                                                 )
    117.                                             [5] => stdClass Object(
    118.                                                     [attribute] => UNKNOWN
    119.                                                     [value] => UNKNOWN
    120.                                                 )
    121.                                         )
    122.                                 )
    123.                         )
    124.                 )
    125.         )
    126. )