[BlueOnyx:15027] Re: file to edit encording of Vacation Message
Michael Stauber
mstauber at blueonyx.it
Thu Mar 27 12:03:02 -05 2014
Hi Sam,
> Let me ask which file I can edit to change encording of
> autoresponder messages?
To follow up on my last message: I just looked at this problem again and
I think I have it fixed now. I just submitted the changes to SVN and YUM
updates will be available later today:
http://devel.blueonyx.it/trac/changeset/1369/
It's a bit more complicated than I thought. My work around now does this:
When you use the GUI to create/modify a vacation message, the actual
vacation message is stored in CODB and is also written off as file to
the users home directory as .vacation_msg.
Usually the text in there is in UTF-8 format. For Japanese vacation
messages it was garbled, corrupted and didn't make any sense. The first
step of my fix now makes sure that Japanese vacation messages are
converted from EUC-JP to UTF-8 before storing them in ~user/.vacation_msg
The second step involved modifying /usr/local/sbin/vacation.pl. Although
the message body with the actual vacation message is now in UTF-8
encoding, in a Japanese vacation message the Subject is still in EUC-JP,
which we cannot mail. So again I used Encode:JP to decode the subject
from EUC-JP to UTF-8. Still, these emails were not perfect, as a subject
with non ASCII characters needs MIME-Encoding. So I also needed to
encode the UTF-8 Subject into MIME-Encoding.
A resulting vacation message in Japanese now will look like this:
-------------------------------------------------------
Return-Path: <site1_admin at 5108r.smd.net>
Received: from 5108r.smd.net ([208.67.251.187])
Received: (from site1_admin at localhost)
Message-Id: <201403271621.s2RGLgIZ009410 at 5108r.smd.net>
MIME-Version: 1.0
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME::Lite 3.027 (F2.77; T1.28; A2.04; B3.08; Q3.08)
Date: Thu, 27 Mar 2014 17:21:42 +0100
From: Site1 Admin <site1_admin at 5108r1.smd.net>
To: mstauber at blueonyx.it
Subject: Site1 Admin <site1_admin at 5108r1.smd.net>
=?UTF-8?B?IOOBi+OCieOBruiHquWLleW/nOetlA==?=
私は休暇中です。
-------------------------------------------------------
In the raw email the subject looks like this due to the MIME-Encoding:
Site1 Admin <site1_admin at 5108r1.smd.net>
=?UTF-8?B?IOOBi+OCieOBruiHquWLleW/nOetlA==?=
But an email client will display it as this:
Site1 Admin <site1_admin at 5108r1.smd.net> からの自動応答
So I think that should fix it.
--
With best regards
Michael Stauber
More information about the Blueonyx
mailing list