Path

ez projects / enhancedezbinaryfile / forum / general / boundary is shown in mail b... / re: boundary is shown in ma...


Boundary is shown in mail body as it is

You need to be logged in to post messages in the forums. New users may register here.

Damien MARTIN

Member since:
05 January 2009

Posts: 14

Friday 20 January 2012 3:30:19 pm

Hi Steven,

I hacked the kernel like it is said in `install.txt`.
Files are well uploaded (I can see them on my filesystem).

But the emails are not ok :

--==Multipart_Boundary_8b2e..........
Content-Type:text/plain;charset=utf8
Content-Transfer-Encoding:8bit

Collected informations are [...]

--==Multipart_Boundary_8b2e.........
Content-Type:image/jpeg;
name="=?utf-8?B?VmltLWNsZWFuc2VyLmpwZw==?="
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="=?utf-8?B?VmltLWNsZWFuc2VyLmpwZw==?="

/9j/4AAQSk.......................................................
........................................................................
........................................................................

--==Multipart_Boundary_8b2e.........--

--=--

I can see all the text and base64 encoded files in the body.

Where could it be comes from ?
Up

Steven E. Bailey

Member since:
09 January 2008

Posts: 47

Friday 20 January 2012 4:01:03 pm

Hi Damien,

I'm guessing that the boundary is not being picked up correctly. I'm going to guess that it has something to do with the line endings.

What version of ezpublish are you using and are you using LAMP?
What mail transport, sendmail or SMTP?

What mail client are you using on what OS?

If it's possible can you forward a mail to me?

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Up

Damien MARTIN

Member since:
05 January 2009

Posts: 14

Friday 20 January 2012 5:44:03 pm

What version of ezpublish are you using and are you using LAMP?

I'm using eZ 2011.11 on a GNU/Linux server : Debian with
PHP 5.3.3-7+squeeze3 with Suhosin-Patch

What mail transport, sendmail or SMTP?

sendmail


What mail client are you using on what OS?

I use Mail under MAC OS X 10.6.8


If it's possible can you forward a mail to me?

No problem what is your email address ?
Up

Steven E. Bailey

Member since:
09 January 2008

Posts: 47

Friday 20 January 2012 7:52:10 pm

info@leidentech.com

Macs mail clients sometimes have some weird end-of-line things going on - forward the mail to me and if you can forward it to some other email address you have - like gmail or hotmail or something.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Up

Damien MARTIN

Member since:
05 January 2009

Posts: 14

Monday 30 January 2012 5:46:57 pm

Hi Steven,

I just upgraded to MAC OS X Lion and so updated my Mail client and all is working fine now.

Thanks for your help.
Up

vincenzo pandico

Member since:
14 March 2012

Posts: 5

Wednesday 14 March 2012 12:04:38 pm

Hi,
i have the same problem.
I'm using ezpublish Community Project 2012.2

The file that i want to send by mail is visible in:
var\my_site\storage\original\attachments\application

But when i receive the mail i have

--==Multipart_Boundary_6eceff24f199183026787b4ec5724e7d
Content-Type: application/pdf;
name="=?utf-8?B?UGRmIGRpIHByb3ZhLnBkZg==?="
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="=?utf-8?B?UGRmIGRpIHByb3ZhLnBkZg==?="

JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu.......
........NDlGMTQ3NDlGPl0gL1ByZXYgODEzMzYvWFJlZlN0bSA4MTA2Nj4+DQpzdGFydHhyZWYNCjgxODUy
DQolJUVPRg==

--==Multipart_Boundary_6eceff24f199183026787b4ec5724e7d--

and also the link (to download the file) is not accessible:

http://my_site/index.php/var/plai...6fdfc67ebf55407b3fc1a2107b941db8.pdf

Do you have any suggestion?
Up

Steven E. Bailey

Member since:
09 January 2008

Posts: 47

Wednesday 14 March 2012 1:40:47 pm

Hi Vincenzo,

Are you also using a Mac mail client?

As far as the file goes... get rid of the index.php - are you not using rewrite rules? If you are, then it's not matching on this rewrite rule:

Rewriterule ^/var/[^/]+/storage/.* - [L]

If you aren't using rewrite rules... I would suggest you do. I'm guessing other things don't work?

I haven't tested what should happen if you don't have rewrite rules configured... Hmm. I guess the index.php gets passed to the filename in the database?

Then, I guess, play around with the settings... maybe there is one that will stop the index.php from being added or, it would have to be stripped in enhancedezbinaryfiletype.php.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Up

vincenzo pandico

Member since:
14 March 2012

Posts: 5

Friday 16 March 2012 3:51:55 pm

Sorry but i'm newbie about ezpublish.
I'm not using mac client.
I've checked Rewriterule ^/var/[^/]+/storage/.* - [L] and now the folder is accessible.

What i receive by mail at the moment is a file named 'noname' without any extension.
This is the first problem.

