ddeboer / imap

Object-oriented, fully tested PHP IMAP library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getFilename() returns NULL for long attachment filenames

pporlan opened this issue · comments

Q A
ddeboer/imap version 1.12.2 / 1.13.1
PHP version 7.4.28 / 8.1.3
IMAP provider imap.ionos.es

Summary

Long filenames splitted across multiple lines in the message are not retrieved correctly by the function $attachment->getFilename()

$message->getRawMessage() output:
...
--=_6cc5e393f9284e5e531157803beddb81
Content-Transfer-Encoding: base64
Content-Type: text/csv;
name*0*=utf-8''BTP%20Cerrados%20%C3%9Altimo%20Mes%20Tickets-20220311-0603;
name*1*=03.csv
Content-Disposition: attachment;
filename*0*=utf-8''BTP%20Cerrados%20%C3%9Altimo%20Mes%20Tickets-20220311-;
filename*1*=060303.csv;
size=247245

77u/Ik7Dum1lcm8gZGUgVGlja2V0IjsiRmVjaGEgZGUgY3JlYWNpw7NuIjtBc3VudG87RGU7IkRl
...

Current behavior

$attachment->getFilename() returns NULL

Expected behavior

$attachment->getFilename() should return "BTP Cerrados Último Mes Tickets-20220311-060303.csv"