Use mime header encoding for all e-mail fields

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
jksrecko
Posts: 5
Joined: Thu Sep 02, 2010 9:45 am
Location: Zagreb, Croatia

Use mime header encoding for all e-mail fields

Postby jksrecko » Fri Sep 03, 2010 9:25 am

Hello,

When we tested OJS (2.2.4.) for our journal, we noticed that non ASCII characters in people's names weren't displayed correctly virtually in any e-mail client.

I have a patch that mime encodes name part of all e-mail fields (From, To, Cc and Bcc), not just the Subject, using String::encode_mime_header function.

The patch has been tested on our production system (we'll register soon), and I'll be happy to provide it, as soon as my two posts are cleared. :) Although the patch is against 2.2.4 version, I think it should apply cleanly on the current head since as far as I can see classes/mail/Main.inc.php hasn't changed.

EDIT: Patch attached!
Attachments
Mail.send.patch
Patch to mime encode all e-mail fields
(2.43 KiB) Downloaded 168 times

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: Use mime header encoding for all e-mail fields

Postby asmecher » Mon May 09, 2011 4:50 am

Hi jksrecko,

Have you tried this with the current 2.3.x release? I believe this has been fixed since OJS 2.2.4. If you like, I can try to track down the relevant Bugzilla entry and linked patch.

Regards,
Alec Smecher
Public Knowledge Project Team

jksrecko
Posts: 5
Joined: Thu Sep 02, 2010 9:45 am
Location: Zagreb, Croatia

Re: Use mime header encoding for all e-mail fields

Postby jksrecko » Mon May 09, 2011 5:07 am

Hi,
When we updated to 2.3.3.2 this still wasn't working. The functionality was moved to lib/pkp though. So, here is the patch against the 2.3.3.2 version.

I've tried searching bugzilla for the patch you mentioned, but couldn't find it. Would you please track it down, so I can review it? Thanks.
Attachments
MailFieldsEncoding.patch
Patch against 2.3.3.2 version.
(2.44 KiB) Downloaded 130 times

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: Use mime header encoding for all e-mail fields

Postby asmecher » Mon May 09, 2011 6:14 am

Hi jksrecko,

You're right -- this doesn't appear to have been fixed. (The issue I was recalling was related only to attachments.) However, are you using SMTP or a local MTA (i.e. is the "smtp" option enabled in your config.inc.php file)? I'm not sure whether this fix will work in both situations and might need some adjustment first.

Regards,
Alec Smecher
Public Knowledge Project Team

jksrecko
Posts: 5
Joined: Thu Sep 02, 2010 9:45 am
Location: Zagreb, Croatia

Re: Use mime header encoding for all e-mail fields

Postby jksrecko » Mon May 09, 2011 6:58 am

We are using SMTP.

asmecher
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm
Contact:

Re: Use mime header encoding for all e-mail fields

Postby asmecher » Mon May 09, 2011 7:21 am

Hi jksrecko,

Thanks -- see http://pkp.sfu.ca/bugzilla/show_bug.cgi?id=6639. The release of OJS 2.3.5 is coming too soon for us to include this, but I'm filing against 2.3.x, which should get attention before OJS 2.4 is released.

Regards,
Alec Smecher
Public Knowledge Project Team

aleskl
Posts: 110
Joined: Mon Apr 11, 2011 7:08 am

Re: Use mime header encoding for all e-mail fields

Postby aleskl » Mon Jan 23, 2012 7:49 am

I have tried the above patch for our 2.3.6 OJS installation and the patch went smoothly. The emails sent out of OJS seem to have UTF-8 encoded characters now, so I hope that fixed our problems with unencoded non-English characters in email headers. We were sending email to one server that rejected this kind of emails, so that was a big problem for us.

Srečko, thank you very much for the fix!


Return to “OJS Development”

Who is online

Users browsing this forum: No registered users and 2 guests