Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFilename() is empty and no attachment, even when there is an attachment. #142

Closed
hirbod opened this issue Jan 2, 2017 · 3 comments
Closed
Labels
Milestone

Comments

@hirbod
Copy link

hirbod commented Jan 2, 2017

hasAttachment returns true
While trying so save it, getFilename is empty. It happens just for this specific mail. It's a myTaxi receipt I'm getting few times per month. I anonymized it and removed nearly the whole base64 content for privacy purposes.

Other mails work as intended. What is happening? What is so special with this type of mail? The content is also just the mailbody, not the attachment itself. When I open it with Apple Mail or Thunderbird, the attachment gets detected and is downloadable without any problems.

Return-Path: <00000144c8445931-be533ff5-c8b9-4257-a4cd-3c280b2f3854-000000@amazonses.com>
Delivered-To: [email protected]
Received: from localhost (localhost [127.0.0.1])
	by myserver.private.com (Postfix) with ESMTP id 87F0E3B0053C
	for <[email protected]>; Sun, 16 Mar 2014 01:22:15 +0100 (CET)
X-Virus-Scanned: Debian amavisd-new at myserver.private.com
Received: from myserver.private.com ([127.0.0.1])
	by localhost (myserver.private.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Kh9vJ--8FKT7 for <[email protected]>;
	Sun, 16 Mar 2014 01:22:09 +0100 (CET)
Received: from a8-62.smtp-out.amazonses.com (a8-62.smtp-out.amazonses.com [54.240.8.62])
	by myserver.private.com (Postfix) with ESMTP id 59F1C3B00475
	for <[email protected]>; Sun, 16 Mar 2014 01:22:08 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple;
	s=57t7olz43dqh4kw2nnt7i3f53ployg3g; d=somedomain.net; t=1394929326;
	h=From:To:Message-ID:Subject:MIME-Version:Content-Type:Date;
	bh=m0B8CwhIhEtBn7uqgM0XnG6uxxqTB0coknyD8syjoP4=;
	b=dAE2cJnDR8F/0UR3188yAbpXeEQ7qQBxjkAo755XUCCi3RDREtRp3hmyWsNFC3L9
	YnLPv03jTvOvIgp+may32S5IZ750kXI2vWTOJD25dbk+xPcz6q3+88V/GR8CB5V5XVO
	lu0QWEOu1RR2LnX3cilo+J92/I7waGh6pJ3HMymI=
From: mytaxi Payment <[email protected]>
To: [email protected]
Message-ID: <00000144c8445931-be533ff5-c8b9-4257-a4cd-3c280b2f3854-000000@email.amazonses.com>
Subject: Ihre mytaxi Quittung (49M6J)
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_27875_991041197.1394929323292"
Date: Sun, 16 Mar 2014 00:22:06 +0000
X-SES-Outgoing: 2014.03.16-54.240.8.62

------=_Part_27875_991041197.1394929323292
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline



<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8">
   =20
  <style type=3D"text/css" style=3D"font-family: Lucida Grande, Arial, sans=
-serif;">
=09=09body{
=09=09=09background-color:rgb(255,255,255);
=09=09=09margin:0px !important;
=09=09=09padding:0px !important;
=09=09}
=09=09*{
=09=09=09font-family:Lucida Grande, Arial, sans-serif;
=09=09}
=09=09h1{
=09=09=09font-size:20px;
=09=09=09color:rgb(64, 64, 64);
=09=09=09font-weight:bold;
=09=09=09margin:0px !important;
=09=09=09padding:0px !important;
=09=09=09padding-bottom:10px !important;
=09=09}
=09=09h2{
=09=09=09font-size:16px;
=09=09=09color:rgb(64, 64, 64);
=09=09=09font-weight:bold;
=09=09=09line-height:16px;
=09=09=09margin:0px !important;
=09=09=09padding:0px !important;
=09=09=09padding-bottom:10p !important;
=09=09}
=09=09h3{
=09=09=09font-size:16px;
=09=09=09color:rgb(64, 64, 64);
=09=09=09font-weight:bold;
=09=09=09line-height:16px;
=09=09=09margin:0px !important;
=09=09=09padding:0px !important;
=09=09=09padding-bottom:4px !important;
=09=09}
=09=09.bold{
=09=09=09font-weight:bold;
=09=09}
=09=09a{
=09=09=09color:rgb(128, 128, 128);
=09=09=09font-weight:bold;
=09=09=09text-decoration:none;
=09=09}
=09=09p{
=09=09=09margin:0px !important;
=09=09=09padding:0px !important;
=09=09}
=09=09table{
=09=09=09margin:0px !important;
=09=09=09padding:0px !important;
=09=09=09border:0px;
=09=09}
=09=09#header{
=09=09=09display:block;
=09=09}
=09=09.content{
=09=09=09font-size:13px;
=09=09=09color:rgb(64, 64, 64);
=09=09=09line-height:20px;
=09=09=09text-align:left;
=09=09}
=09=09.content a{
=09=09=09color:rgb(64, 64, 64);
=09=09}
=09=09.nodisplay{
=09=09=09font-size:11px;
=09=09=09color:rgb(191,191,191);
=09=09=09text-align:center;
=09=09}
=09=09.social{
=09=09=09margin:0px !important;
=09=09=09padding:30px 0px !important;
=09=09}
=09=09.footer{
=09=09=09font-size:10px;
=09=09=09margin:0px !important;
=09=09=09padding:0px !important;
=09=09=09padding-bottom:6px !important;
=09=09=09color:rgb(191,191,191);
=09=09=09line-height:14px;
=09=09}
</style></head>
  <body bgcolor=3D"#ececec" align=3D"center" style=3D"font-family: Lucida G=