Another question is: what should i do if i want to put a link into the mail for the file download?
The link that is sended with the extension template is a direct link...
Up

Steven E. Bailey

Member since:
09 January 2008

Posts: 47

Friday 16 March 2012 10:49:24 pm

What version of ezpublish are you running and what version of the extension are you running?

Are you using sendmail or something else?

What mail client are you using, have you used multiple mail clients and this behavior is the same for them all?

can you forward one of these broken mails to info@leidentech.com

Link in the mail for file download - what do you mean by that? You want to link to a download template somewhere in the system instead of directly to the file? I don't think that's going to be possible... the nature of the extension is such that it is not using the binaryfile table and is only in the database as content to an information collector so trying to download it like a binary file is not going to work.




Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Up

vincenzo pandico

Member since:
14 March 2012

Posts: 5

Saturday 17 March 2012 5:37:54 pm

I'm using Community Project 2012.2 with enhancedezbinaryfile revision 5.
To send the emails i'm using SMTP and gmail account to receive the mail.

At the moment i'm still receiving mail with no body and attachment named "noname".

i've tried to send the mail to another account (yahoo) and i receive file text (but should be a pdf file) with inside:

--==Multipart_Boundary_2ff7d24a2de9c732dd1e40d794d61dcc
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

Nome e Cognome:

vincenzo
Email:

vincenzo.pandico@gmail.com
Motivo del contatto:
Motivo A
Testo messaggio:


Scheda di adesione:

PdfProva.pdf succesfully uploaded.


http://18.dev.local/var/plain_sit...888047c27e782880de7d1202a1cef23a.pdf



--==Multipart_Boundary_2ff7d24a2de9c732dd1e40d794d61dcc
Content-Type: application/pdf;
name="=?utf-8?B?UGRmUHJvdmEucGRm?="
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="=?utf-8?B?UGRmUHJvdmEucGRm?="

JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFu....
Up

vincenzo pandico

Member since:
14 March 2012

Posts: 5

Saturday 17 March 2012 6:27:05 pm

Just another question.
Is it possible to save the file with specified name in storage\original\attachments instead the default rename?
Up

Steven E. Bailey

Member since:
09 January 2008

Posts: 47

Sunday 18 March 2012 11:31:47 am

It's the SMTP transport. I'm pretty sure if you change the transport to file, you'll get the correct output to the var/log/mail file.

This could be it:
http://projects.ez.no/enhancedezb...tp_has_incorrect_content_type_header
And
http://projects.ez.no/enhancedezbinaryfile/forum/general/works_fine_but

Perhaps changing the line:
$mail->setContentType( "multipart/mixed;boundary=$mime_boundary",false,false,false );
In the kernel hack to:
$mail->setContentType( "multipart/mixed",false,false,false,$mime_boundary );

would help... give it a try.

Does the SMTP transport work for anthing else for that installation?

"save the file with specified name"
You could save the file with the original filename I suppose, but there are a few reasons to not do that:

It will be easy to guess the path to the file even if you don't allow them to see the path to the file. People could also guess stuff... like resume.pdf and get content they shouldn't.

The filename would be determined by what gets sent... which might end up creating weird files in your file system - like with utf16 names on your utf8 system.

The filename would have spaces and punctuation... meaning it probably would need some cleanup otherwise someone can send a file with illegal filename characters for your system.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Up

Steven E. Bailey

Member since:
09 January 2008

Posts: 47

Sunday 18 March 2012 2:47:25 pm

O.k. - I've been able to reproduce this.

It's happening because SMTP is using the Components mail functions. Somewhere - I'm not sure where yet, the Content-Type: multipart/mixed is being changed to Content-Type: text/mixed - this breaks the mail and eveything comes across as if it is all part of the text body.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Up

Steven E. Bailey

Member since:
09 January 2008

Posts: 47

Sunday 18 March 2012 3:59:31 pm

As a hack (an ugly hack):

You can change the genereteHeaders in lib/ezc/Mail/src/parts/text.php to:

public function generateHeaders()
{
if ( substr( $this->subType, 0, 5) == "mixed" ) {
$this->setHeader( "Content-Type", "multipart/" . $this->subType . "; charset=" . $this->charset );
}else{
$this->setHeader( "Content-Type", "text/" . $this->subType . "; charset=" . $this->charset );
}

$this->setHeader( "Content-Transfer-Encoding", $this->encoding );
return parent::generateHeaders();
}

This will force ezcMail to treat the body as multi-part for these mails.

At some point I guess I'm going to have to rewrite the kernel hack to use ezcMail in all cases and use the built-in multipart stuff.

Certified eZPublish developer
http://ez.no/certification/verify/396111

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com

Up

vincenzo pandico

Member since:
14 March 2012

Posts: 5

Tuesday 27 March 2012 9:41:39 am

Thanks!
Yeah the problem was the SMTP.
With sendmail it works without problem. And with the hack it works also with the SMTP.

Thanks again!
Up

You need to be logged in to post messages in the forums. New users may register here.