Login   Register  
PHP Classes
elePHPant
Icontem

Possible to unlink SaveBody messages from disk ?

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      MIME E-mail message parser  >  All threads  >  Possible to unlink SaveBody messages from disk ?  >  (Un) Subscribe thread alerts  
Subject:Possible to unlink SaveBody messages from disk ?
Summary:how to get uniqueID to unlink saved message
Messages:16
Author:Pontus Lundin
Date:2013-01-12 06:24:54
Update:2013-01-18 02:06:22
 
  1 - 10   11 - 16  

  11. Re: Possible to unlink SaveBody messages from disk ?   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2013-01-16 05:51:28 - In reply to message 10 from Pontus Lundin
The BodyFile parameter contains the full path of the saved part file. You do not need to concatenate anything to it because it already contains the directory path you specified in the SaveBody parameter.

Concatenating the file names of different parts does not make any sense.

  12. Re: Possible to unlink SaveBody messages from disk ?   Reply   Report abuse  
Picture of Pontus Lundin
Pontus Lundin
2013-01-16 08:02:28 - In reply to message 11 from Manuel Lemos
Well make sense or not isnt really the point of the issue i am having. Its for test purpose. It is ecjoed out in a tinymce editor instead of the actual message. The expected value should contain path from all parts but it doesnt.

It correctly report number of parts. Wihout attachment it will contaon path of the message file. Wiith attachment they are blank. The only path is the one to the attchments.

Thanks

  13. Re: Possible to unlink SaveBody messages from disk ?   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2013-01-16 13:02:25 - In reply to message 12 from Pontus Lundin
The class returns the path of all parts correctly as expected.

If you do not see them, you may be having some other problem.

The test script is not meant to be displayed on Web pages because because the var_dump statements are not escaping characters for Web pages. That may be your problem. Try running the test script on a command line, so you can see it correctly.

  14. Re: Possible to unlink SaveBody messages from disk ?   Reply   Report abuse  
Picture of Pontus Lundin
Pontus Lundin
2013-01-18 00:02:24 - In reply to message 13 from Manuel Lemos
Manuel, so i made ensure the var_dump didn't get escaped by

ob_start();
var_dump($var);
$result = ob_get_clean();
return $result;


Can you please help me understand how to get the path in this array where BodyFile for the message is ?

I mean just doing
foreach($decoded[0]['Parts'] as $part){
thePath=$part['BodyFile'];
}

will only get the attchment path.I dont understand, is it nested when attachment is included? If i just send a plain text message without attachment i can get the BodyFile in the loop above.


Here is the dump of a message which include text and attachment. So we can see, like you said, the BodyFile is indeed included..but how to get all paths (bodyFile)?


array(2) {
[0]=>
array(3) {
["Headers"]=>
array(1) {
["content-type:"]=>
string(60) "multipart/alternative; boundary=14dae9399bd92dddb204d383e69b"
}
["Parts"]=>
array(2) {
[0]=>
array(7) {
["Headers"]=>
array(1) {
["content-type:"]=>
string(30) "text/plain; charset=ISO-8859-1"
}
["Parts"]=>
array(0) {
}
["Position"]=>
int(1822)
["namn"]=>
string(82) "/var/www/vhosts/domain/httpdocs/cemupload/2013/01/17/15693364391"
["BodyFile"]=>
string(82) "/var/www/vhosts/domain/httpdocs/cemupload/2013/01/17/15693364391"
["BodyPart"]=>
int(1)
["BodyLength"]=>
int(634)
}
[1]=>
array(7) {
["Headers"]=>
array(2) {
["content-type:"]=>
string(29) "text/html; charset=ISO-8859-1"
["content-transfer-encoding:"]=>
string(16) "quoted-printable"
}
["Parts"]=>
array(0) {
}
["Position"]=>
int(2533)
["namn"]=>
string(83) "/var/www/vhosts/domain/httpdocs/cemupload/2013/01/17/125115980227"
["BodyFile"]=>
string(83) "/var/www/vhosts/domain/httpdocs/cemupload/2013/01/17/125115980227"
["BodyPart"]=>
int(2)
["BodyLength"]=>
int(1390)
}
}
["Position"]=>
int(1715)
}
[1]=>
array(9) {
["Headers"]=>
array(4) {
["content-type:"]=>
string(33) "image/png; name="icon16_info.png""
["content-disposition:"]=>
string(38) "attachment; filename="icon16_info.png""
["content-transfer-encoding:"]=>
string(6) "base64"
["x-attachment-id:"]=>
string(11) "f_hc2i0ehc0"
}
["Parts"]=>
array(0) {
}
["Position"]=>
int(4126)
["FileName"]=>
string(15) "icon16_info.png"
["FileDisposition"]=>
string(10) "attachment"
["namn"]=>
string(95) "/var/www/vhosts/domain/httpdocs/cemupload/2013/01/17/711240425icon16_info.png"
["BodyFile"]=>
string(95) "/var/www/vhosts/domain/httpdocs/cemupload/2013/01/17/711240425icon16_info.png"
["BodyPart"]=>
int(3)
["BodyLength"]=>
int(908)
}
}

  15. Re: Possible to unlink SaveBody messages from disk ?   Reply   Report abuse  
Picture of Pontus Lundin
Pontus Lundin
2013-01-18 00:50:29 - In reply to message 14 from Pontus Lundin
I finally found out:

foreach($decoded[0]['Parts'][0]['Parts'] as $part){
//find bodyfile in here
}
Is the correct one for the message files.

Thank you for your support and class!

  16. Re: Possible to unlink SaveBody messages from disk ?   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2013-01-18 02:06:23 - In reply to message 15 from Pontus Lundin
Yes, that is a unique name that each body part gets when saved to files.

It is also possible to save those files with the original attachment file names, but it is better to avoid that as the original names may have characters that may be invalid or even insecure.

 
  1 - 10   11 - 16