I'm doing this piping php script that fetch the arriving emails and the parse it and show it. I used this tutorial: http://www.damnsemicolon.com/php/parse-emails-in-php-with-email-piping-part-1 (and the following ones), I tried it with a standard email that I had sent to my server and it did work well, but then i tried another and I got a lot of errors. I used the print_r($decoded); to show me all of the different parts of the email and instead of getting a fully parse email, all the content of the emails goes to the $decode[0]['body]; Why is this happening? (I will not post the code cause it's the same as the tutorials)
print_r($decode)= Array (
[0] => Array (
[Headers] => Array ( )
[Parts] => Array ( )
[Position] => 0
[Body] => From jtferreira#teste.local Thu Apr 26 12:33:44 2012 Received: from [192.168.1.92] by ubuntuserver.lan with esmtp (Exim 4.76) (envelope-from ) id 1SNMxE-0000VB-TR for jtferreira#teste.local; Thu, 26 Apr 2012 12:33:44 +0100 Message-ID: <4F993299.8040605#teste.local> Date: Thu, 26 Apr 2012 12:33:45 +0100 From: =?ISO-8859-1?Q?=22Jo=E3o_Ferreira_=28m=E1quina_virtual=29=22?= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: jtferreira#teste.local Subject: Sample Email Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit It's the same?
[BodyPart] => 1
[BodyLength] => 744
)
)
Thanks.
As Mario said, the problem was with the UTF 8-BOM. If anyone have this problem, I recomend you to use this code:
<?php
// substitua pelo caminho para o arquivo que deseja limpar
$file = "C:/wamp/www/wordpress/wp-content/themes/basic-gray/lib/langs.php";
print removeUTF8BOM($file) ? 'BOM removido!' : 'Não havia BOM a ser removido...';
function removeUTF8BOM($fil) {
$newcontent = '';
$first = false;
$fh = fopen($fil, 'r');
while($part = fread($fh, 1024)) {
if(!$first) {
if(preg_match('/^\xEF\xBB\xBF/', $part)) {
$newcontent = preg_replace('/^\xEF\xBB\xBF/', "", $part);
} else {
fclose($fh);
return false;
}
$first = true;
} else $newcontent .= $part;
}
fclose($fh);
$fh = fopen($fil, 'w');
fwrite($fh, $newcontent);
fclose($fh);
return true;
}
?>
(http://www.caugb.com.br/2009/07/remover-o-bom-de-arquivos-em-utf-8/)
Related
Ok, I'm trying, in php, using the imap commands to read emails from a mailbox and then do something with them (doesn't matter what). I'm getting the sending host, the subject and the sender and then the body of the email. If the email is in mime type 'quoted-printable for Text/Html' then I can read it fine using imap_qprint($text). However, if is in mime type '8bit for Text/Html', I try using imap_8bit($text) and still get garbage.
This is the code
<?php
$codes = array("7bit","8bit","binary","base64","quoted-printable","other");
$stt = array("Text","Multipart","Message","Application","Audio","Image","Video","Other");
# Connect to the mail server and grab headers from the mailbox
$mail = imap_open('{remote.nh-group.co.uk:110/pop3}', 'itsupport', 'xxxx');
$headers = imap_headers($mail);
?>
<html>
<head>
<title>Reading a Mailbox including multipart emails from within
PHP</title>
</head>
<body>
<?
$pictures = 0;
$html = "";
# loop through each email
for ($n=1; $n<=count($headers); $n++) {
$header = imap_header($mail, $n);
$st = imap_fetchstructure($mail, $n);
$multi = $st->parts;
$nparts = count($multi);
if ($nparts == 0) {
$html2 .= "* SINGLE part email<br>";
} else{
$html2 .= "* MULTI part email<br>";
}
# look at the main part of the email, and subparts if they're present
for ($p=0; $p<=$nparts; $p++) {
$text =imap_fetchbody($mail,$n,$p);
if ($p == 0) {
$it = $stt[$st->type];
$is = ucfirst(strtolower($st->subtype));
$ie = $codes[$st->encoding];
} else {
$it = $stt[$multi[$p-1]->type];
$is = ucfirst(strtolower($multi[$p-1]->subtype));
$ie = $codes[$multi[$p-1]->encoding];
}
# Report on the mimetype
$mimetype = "$it/$is";
$mimeshow .= "<br /><b>Part $p ... ";
$mimeshow .= "Encoding: $ie for $mimetype</b><br />";
# decode content if it's encoded (more types to add later!)
if ($ie == "8bit") {
$body = imap_8bit($text);
}
if ($ie == "base64") {
$body = imap_base64($text);
}
if ($ie == "quoted-printable") {
$body = imap_qprint($text);
}
# If it's a .jpg image, save it (more types to add later)
if ($mimetype == "Image/Jpeg") {
$picture++;
$fho = fopen("imx/mp$picture.jpg","w");
fputs($fho,$realdata);
fclose($fho);
# And put the image in the report, limited in size
$html2 .= "<img src=/demo/imx/mp$picture.jpg width=150><br />";
}
# Add the start of the text to the message
$shorttext = substr($text,0,8000);
if (strlen($text) > 8000) $shorttext .= " ...\n";
$html2.= nl2br(htmlspecialchars($shorttext))."<br>";
}
echo $mimeshow.'<br>';
$subject=$header->subject;
echo '<br>Subject: '.$subject.'<br>';
echo '<br>Sender: '.$header->senderaddress.'<br>';
$splitheader = get_object_vars($header);
$host=$splitheader[from][0]->host;
echo '<br>Header: '.$host.'<br>';
echo $body.'<br>';
}
?>
</body>
</html>
I have two emails in the inbox. The first is encoded as singlepart 8bit and the second as multipart with quoted-printable
The results are as follows
Part 0 ... Encoding: 8bit for Text/Html
Subject: This is a test for ticket content Ticket #5916 (#5916#)
Sender: NHG & Clinicare IT & T Support
Header: nh-group.co.uk
MIME-Version: 1.0 Received: from hsmx05.antispameurope.com (83.246.65.101) by remote.nh-group.co.uk (192.168.1.19) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 1 Nov 2017 19:03:01 +0000 Received: from delivery.mailspamprotection.com (184.154.208.35) by mx-gate68-hz2.hornetsecurity.com; Wed, 01 Nov 2017 20:03:01 +0100 Received: from ns1.ukm17.siteground.biz ([77.104.173.217] helo=3Dukm17.siteground.biz)=09by se6.mailspamprotection.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)=09(Exim 4.89)=09(envelope-from )=09id 1e9yHu-0004pY-L8=09for it.support#nh-group.co.uk; Wed, 01 Nov 2017 14:02:57 -0500 Received: from [127.0.0.1] (port=3D57646 helo=3Dukm17.siteground.biz)=09by ukm17.siteground.biz with smtp (Exim 4.89_3-0adfb60-XX)=09(envelope-from )=09id 1e9yHt-0003cX-9r=09for it.support#nh-group.co.uk; Wed, 01 Nov 2017 19:02:53 +0000 To: Subject: This is a test for ticket content Ticket #5916 (#5916#) X-PHP-Originating-Script: 1028:class-phpmailer.php Date: Wed, 1 Nov 2017 19:02:53 +0000 From: NHG & Clinicare IT & T Support Reply-To: NHG & Clinicare IT & T Support Message-ID: <8611c203ec1ee6173e753fe4ae3b72c0#corporate.nhg-uk.com> X-Mailer: PHPMailer 5.2.22 (https://github.com/PHPMailer/PHPMailer) X-Mailer: Awesome Support/4.3.2 Content-Type: text/html; charset=3D"utf-8" Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with a= ny abuse report X-AntiAbuse: Primary Hostname - ukm17.siteground.biz X-AntiAbuse: Original Domain - nh-group.co.uk X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ukm17.siteground.biz X-Get-Message-Sender-Via: ukm17.siteground.biz: none X-Originating-IP: 77.104.173.217 X-SpamExperts-Domain: ukm17.siteground.biz X-SpamExperts-Username: 77.104.173.217 Authentication-Results: mailspamprotection.com; auth=3Dpass smtp.auth=3D77.= 104.173.217#ukm17.siteground.biz X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-Evidence: Combined (0.09) X-Recommended-Action: accept X-Filter-ID: EX5BVjFpneJeBchSMxfU5sGO2s1tBb9jz5hUPxV9beEXv9krsgRhBn0ayn6qsU= c7BhTjUfSYCP0C 5wUMIAUTyTj+Ouslq06/9+FJoQ8Ic94JRiSFlfpo3YNCL6gbYMZBRNZBKQKXP9KnqRgOefBfIV= 9l 2lYoidX0QKN0Rp6WDa9d16bf9psWBhnIw8QWTHqFnHl2TRtBFGxCwNLr/WIXTmbEBG2scSEjB4= Cc a3THUkvgvpnunQOsgZPpnjjHtFttCMKZw1tYrnr7rJHHUpEAaqg2HAG29ucnwP0M3OWpRjoXRu= Wz sGtazoE/vPfv1xaxhZcKP/NtHQBPU7HC7F6FoNMf/xm4p5WihZYpa+IEJ/oLosXQp02uZERM5C= VD wD65x9537/7rZ2H1fP4wGxurimbdDoD390nzzgliUnnZRwVrO92GYpEzQCukKCDE/yxRejx+ZE= H8 3D3uT7G9vVxSoPhN0btnfLiBKgWuU86DjRdgvyO/J5YD0SxG9XoKqN48Eo6Fw5tldaeQTD7oX0= Ib JnLsGIY0M3GhDMueGnYVlMD3E51XI8hjMr6/q+SExB92w4mbOkVfblh5aYJR7+ZK4eH0+hutvA= HU mPi9Ge+4V1D7jZKXiOlXLdJnBjsNteQCLP3pDMhin+HwPDUna1dtsRiS8klEbdK8qT/SBsZL7w= 6z GAl0Dy9kR6GQ/UE9MSfeA9Gi3qOpaZFBK5mqSVIqVdOvR+fzwQc+c1DSL3/EWMOJs7x5Cx3mJJ= wS y6OTbpWyPpCPz0F+cvcALILN+oGg/Nnx0s/oQjWWHy7qx4hhxCQ7BHN3temh9QhbVJQq9MPSrP= 7L a/OGl9nRw/r+05rAIG9Wqbj6q4DLIKylFpcDvqmbspbAlPF70Oi5kWG5WrRZ6uKzfnujlezufX= KT FyKo6u83H3djlBrH/4eh02WHu233Y80OmAux3oN13+ztUznegQV1FFKCsIxMyfJ8+4W3u3gmpA= Nv 1DYnwFyGOs036orcJFgN1Xap1jpFsMB9RjtbAFxvtxLn+3ki2FSeoRDxSTwJWw42swm4bO6gac= pM pzImK0dZ8eeB0y9de0/NHY/Z5iLUIRMUDzeIb3XIhs66JoTzHLoQrA7fQYs8PbcVGX4Rd96fmx= 9N Rd596h9beN4f2wGT8e5STWXPcr9VvNyyyTnK4eETwT5QBDJUDAGkO208F/IJRA8ZF8C5AnJBxS= FD JKA40LeuppcmthdVdcHKN13hYPpnTUitS3rpEbXqWxAzJMHFAVLVMimS1MiSrJJu X-Report-Abuse-To: spam#quarantine1.mailspamprotection.com X-antispameurope-sender: tyxanhos#ukm17.siteground.biz X-antispameurope-recipient: it.support#nh-group.co.uk X-antispameurope-MSGID: 3ed646545a31a61c9d2f470be8b360b1-3afa340f6fdab52b50= c154a5acbc7065 X-antispameurope-Mailarchiv: E-Mail archived by www.antispameurope.com for:= it.support#nh-group.co.uk X-antispameurope-Mailarchivtype: inbound X-antispameurope-Virusscan: CLEAN X-antispameurope-disclaimer: This E-Mail was scanned by www.antispameurope.= com E-Mailservice on mx-gate68-hz2 with 03396F0021B X-antispameurope-date: 1509562979 X-antispameurope: INCOMING: X-antispameurope-Connect: delivery.mailspamprotection.com[184.154.208.35],T= LS=3D1;EMIG=3D0 X-antispameurope-detected-infomail: yes X-antispameurope-WC: 10:602:1:10043:0:145:0:0:0:0:0:0:7:2:1:2:3:118:122:143= :0:1:0:0:0:99:0:0:0:4:0:0:0:0:0:0:1:0:0:0:0:1 X-antispameurope-Spamstatus: CLEAN X-antispameurope-REASON: Score:-6.1 =09* 0.0 HTML_MESSAGE BODY: HTML included in message =09* 0.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts =09* -4.3 BAYES_00 BODY: Bayesian spam probability is 0 to 1% =09* [score: 0.0005] =09* -1.9 ASE_FP_2009_01 ASE 2009 negativer Score Return-Path: tyxanhos#ukm17.siteground.biz X-MS-Exchange-Organization-AuthSource: NHS-EX01.nhs.local X-MS-Exchange-Organization-AuthAs: Anonymous
Part 0 ... Encoding: 7bit for Multipart/Alternative
Part 1 ... Encoding: 7bit for Text/Plain
Part 2 ... Encoding: quoted-printable for Text/Html
Subject: test
Sender: Will Evans
Header: tyxan.com
test
--
Will Evans
m: +xxxxxxxx
w: web address
As you can see, the second email $body gives me some normal formatted text I can use. The first however gives me...well, something!
Any thoughts greatly appreciated.
im really struggling now and I dont know what im doing wrong.
I have regex for analyzing imap_body. It works perfectly fine in my test case but completly fails in a function.
Heres the test case:
$type = "base64";
$regex_html = "/(?<=Content-Type: text\/html;).*?(Content-Transfer-Encoding:).*?(".$type.").*?(\);).(.*?)(?= --_)/";
$email = "--_004_AM4PR0901MB1219E3152878394D9F48EFB982BC0AM4PR0901MB1219_ Content-Type: multipart/alternative; boundary="_000_AM4PR0901MB1219E3152878394D9F48EFB982BC0AM4PR0901MB1219_" X-Microsoft-Exchange-Diagnostics: 1;DB6P192MB0231;27:wPFlVOQ8iMAXT+N6591mBRfClfXdhMLmsxh/Y7d1LVbWrHPkVIxvj9+3g1ttW81Vi7Xh16wwzAIakEj5LqQ7s3r7Kr3/lVOL94eT9Ky+Tm+IqokcaiD5Q9lLzBrvUIz0CJDh27WR+m3qUDN87HH0jA== X-Microsoft-Antispam-Mailbox-Delivery: abwl:0;wl:0;pcwl:0;kl:0;iwl:0;ijl:0;dwl:0;dkl:0;rwl:0;ex:0;auth:1;dest:I;WIMS-SenderIP:40.92.69.49;WIMS-SPF:windowslive%2ecom;WIMS-DKIM:windowslive%2ecom;WIMS-822:trojak3d%40windowslive%2ecom;WIMS-PRA:trojak3d%40windowslive%2ecom;WIMS-AUTH:PASS;ENG:(400001000128)(400125000095)(5062000261)(5061607266)(5061608174)(4900095)(4921089)(4950112)(4990090)(102400140)(400001001223)(400125100095)(61617095)(400001002128)(400125200095); --_000_AM4PR0901MB1219E3152878394D9F48EFB982BC0AM4PR0901MB1219_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Microsoft-Exchange-Diagnostics: 1;DB6P192MB0231;27:wPFlVOQ8iMAXT+N6591mBRfClfXdhMLmsxh/Y7d1LVbWrHPkVIxvj9+3g1ttW81Vi7Xh16wwzAIakEj5LqQ7s3r7Kr3/lVOL94eT9Ky+Tm+IqokcaiD5Q9lLzBrvUIz0CJDh27WR+m3qUDN87HH0jA== X-Microsoft-Antispam-Mailbox-Delivery: abwl:0;wl:0;pcwl:0;kl:0;iwl:0;ijl:0;dwl:0;dkl:0;rwl:0;ex:0;auth:1;dest:I;WIMS-SenderIP:40.92.69.49;WIMS-SPF:windowslive%2ecom;WIMS-DKIM:windowslive%2ecom;WIMS-822:trojak3d%40windowslive%2ecom;WIMS-PRA:trojak3d%40windowslive%2ecom;WIMS-AUTH:PASS;ENG:(400001000128)(400125000095)(5062000261)(5061607266)(5061608174)(4900095)(4921089)(4950112)(4990090)(102400140)(400001001223)(400125100095)(61617095)(400001002128)(400125200095); DQoNCkZyb206IFNlcnZpY2VAcGF5cGFJLmNvbSBbbWFpbHRvOmth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mF0aW9uLiBJZiB5b3UgbmVlZCBm dXJ0aGVyIGFzc2lzdGFuY2UsIHBsZWFzZSBjbGljayBDb250YWN0IGF0IHRoZSBib3R0b20gb2Yg YW55IFBheVBhbCBwYWdlLg0KDQpTaW5jZXJlbHksDQoNClBheVBhbA0KDQoNCg0KDQoNCkhlbHAg PGh0dHA6Ly9wYXlwYWwuY29tPiB8IFJlc29sdXRpb24gPGh0dHA6Ly9wYXlwYWwuY29tPiB8IFNl Y3VyaXR5IENlbnRyZTxodHRwOi8vcGF5cGFsLmNvbT4NCg0KUGxlYXNlIGRvIG5vdCByZXBseSB0 byB0aGlzIGVtYWlsLiBUbyBnZXQgaW4gdG91Y2ggd2l0aCB1cywgY2xpY2sgSGVscCAmIENvbnRh Y3QuPGh0dHA6Ly9wYXlwYWwuY29tPg0KDQpDb3B5cmlnaHQgwqkgMTk5OSDigJMgMjAxNyBQYXlQ YWwuIEFsbCByaWdodHMgcmVzZXJ2ZWQuDQoNCkNvbnN1bWVyIGFkdmlzb3J5IC0gUGF5UGFsIFB0 ZS4gTHRkLiB0aGUgaG9sZGVyIG9mIFBheVBhbCdzIHN0b3JlZCB2YWx1ZSBmYWNpbGl0eSwgZG9l cyBub3QgcmVxdWlyZSB0aGUgYXBwcm92YWwgb2YgdGhlIE1vbmV0YXJ5IEF1dGhvcml0eSBvZiBT aW5nYXBvcmUuIFVzZXJzIGFyZSBhZHZpc2VkIHRvIHJlYWQgdGhlIHRlcm1zIGFuZCBjb25kaXRp b25zIGNhcmVmdWxseS4NCg0KUGF5UGFsIFBQWDAwMTg4OToyMTNlZTFiZjYxODdlDQoNCg0KDQoN Cg0KDQo= --_000_AM4PR0901MB1219E3152878394D9F48EFB982BC0AM4PR0901MB1219_ Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: base64 X-Microsoft-Exchange-Diagnostics: 1;DB6P192MB0231;27:wPFlVOQ8iMAXT+N6591mBRfClfXdhMLmsxh/Y7d1LVbWrHPkVIxvj9+3g1ttW81Vi7Xh16wwzAIakEj5LqQ7s3r7Kr3/lVOL94eT9Ky+Tm+IqokcaiD5Q9lLzBrvUIz0CJDh27WR+m3qUDN87HH0jA== X-Microsoft-Antispam-Mailbox-Delivery: abwl:0;wl:0;pcwl:0;kl:0;iwl:0;ijl:0;dwl:0;dkl:0;rwl:0;ex:0;auth:1;dest:I;WIMS-SenderIP:40.92.69.49;WIMS-SPF:windowslive%2ecom;WIMS-DKIM:windowslive%2ecom;WIMS-822:trojak3d%40windowslive%2ecom;WIMS-PRA:trojak3d%40windowslive%2ecom;WIMS-AUTH:PASS;ENG:(400001000128)(400125000095)(5062000261)(5061607266)(5061608174)(4900095)(4921089)(4950112)(4990090)(102400140)(400001001223)(400125100095)(61617095)(400001002128)(400125200095); PGh0bWwgeG1sbnM6dj0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp2bWwiIHhtbG5zOm89InVy bjpzY2hlbWFzLW1pY3Jvc29mdC1jb206b2ZmaWNlOm9mZmljZSIgeG1sbnM6dz0idXJuOnNjaGVt YXMtbWljcm9zb2Z0LWNvbTpvZmZpY2U6d29yZCIgeG1sbnM6bT0iaHR0cDovL3NjaGVtYXMubWlj cm9zb2Z0LmNvbS9vZmZpY2UvMjAwNC8xMi9vbW1sIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv VFIvUkVDLWh0bWw0MCI+PGhlYWQ+DQo8bWV0YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNv bnRlbnQ9InRleHQvaHRtbDsgY2hhcnNldD11dGYtOCI+DQo8bWV0YSBuYW1lPSJHZW5lcmF0b3Ii IGNvbnRlbnQ9Ik1pY3Jvc29mdCBXb3JkIDE1IChmaWx0ZXJlZCBtZWRpdW0pIj4NCjwhLS1baWYg IW1zb10+PHN0eWxlPnZcOioge2JlaGF2aW9yOnVybCgjZGVmYXVsdCNWTUwpO30NCm9cOioge2Jl aGF2aW9yOnVybCgjZGVmYXVsdCNWTUwpO30NCndcOioge2JlaG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3JpdHkgb2YgU2luZ2Fwb3JlLiBVc2VycyBhcmUgYWR2 aXNlZCB0byByZWFkIHRoZSB0ZXJtcyBhbmQgY29uZGl0aW9ucyBjYXJlZnVsbHkuPGJyPg0KPGJy Pg0KUGF5UGFsIFBQWDAwMTg4OToyMTNlZTFiZjYxODdlIDxvOnA+PC9vOnA+PC9zcGFuPjwvcD4N CjwvdGQ+DQo8L3RyPg0KPC90Ym9keT4NCjwvdGFibGU+DQo8L2Rpdj4NCjwvdGQ+DQo8dGQgd2lk dGg9IjE5MCIgdmFsaWduPSJ0b3AiIHN0eWxlPSJ3aWR0aDoxNDIuNXB0O3BhZGRpbmc6MGNtIDBj bSAwY20gMGNtIj48L3RkPg0KPC90cj4NCjwvdGJvZHk+DQo8L3RhYmxlPg0KPC9kaXY+DQo8L3Rk Pg0KPC90cj4NCjwvdGJvZHk+DQo8L3RhYmxlPg0KPC9kaXY+DQo8L3RkPg0KPC90cj4NCjwvdGJv ZHk+DQo8L3RhYmxlPg0KPC9kaXY+DQo8L3RkPg0KPC90cj4NCjwvdGJvZHk+DQo8L3RhYmxlPg0K PC9kaXY+DQo8cCBjbGFzcz0iTXNvTm9ybWFsIj48bzpwPiZuYnNwOzwvbzpwPjwvcD4NCjwvZGl2 Pg0KPC9ib2R5Pg0KPC9odG1sPg0K --_000_AM4PR0901MB1219E3152878394D9F48EFB982BC0AM4PR0901MB1219_-- --_004_AM4PR0901MB1219E3152878394D9F48EFB982BC0AM4PR0901MB1219_ Content-Type: image/jpeg; name="image001.jpg" Content-Description: image001.jpg Content-Disposition: inline; filename="image001.jpg"; size=500; creation-date="Sat, 29 Jul 2017 20:36:56 GMT"; modification-date="Sat, 29 Jul 2017 20:36:56 GMT" Content-ID: Content-Transfer-Encoding: base64 X-Microsoft-Exchange-Diagnostics: 1;DB6P192MB0231;27:wPFlVOQ8iMAXT+N6591mBRfClfXdhMLmsxh/Y7d1LVbWrHPkVIxvj9+3g1ttW81Vi7Xh16wwzAIakEj5LqQ7s3r7Kr3/lVOL94eT9Ky+Tm+IqokcaiD5Q9lLzBrvUIz0CJDh27WR+m3qUDN87HH0jA== X-Microsoft-Antispam-Mailbox-Delivery: abwl:0;wl:0;pcwl:0;kl:0;iwl:0;ijl:0;dwl:0;dkl:0;rwl:0;ex:0;auth:1;dest:I;WIMS-SenderIP:40.92.69.49;WIMS-SPF:windowslive%2ecom;WIMS-DKIM:windowslive%2ecom;WIMS-822:trojak3d%40windowslive%2ecom;WIMS-PRA:trojak3d%40windowslive%2ecom;WIMS-AUTH:PASS;ENG:(400001000128)(400125000095)(5062000261)(5061607266)(5061608174)(4900095)(4921089)(4950112)(4990090)(102400140)(400001001223)(400125100095)(61617095)(400001002128)(400125200095); /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/wAALCAB4AHgBAREA/8QAHwAAAQUBAQEB AQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1Fh ByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZ WmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/9oACAEBAAA/APZqKKKKKKKKKKKKKKKK KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK/9k= --_004_AM4PR0901MB1219E3152878394D9F48EFB982BC0AM4PR0901MB1219_--";
preg_match($regex_html,$email,$return);
print_r($return);
and heres my function:
function multipart_msg_body($inbox, $email_number){
$structure = imap_fetchstructure($inbox, $email_number);
$encoding_type = array("base64","quoted-printable","8bit","7bit","binary");
$message_body_parts = array();
if (array_key_exists(1,$structure->parameters)){
$type = $structure->parameters[1]->value;
if ($type == "multipart/alternative"){
$message = imap_body($inbox, $email_number);
foreach($encoding_type as $type){
$regex_html = '/(?<=Content-Type: text\/html;).*?(Content-Transfer-Encoding:).*?('.$type.').*?(\);).(.*?)(?= --_)/';
$regex_plain = '/(?<=Content-Type: text\/plain;).*?(Content-Transfer-Encoding:).*?('.$type.').*?(\);).(.*?)(?= --_)/';
$body_html = preg_match($regex_html,$message,$html_match);
$body_plain = preg_match($regex_plain,$message,$plain_match);
print_r($html_match);
if ($body_html){
$message_body_parts["html_".$type] = $html_match;
}
if ($body_plain){
$message_body_parts["plain_".$type] = $body_plain;
}
}
print_r($message_body_parts);
}
}
}
Solved:
Different regex was required as imap_body() and print_r(imap_body()) seem to generate a different string to work with.
function multipart_msg_body($inbox, $email_number){
$structure = imap_fetchstructure($inbox, $email_number);
$encoding_type = array("base64","quoted-printable","8bit","7bit","binary");
$message_body_parts = array();
if (array_key_exists(1,$structure->parameters)){
$type = $structure->parameters[1]->value;
if ($type == "multipart/alternative"){
$message = imap_body($inbox, $email_number, FT_INTERNAL);
foreach($encoding_type as $type){
$regex_html = "/(?<=Content-Type: text\/html;).*?(Content-Transfer-Encoding:).*?(".$type.").*?(\);)(.*?)(--_)/s";
$regex_plain = "/(?<=Content-Type: text\/plain;).*?(Content-Transfer-Encoding:).*?(".$type.").*?(\);)(.*?)(--_)/s";
$body_html = preg_match($regex_html,$message,$html_match);
$body_plain = preg_match($regex_plain,$message,$plain_match);
if ($body_html){
$message_body_parts["html_".$type] = $html_match[4];
}
if ($body_plain){
$message_body_parts["plain_".$type] = $plain_match[4];
}
}
return($message_body_parts);
}
}
}
Right, as I suspected, imap_body() is formed slightly different as a variable on its own to what the result of print_r(imap_body()), I've saved the variable into a file and ammended my regex to work with that, all works sweet now.
New regex:
$regex_html = "/(?<=Content-Type: text\/html;).*?(Content-Transfer-Encoding:).*?(".$type.").*?(\);)(.*?)(--_)/s";
hope this helps, a lot easier and possibly quicker way of finding the plain and html body of a multipart imap message. Thanks for all contributions.
I'm trying to list all blobs contained in the 'accidentsPhoto' 'folder' located at the root of the blob container:
// List blobs.
$key = 'accidentsPhoto';
$blobListOptions = new ListBlobsOptions();
$blobListOptions->setPrefix($key);
$blobListOptions->setDelimiter("/");
$blobList = $blobRestProxy->listBlobs($blobContainer, $blobListOptions);
foreach($blobList->getBlobPrefixes() as $key => $blob) {
echo "BlobPrefix ".$key.": \t".$blob->getName()."\n";
}
foreach($blobList->getBlobs() as $key => $blob) {
echo "Blob ".$key.": \t".$blob->getName()."\t(".$blob->getUrl().")\n";
}
Alas, only the key is listed as follows:
Set-Cookie: XXXX
Date: Tue, 15 Aug 2017 12:42:28 GMT
Connection: keep-alive
BlobPrefix 0: accidentsPhoto/
You'll need to remove the following line to list blobs.
$blobListOptions->setDelimiter("/");
I am getting below response from apparel21 api for create person.
HTTP/1.1 201 Created
Cache-Control: private
Location: https://domainName.com.au:8181/retailapi_test/Persons//15668?countryCode=AU
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 10 Aug 2015 07:11:38 GMT
Content-Length: 0
Is there any way using which I can only retrieve person id (15668) form above text ??
Can any one please help.
PHP code:
$hdr_array = http_parse_headers($header);
$str = $hdr_array['Location'];
//$str = 'https://domainName.com.au:8181/retailapi_test/Persons//15668?countryCode=AU';
echo getStringBetween($str , 'Persons//', '?countryCode');
function getStringBetween($str,$from,$to)
{
$sub = substr($str, strpos($str,$from)+strlen($from),strlen($str));
return substr($sub,0,strpos($sub,$to));
}
using these two answers -
https://stackoverflow.com/a/30084266/2857264
https://stackoverflow.com/a/18680847/2857264
You can use parse_url function to explode URL.
Try
$hdr_array = http_parse_headers($header);
$string = $hdr_array['Location'];
//$string = "https://domainName.com.au:8181/retailapi_test/Persons//15668?countryCode=AU";
$personID = parse_url($string, PHP_URL_PATH);
$personID = str_ireplace('/retailapi_test/Persons//', '', $personID);
echo $personID;
Another take on the problem, using preg_split and preg_match etc
$headerlist="
HTTP/1.1 201 Created
Cache-Control: private
Location: https://domainName.com.au:8181/retailapi_test/Persons//15668?countryCode=AU
Server: Microsoft-IIS/7.5
X-AspNetMvc-Version: 3.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 10 Aug 2015 07:11:38 GMT
Content-Length: 0";
$location=false;
$pieces=array_filter( preg_split( '#\n#', $headerlist ) );
foreach( $pieces as $pair ) {
list( $param, $value )=preg_split( '#:\s#',$pair );
if( strtolower( trim($param) )=='location' ){
$location=$value;
break;
}
}
$path=parse_url( $location, PHP_URL_PATH );
preg_match('#\d+#',$path,$matches);
$userid=$matches[0];
echo 'userid:'.$userid;
I'm using the jquery.fineuploader-3.7.0 and Code igniter framework for the server side.
My js code :
$('#manual-fine-uploader').fineUploader({
request : { endpoint: 'declaration/uploadfile'},
autoUpload : false,
template : '<div class="qq-uploader span12">' +
' <pre class="qq-upload-drop-area span12"><span>{dragZoneText}</span></pre>' +
' <div class="qq-upload-button " style="width: auto;">{uploadButtonText}</div>' +
' <span class="qq-drop-processing"><span>{dropProcessingText}</span><span class="qq-drop-processing-spinner"></span></span>' +
' <ul id="qq-upload-list" class="qq-upload-list" style="margin-top:10px; text-align:center;"><li></li></ul>' +
' <ul class="qq-upload-list" style="margin-top: 10px; text-align: center;"></ul>' +
'</div>',
fileTemplate : '<li>' +
' <div class="qq-progress-bar"></div>' +
' <span class="qq-upload-spinner"></span>' +
' <span class="qq-upload-finished"></span>' +
' <span class="qq-upload-file"></span>' +
' <span class="qq-upload-size"></span>' +
' <a class="qq-upload-cancel" href="#">{cancelButtonText}</a>' +
' <a class="qq-upload-retry" href="#">{retryButtonText}</a>' +
' <a class="qq-upload-delete" href="#">{deleteButtonText}</a>' +
' <span class="qq-upload-status-text">{statusText}</span>' +
'</li>',
failedUploadTextDisplay : {
mode : 'custom',
maxChars : 1500,
responseProperty : 'error',
enableTooltip : true
},
text : {
uploadButton : '<color=#2E6E9E><b>Selectionnez le fichier à déposer</b></color>',
failUpload : 'Le chargement a échoué'
} });
$('#triggerUpload').click(function() {
$('#manual-fine-uploader').fineUploader('setParams', {'id_fait':$('#id_fait').attr('value') });
$('#manual-fine-uploader').fineUploader('uploadStoredFiles'); });
My server side response are :
>HTTP/1.0 200 OK
>Date: Fri, 26 Jul 2013 08:12:09 GMT
>Server: Apache/2.2.15 (CentOS)
>X-Powered-By: PHP/5.3.3
>Expires: Thu, 19 Nov 1981 08:52:00 GMT
>Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
>Pragma: no-cache
>Connection: close
>Content-Type: text/html; charset=UTF-8
content :
{"success":true,"file_inner":"<a href='pj\/'116810_116810_cimpa_insertion.xls' target='_blank'>116810_cimpa_insertion.xls<\/a>"}
Under FF, Chrome i have a sucess message on my web page (the green)
but under IE7 or IE8 i have a message who said in my debug bar console:
[FineUploader 3.7.0] Error when attempting to parse iframe upload response ([object Error])
[FineUploader 3.7.0] 'error' is not a valid property on the server response.
and web page error message(the red ).
But the upload are ok (the file are correctly on my server)
I'm a beginner under fine-uploader, could you help me to find where i have make an error please ?
code of the server side:
/**
* uploadfile
* #access public
* #return string
*/
public function uploadfile() {
$post['id_fait'] = $this->input->post('id_fait');
if ( empty($post['id_fait']) ) {
$return['error'] = 'ID_FAIT manquant';
return true;
}
else {
$_FILES['qqfile']['name'] = $post['id_fait']."_".$_FILES['qqfile']['name'];
$config['upload_path'] = DOCUMENT_PATH;
$config['max_size'] = UPLOAD_MAX_SIZE;
$config['overwrite'] = FALSE;
$config['allowed_types'] = ALLOWED_EXT;
$config['remove_spaces'] = FALSE;
$this->load->library('upload', $config);
if ( !$this->upload->do_upload('qqfile')) { $return['error'] = $this->upload->error_msg[0]; }
else {
$data = $this->upload->data();
$post['fichier'] = $data['file_name'];
$insert = $this->db->insert('senla_faits_piece_jointe',$post);
$return['success'] = $insert;
$return['file_inner'] = "<a href='pj/'".$post['id_fait']."_".$data['file_name']."' target='_blank'>".$data['file_name']."</a>";
}
}
echo json_encode( $return, JSON_FORCE_OBJECT );
}
UPDATE :
After i make the change my server response :
HTTP/1.0 200 OK
Date: Fri, 26 Jul 2013 20:21:01 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 124
Connection: close
Content-Type: text/html; charset=UTF-8
and the content :
{"success":true,"file_inner":"<a href=\"pj\/116842_116842_brochure 12.pdf\" target=\"_blank\">116842_brochure 12.pdf<\/a>"}
I have always a red web message who said : upload fail (in french) and this message in my debug bar console :
[FineUploader 3.7.0] Error when attempting to parse iframe upload response ([object Error])
[FineUploader 3.7.0] 'error' is not a valid property on the server response.
Thank a lot for your help
Stéphane
Update 2 after change the content type, always the same problem :
The server response :
HTTP/1.0 200 OK
Date: Sat, 27 Jul 2013 20:14:38 GMT
Server: Apache/2.2.15 (CentOS)
X-Powered-By: PHP/5.3.3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=7riosh2q9edldanjp9vtg4ili3; path=/
Set-Cookie: PHPSESSID=7riosh2q9edldanjp9vtg4ili3; path=/
Connection: close
Content-Type: text/plain; charset=UTF-8
The content :
{"success":true,"file_inner":"<a href=\"pj\/116841_116841_capture_portail_sonacotra.doc\" target=\"_blank\">116841_capture_portail_sonacotra.doc<\/a>"}
I think it's not a problem of content, perhaps it's a problem of IE who can't read the response send by the server across the iframe, but i don't know sufficiently the javascript to find the solution
UPDATE 29/07/2013 :
I have make a test :
If i delete my $return['file_inner']
And i keep only the sucess or error message then that's ok
My $return['file_inner'] are just here because user could be verify the document upload by clicking on the link. But it's not a very important fonction, i could delete it.
Perhaps i have forget something when they are severals attributes in my object "response". or perhaps fine uploader code wait only one attribut.
After having a closer look, there are a few odd properties of your JSON response.
I have very little professional experience with PHP, but I can say that your response content is not correct. You should probably be using json_encode to format your response content. Fine Uploader has an example PHP script that already does this. Perhaps you should have a look.
Either way, your response content should look like this:
{"success":"true","file_inner":"116841_capture_portail_sonacotra.doc"}
Solution by OP.
The solution are in the example php script, my error are to make a url in my object without the htmlspecialchars conversion. With this php code on the server side it's OK
/**
* uploadfile
* #access public
* #return string
*/
public function uploadfile() {
$post['id_fait'] = $this->input->post('id_fait');
if ( empty($post['id_fait']) ) {
$return['error'] = 'ID_FAIT manquant';
return true;
}
else {
$_FILES['qqfile']['name'] = $post['id_fait']."_".$_FILES['qqfile']['name'];
$config['upload_path'] = DOCUMENT_PATH;
$config['max_size'] = UPLOAD_MAX_SIZE;
$config['overwrite'] = FALSE;
$config['allowed_types'] = ALLOWED_EXT;
$config['remove_spaces'] = FALSE;
$this->load->library('upload', $config);
if ( !$this->upload->do_upload('qqfile')) { $return['error'] = $this->upload->error_msg[0]; }
else {
$data = $this->upload->data();
$post['fichier'] = $data['file_name'];
$insert = $this->db->insert('senla_faits_piece_jointe',$post);
$return['success'] = $insert;
$return['file_inner'] = "".$data['file_name']."";
}
}
// log_askel($this->upload);
header('Content-type: text/plain');
echo htmlspecialchars(json_encode($return), ENT_NOQUOTES);
}