rande, Arial, sans-serif;background-color: rgb(255,255,255);margin: 0px !im=
portant;padding: 0px !important;">
      <div align=3D"center" class=3D"maindiv" bgcolor=3D"#ececec" style=3D"=
font-family: Lucida Grande, Arial, sans-serif;">
          <table width=3D"640" align=3D"center" border=3D"0" cellpadding=3D=
"0" cellspacing=3D"0" class=3D"main" bgcolor=3D"#ffffff" style=3D"font-fami=
ly: Lucida Grande, Arial, sans-serif;border: 0px;margin: 0px !important;pad=
ding: 0px !important;">
              <tbody style=3D"font-family: Lucida Grande, Arial, sans-serif=
;">
             <tr style=3D"font-family: Lucida Grande, Arial, sans-serif;">
                =20
             <td align=3D"center" style=3D"font-family: Lucida Grande, Aria=
l, sans-serif;">
                 <table align=3D"center" border=3D"0" cellpadding=3D"0" cel=
lspacing=3D"0" width=3D"640" class=3D"maintab" style=3D"font-family: Lucida=
 Grande, Arial, sans-serif;border: 0px;margin: 0px !important;padding: 0px =
!important;"><!-- Oben -->
                        <tbody style=3D"font-family: Lucida Grande, Arial, =
sans-serif;">
                            <tr style=3D"font-family: Lucida Grande, Arial,=
 sans-serif;">
                                <td align=3D"center" style=3D"font-family: =
Lucida Grande, Arial, sans-serif;">
                                    <table class=3D"contenttab" cellpadding=
=3D"0" cellspacing=3D"0" border=3D"0" width=3D"640" bgcolor=3D"#fcfcfc" sty=
le=3D"font-family: Lucida Grande, Arial, sans-serif;border: 0px;margin: 0px=
 !important;padding: 0px !important;">
                                        <tr style=3D"font-family: Lucida Gr=
ande, Arial, sans-serif;">
                                            <td class=3D"headerfooter" widt=
h=3D"640" bgcolor=3D"#FCFCFC"><img id=3D"header" alt=3D"Ihre Quittung" bord=
er=3D"0" src=3D"http://newsletter.somedomain.net/templates/accounting/de/header=
_receipt.jpg" width=3D"640" style=3D"display: block;"></td>
                                        </tr>
                                        <tr style=3D"font-family: Lucida Gr=
ande, Arial, sans-serif;">
                                           =20
                                            <td class=3D"contentcolumn" ali=
gn=3D"center" width=3D"640" valign=3D"top" style=3D"font-family: Lucida Gra=
nde, Arial, sans-serif;">
                                                <table cellpadding=3D"0" ce=
llspacing=3D"0" border=3D"0" width=3D"560" align=3D"center" style=3D"font-f=
amily: Lucida Grande, Arial, sans-serif;border: 0px;margin: 0px !important;=
padding: 0px !important;">
                                                    <tbody style=3D"font-fa=
mily: Lucida Grande, Arial, sans-serif;">
                                                    <tr style=3D"font-famil=
y: Lucida Grande, Arial, sans-serif;">
                                                        <td class=3D"conten=
