CMSimple_XH 1.5.6 Mailform

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

CMSimple_XH 1.5.6 Mailform

Post by cmb » Sat Jan 19, 2013 12:24 am

Hello Community,

yesterday Tata reported problems with mails sent from a plugin. I recommended to use the mail_utf8() from the core's cmsimple/mailform.php. This uses utf8_wordwrap() since CMSimple_XH 1.5.4, which has a bug: it can get in an endless loop, so the script will terminate before the mail can be sent. Consider what that means: a visitor fills out the contact form and writes a somewhat longer message and sends it---but the server responds with a blank screen (500 Internal Server Error) and doesn't actually send the message. :(

In fact I'm not sure, if I'm able to fix the bug. It's getting right tricky there... OTOH utf8_wordwrap() was introduced in mail_utf8() primarily to avoid overlong lines[1]. But for XH 1.6 it was decided to encode the body of the mail as base64. This will wrap the lines to less than 80 characters anyway. So skipping the utf8_wordwrap() seems to be the best solution (at least for now); and probably additionally adding 'format="flowed"' to the "Content-Type".

[1]
RFC 5322 section 2.1.1 wrote:Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.5.6 Mailform

Post by cmb » Sat Jan 19, 2013 10:41 pm

Hello Community,

as I was responsible for the respective modifications for CMSimple_XH 1.5.4 as well as for CMSimple_XH 1.5.6, I have made the necessary changes to avoid calling utf8_wordwrap() and commited that as r440.

This should be thoroughly tested. I don't expect any problems with MTAs, but there might be problems with MUAs (aka. email clients), particularly with very long lines (1000 characters/bytes and above).

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

manu
Posts: 1090
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: CMSimple_XH 1.5.6 Mailform

Post by manu » Mon Jan 21, 2013 8:57 am

Win7 Outlook 2007 :e-mail body with 1300 consecuting MB Characters received without issues.
manu

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: CMSimple_XH 1.5.6 Mailform

Post by cmb » Tue Jan 22, 2013 1:28 pm

Just made some online test on my server (http://3-magi.net/demo/test/?mailform): seems to work fine [1]. If others like to send me a mail, please do so. I'll reply to you, so you can check, if everything is okay. TIA.

[1] Actually I had to replace all "\r\n" with "\n" because of the broken sendmail implementation.
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply