PHP Classes

Emails Send from Mac

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Emails Send from Mac  >  (Un) Subscribe thread alerts  
Subject:Emails Send from Mac
Summary:Script not extracting attachments from Mac emails
Messages:3
Author:Timothy
Date:2010-04-16 21:13:09
Update:2010-06-26 09:20:45
 

  1. Emails Send from Mac   Reply   Report abuse  
Picture of Timothy Timothy - 2010-04-16 21:13:09
First off your script is amazing. Emails are very complex. Much better that mailparse that used to be part of php.

Your help would be much appreciated.

I have a script that was working perfectly until someone with a Mac tried to send a file. I can send an email with the exact same contents and your script does what it is suppose to. I am assuming this is due to the fact that the email was sent from a MAC. I don't get any errors your script just does not recognize that the email has an attachment. Here is the email contents that was sent (I had to replace sensitive info with XXXX but everything else remains intact.

__________________________________________________________________________
Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from smtp006.onecommunications.net (smtp006.onecommunications.net [69.95.226.16])
by gob.XXXXXX.com (Postfix) with SMTP id CAAE5D746EB
for <[email protected]>; Fri, 16 Apr 2010 15:28:47 -0500 (CDT)
Received: (qmail 20048 invoked from network); 16 Apr 2010 20:28:47 -0000
Received: from unknown (HELO ?192.168.2.3?) (66.202.29.195)
by smtp006.onecommunications.net with SMTP; 16 Apr 2010 20:28:47 -0000
From: Bill XXXXXX <[email protected]>
Content-Type: multipart/mixed; boundary=Apple-Mail-13--1062733642
Subject: 4.16.10
Date: Fri, 16 Apr 2010 16:28:45 -0400
Message-Id: <[email protected]>
To: [email protected]
Mime-Version: 1.0 (Apple Message framework v1078)
X-Mailer: Apple Mail (2.1078)


--Apple-Mail-13--1062733642
Content-Disposition: attachment;
filename=MyShippingHistory.csv
Content-Type: text/csv;
name="MyShippingHistory.csv"
Content-Transfer-Encoding: quoted-printable

All labels for 04/16/2010 thru 04/16/2010=0DDate, Trans #, Label #, SCAN =
Form #, Order Type, Service Option, Status, Return Name, Return Address, =
Delivery Name, Delivery Address, Hold For PickUp, Reference Number, =
Weight, Pkg Shape, Pkg Length, Pkg Width, Pkg Height, Pkg Girth, Ship =
Date, Ship from Zipcode, Contents Value, Ins. Fee, Del.Con Fee, Sig.Con =
Fee, Last 4 digits of Credit Card, Amount., PFC/EEL Code =0D=
04/16/2010,166597436,9405 5036 9930 0207 XXXX =
86,#947570169932000367XXXX,Batch Label,PM-SFRB,Credit Card Charged,DEREK =
XXXXXX,XXXX WINCHESTER RD LEXINGTON KY XXXXX-4028,HUGH XXXXXX,XXX S =
AUBURN ST GRASS VALLEY CA XXXXX-7229 US, ,134XXX,3 lbs. 5 ozs., , , , , =
,04/16/2010,40505-4028,$0.00,$0.00,$0.00,$0.00,AMEX-10XX,$4.85,=0D=

--Apple-Mail-13--1062733642--

  2. Re: Emails Send from Mac   Reply   Report abuse  
Picture of labo labo - 2010-06-25 12:49:19 - In reply to message 1 from Timothy
Hello,

i've got the problem too.

the php class thinks that the attachment is the message and the text the attachment.


thanks

  3. Re: Emails Send from Mac   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-06-26 09:20:45 - In reply to message 1 from Timothy
Sorry for the delay. I did not see this message before.

I tried your message disabling the SkipBody option and it seems to work as expected.

I am pasting the test script output so you can tell me if this is what you get. If it is not what you get, you may need to upload the original message file somewhere as binary so I can try and see if the problem is a line break issue.