t" width=3D"600" style=3D"font-family: Lucida Grande, Arial, sans-serif;fon=
t-size: 13px;color: rgb(64, 64, 64);line-height: 20px;text-align: left;">
=09                                                        <table style=3D"=
width: 100%;font-size: 13px;" cellpadding=3D"0" cellspacing=3D"0" bgcolor=
=3D"#FCFCFC">
=09                                                        =09<tr>
=09                                                        =09=09<td style=
=3D"text-align:center;padding-bottom: 20px;color: rgb(64,64,64);"><img src=
=3D"http://newsletter.somedomain.net/templates/global/passenger_icon.png" /></t=
d>
=09                                                        =09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"padding-bot=
tom: 20px;color: rgb(64,64,64);">Sehr geehrte(r) Max Mustermann,</td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"color: rgb(=
64,64,64);"><b>vielen Dank</b> f&uuml;r Ihre <b>Fahrt mit einem mytaxi</b>.=
</td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"padding-bot=
tom: 20px;color: rgb(64,64,64);">Mit dieser E-Mail erhalten Sie die Quittun=
g f=C3=BCr die Fahrt mit der mytaxi-ID 49M6J.<br/></td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"text-align:=
 center;padding-bottom: 20px;color: rgb(64,64,64);">Der Gesamtbetrag f=C3=
=BCr diese Fahrt betr=C3=A4gt:</td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"text-align:=
 center;padding-bottom: 20px;font-size: 20px;color: rgb(64,64,64);"><b>13,1=
0 &#8364;</b></td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"padding-bot=
tom: 20px;color: rgb(64,64,64);"><b>Im Anhang dieser E-Mail finden Sie die =
Quittung als PDF</b>. Die Fahrt inklusive Fahrer und Abholadresse k=C3=B6nn=
en Sie auch in Ihrer mytaxi-App unter "Fahrten" einsehen.</td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"padding-bot=
tom: 20px;color: rgb(64,64,64);">Bei Fragen zu Ihrer Quittung antworten Sie=
 einfach auf die E-Mail. Falls Sie noch mehr =C3=BCber uns erfahren wollen,=
 besuchen Sie uns auf <a style=3D"color: rgb(64,64,64);font-weight: bold;te=
xt-decoration: underline;" href=3D"https://www.facebook.com/mytaxi.de?ref=
=3Dlogo">Facebook</a>, <a style=3D"color: rgb(64,64,64);font-weight: bold;t=
ext-decoration: underline;" href=3D"http://twitter.com/#!/mytaxi">Twitter</=
a> oder unserer <a style=3D"color: rgb(64,64,64);font-weight: bold;text-dec=
oration: underline;" href=3D"http://www.mytaxi.com"> Webseite</a>.</td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09<td style=3D"padding-bot=
tom: 30px;color: rgb(64,64,64);">Wir freuen uns, dass Sie mit uns fahren.</=
td>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</tr>
=09                                                        =09<tr>
=09                                                        =09=09<td style=
=3D"padding-bottom: 20px;color: rgb(64,64,64);"><h3 style=3D"color: rgb(64,=
 64, 64) !important;font-family: Lucida Grande, Arial, sans-serif;font-size=
: 16px;font-weight: bold;line-height: 16px;margin: 0px !important;padding: =
0px !important;padding-bottom: 4px !important;">Ihr mytaxi-Team</h3></td>
=09                                                        =09</tr>
=09=09=09=09=09=09=09=09=09=09=09=09=09=09=09</table>
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class=3D"headerfooter" widt=
h=3D"640" height=3D"40" valign=3D"top" bgcolor=3D"#FCFCFC"><img alt=3D"" bo=
rder=3D"0" height=3D"40" src=3D"http://newsletter.somedomain.net/templates/glob=
al/footer.jpg" width=3D"640"></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr style=3D"font-family: Lucida Grande, Arial,=
 sans-serif;">
                                <td style=3D"font-family: Lucida Grande, Ar=
ial, sans-serif;">
                                    <table align=3D"center" border=3D"0" ce=
llpadding=3D"0" cellspacing=3D"0" width=3D"640" style=3D"font-family: Lucid=
a Grande, Arial, sans-serif;border: 0px;margin: 0px !important;padding: 0px=
 !important;">
                                        <tbody style=3D"font-family: Lucida=
 Grande, Arial, sans-serif;">
                                            <tr>
                                                <td align=3D"center" valign=
=3D"top">
                                                    <table border=3D"0" cel=
lpadding=3D"0" cellspacing=3D"0" class=3D"social" style=3D"border: 0px;marg=
in: 0px !important;padding: 30px 0px !important;">
                                                        <tbody>
                                                            <tr>
                                                                <td><a href=
=3D"https://www.facebook.com/mytaxi.de?ref=3Dlogo" target=3D"_self"><img al=
t=3D"facebook" border=3D"0" height=3D"44" src=3D"http://newsletter.mytaxi.n=
et/templates/global/fb.png" width=3D"44"></a></td>
                                                                <td width=
=3D"16">&nbsp;</td>
                                                                <td><a href=
=3D"http://twitter.com/#!/mytaxi" target=3D"_self"><img alt=3D"twitter" bor=
der=3D"0" height=3D"44" src=3D"http://newsletter.somedomain.net/templates/globa=
l/tw.png" width=3D"44"></a></td>
                                                                <td width=
=3D"16">&nbsp;</td>
                                                                <td><a href=