MIME message decoding successful.
1 message was found.
Message 1:
array(3) {
["Headers"]=>
array(12) {
["return-path:"]=>
string(17) "<[email protected]>"
["x-original-to:"]=>
string(20) "[email protected]"
["delivered-to:"]=>
string(20) "[email protected]"
["received:"]=>
array(3) {
[0]=>
string(198) "from smtp006.onecommunications.net (smtp006.onecommunications.net [69.95.226.16])by gob.XXXXXX.com (Postfix) with SMTP id CAAE5D746EBfor <[email protected]
>; Fri, 16 Apr 2010 15:28:47 -0500 (CDT)"
[1]=>
string(62) "(qmail 20048 invoked from network); 16 Apr 2010 20:28:47 -0000"
[2]=>
string(119) "from unknown (HELO ?192.168.2.3?) (66.202.29.195)by smtp006.onecommunications.net with SMTP; 16 Apr 2010 20:28:47 -0000"
}
["from:"]=>
string(29) "Bill XXXXXX <[email protected]>"
["content-type:"]=>
string(51) "multipart/mixed; boundary=Apple-Mail-13--1062733642"
["subject:"]=>
string(7) "4.16.10"
["date:"]=>
string(31) "Fri, 16 Apr 2010 16:28:45 -0400"
["message-id:"]=>
string(49) "<[email protected]>"
["to:"]=>
string(20) "[email protected]"
["mime-version:"]=>
string(35) "1.0 (Apple Message framework v1078)"
["x-mailer:"]=>
string(19) "Apple Mail (2.1078)"
}
["Parts"]=>
array(1) {
[0]=>
array(7) {
["Headers"]=>
array(3) {
["content-disposition:"]=>
string(41) "attachment;filename=MyShippingHistory.csv"
["content-type:"]=>
string(37) "text/csv;name="MyShippingHistory.csv""
["content-transfer-encoding:"]=>
string(16) "quoted-printable"
}
["Parts"]=>
array(0) {
}
["FileName"]=>
string(21) "MyShippingHistory.csv"
["FileDisposition"]=>
string(10) "attachment"
["Body"]=>
Date, Trans #, Label #, SCAN Form #, Order Type, Service Option, Status, Return Name, Return Address, Delivery Name, Delivery Address, Hold For PickUp, Reference Number, Weight,
Pkg Shape, Pkg Length, Pkg Width, Pkg Height, Pkg Girth, Ship Date, Ship from Zipcode, Contents Value, Ins. Fee, Del.Con Fee, Sig.Con Fee, Last 4 digits of Credit Card, Amount.
04/16/2010,166597436,9405 5036 9930 0207 XXXX 86,#947570169932000367XXXX,Batch Label,PM-SFRB,Credit Card Charged,DEREK XXXXXX,XXXX WINCHESTER RD LEXINGTON KY XXXXX-4028,HUGH XXX
XXX,XXX S AUBURN ST GRASS VALLEY CA XXXXX-7229 US, ,134XXX,3 lbs. 5 ozs., , , , , ,04/16/2010,40505-4028,$0.00,$0.00,$0.00,$0.00,AMEX-10XX,$4.85,
"
["BodyPart"]=>
int(1)
["BodyLength"]=>
int(736)
}
}
["ExtractedAddresses"]=>
array(3) {
["return-path:"]=>
array(1) {
[0]=>
array(1) {
["address"]=>
string(15) "[email protected]"
}
}
["from:"]=>
array(1) {
[0]=>
array(2) {
["address"]=>
string(15) "[email protected]"
["name"]=>
string(11) "Bill XXXXXX"
}
}
["to:"]=>
array(1) {
[0]=>
array(1) {
["address"]=>
string(20) "[email protected]"
}
}
}
}
array(11) {
["Type"]=>
string(4) "text"
["SubType"]=>
string(3) "csv"
["Description"]=>
string(27) "Text file in the CSV format"
["Data"]=>
Date, Trans #, Label #, SCAN Form #, Order Type, Service Option, Status, Return Name, Return Address, Delivery Name, Delivery Address, Hold For PickUp, Reference Number, Weight,
Pkg Shape, Pkg Length, Pkg Width, Pkg Height, Pkg Girth, Ship Date, Ship from Zipcode, Contents Value, Ins. Fee, Del.Con Fee, Sig.Con Fee, Last 4 digits of Credit Card, Amount.
04/16/2010,166597436,9405 5036 9930 0207 XXXX 86,#947570169932000367XXXX,Batch Label,PM-SFRB,Credit Card Charged,DEREK XXXXXX,XXXX WINCHESTER RD LEXINGTON KY XXXXX-4028,HUGH XXX
XXX,XXX S AUBURN ST GRASS VALLEY CA XXXXX-7229 US, ,134XXX,3 lbs. 5 ozs., , , , , ,04/16/2010,40505-4028,$0.00,$0.00,$0.00,$0.00,AMEX-10XX,$4.85,
"
["FileName"]=>
string(21) "MyShippingHistory.csv"
["FileDisposition"]=>
string(10) "attachment"
["Subject"]=>
string(7) "4.16.10"
["Date"]=>
string(31) "Fri, 16 Apr 2010 16:28:45 -0400"
["From"]=>
array(1) {
[0]=>
array(2) {
["address"]=>
string(15) "[email protected]"
["name"]=>
string(11) "Bill XXXXXX"
}
}
["To"]=>
array(1) {
[0]=>
array(1) {
["address"]=>
string(20) "[email protected]"
}
}
["Return-path"]=>
array(1) {
[0]=>
array(1) {
["address"]=>
string(15) "[email protected]"
}
}
}