=3D"http://youtu.be/0FWbIC4KdY4" target=3D"_self"><img alt=3D"youtube" bord=
er=3D"0" height=3D"44" src=3D"http://newsletter.somedomain.net/templates/global=
/yt.png" width=3D"44"></a></td>
                                                                <td width=
=3D"16">&nbsp;</td>
                                                                <td><a href=
=3D"https://itunes.apple.com/de/app/mytaxi-fahrgast-taxi-app/id357852748?mt=
=3D8" target=3D"_self"><img alt=3D"apple" border=3D"0" height=3D"44" src=3D=
"http://newsletter.somedomain.net/templates/global/de/appstore_best_of_2012.png=
" width=3D"94"></a></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
=09=09=09=09=09=09=09=09=09=09=09<tr style=3D"font-family: Lucida Grande, A=
rial, sans-serif;">
                                                <td align=3D"center" valign=
=3D"top" class=3D"footer" style=3D"font-family: Lucida Grande, Arial, sans-=
serif;font-size: 10px;color: rgb(191,191,191);line-height: 14px;margin: 0px=
 !important;padding: 0px !important;padding-bottom: 6px !important;">
                                                    Diese E-Mail wurde auto=
matisch erzeugt.
                                                </td>
                                            </tr>
                                            <tr style=3D"font-family: Lucid=
a Grande, Arial, sans-serif;">
                                                <td align=3D"center" valign=
=3D"top" class=3D"footer" style=3D"font-family: Lucida Grande, Arial, sans-=
serif;font-size: 10px;color: rgb(191,191,191);line-height: 14px;margin: 0px=
 !important;padding: 0px !important;padding-bottom: 6px !important;">
                                                =09Intelligent Apps GmbH, G=
esch&auml;ftsf&uuml;hrer: Niclaus Mewes &amp; Sven K&uuml;lper<br>Gro&szlig=
;e Elbstrasse 273, 22767 Hamburg, Deutschland <br/>&copy; 2014 All Rights R=
eserved
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                 </table>
             </td>
             </tr>
             </tbody>
          </table>
      </div>
  </body>

------=_Part_27875_991041197.1394929323292
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=2014-03-49M6J.pdf

JVBERi0xLjQKJeLjz9MKNSAwIG9iaiA8PC9UeXBlL1hPYmplY3QvQ29sb3JTcGFjZS9EZXZpY2VH
cmF5L1N1YnR5cGUvSW1hZ2UvQml0c1BlckNvbXBvbmVudCA4L1dpZHRoIDEyOC9MZW5ndGggMTk4
My9IZWlnaHQgNTEvRmlsdGVyL0ZsYXRlRGVjb2RlPj5zdHJlYW0KeJzFmAtUlEUUgC+wwK67ki4a
CmrrmoAPElEUMZ8IoqK2gIKv1JQUHyQamiYgiLyPgIgioqBg6tFKTTuZlmanfOWLPKhHDd+PUkhX
...
...
MDk2NDkwIDAwMDAwIG4gCjAwMDAxMzg3NzUgMDAwMDAgbiAKMDAwMDE0MDA0NiAwMDAwMCBuIAow
MDAwMTQwMDkxIDAwMDAwIG4gCnRyYWlsZXIKPDwvUm9vdCAxNiAwIFIvSUQgWzw3NGRjMjY2ZDgy
YmMxYjAzYTEwNTIyMGJhNmQwOGMyZD48YmU2ZDU4ODYyZjhlMWViOWU0ZGE0NGRlMjcxZTVhZWQ+
XS9JbmZvIDE3IDAgUi9TaXplIDE4Pj4Kc3RhcnR4cmVmCjE0MDIxMQolJUVPRgo=
------=_Part_27875_991041197.1394929323292--

@hirbod
Copy link
Author

hirbod commented Jan 3, 2017

I've ended up mixing this lib (after patching, added getStream() to return current stream) together with https://github.com/php-mime-mail-parser/php-mime-mail-parser as this lib is rock solid returning attachments without any errors using raw-data.

@Slamdunk Slamdunk added the bug label Sep 22, 2017
@Slamdunk
Copy link
Collaborator

Hi, we would appreciate a lot if you can share the issue on this library you found, and the solutions you took: can you help us?

@Slamdunk Slamdunk mentioned this issue Sep 22, 2017
Slamdunk added a commit that referenced this issue Oct 2, 2017
Exclude HTML from allowed attachment subtype
Close #142
@Slamdunk Slamdunk added this to the 1.0 milestone Oct 2, 2017
@Slamdunk
Copy link
Collaborator

Slamdunk commented Oct 2, 2017

Fixed in #212 thank you for your feedback

@Slamdunk Slamdunk closed this as completed Oct 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants