[BlueOnyx:15025] Re: file to edit encording of Vacation Message

Michael Stauber mstauber at blueonyx.it
Thu Mar 27 09:39:19 -05 2014


Hi Sam,

> Let me ask which file I can edit to change encording of 
> autoresponder messages?

That would be /usr/local/sbin/vacation.pl

> I use BlueOnyx-5108R-CentOS-6.4-20130813 and it has the 
> problem upon auto responder messages with 2-byte characters
> like Japanese.
> 
> I read [BlueOnyx:07322] Re: Auto Responder Message with Japanase
> dated on May 17, 2011. Has anyone solved the topic?

The problem is rather complex, but if you're willing to take a look at
it, then I'm happy to assist.

The problem is as follows:

When you use the GUI to set a vacation message, the transaction is
stored into the CODB database:

cced(smd)[4846]: client 8:[49:23287]: SET  8 . Email "forwardEnable" "="
"0" "vacationMsg" "="
#46#VGVzdDogw7bDpMO8w5bDhMOcw58NCg0KU2NocsO2ZGluZ2VycyBLcsOkdHplLgAA
"forwardEmail" "=" "" "forwardSave" "=" "0" "vacationMsgStart" "="
"1332247620" "vacationMsgStop" "=" "1742474820" "vacationOn" "=" "1"

Object #8 is the "User" Object in CODB and it sets this transaction into
the the subclass "Email".

In CODB it then looks like this:

[root at 5108r ~]# /usr/sausalito/bin/cceclient
100 CSCP/0.80
200 READY
get 8 . Email
102 DATA aliases = ""
102 DATA forwardEnable = "0"
102 DATA NAMESPACE = "Email"
102 DATA vacationMsg = "Test:
\303\266\303\244\303\274\303\226\303\204\303\234\303\237\r\n\r\nSchr\303\266dingers
Kr\303\244tze."
102 DATA CLASSVER = "1.1"
102 DATA forwardSave = "0"
102 DATA forwardEmail = ""
102 DATA vacationMsgStart = "1332247620"
102 DATA vacationMsgStop = "1742474820"
102 DATA vacationOn = "1"
201 OK

The relevant key/value pairs are "vacationOn" which defines if vacation
messages are enabled for this user or not. The key "vacationMsg"
indicates the actual message, which is stored in an encoded fashion in
case the message contains non-ASCII characters such as Unicode or EUC-JP
encoded messages.

The script /usr/local/sbin/vacation.pl is used to create the vacation
email and to update a local database in the users home directory to note
down which senders already got a vacation message. Which that we prevent
that senders receive a vacation message every time they send an email.
They just get one once per week.

That's the basic technical stuff. It works well for English, Danish,
Spanish, French, Italian, German, Portuguese and Dutch.

It doesn't work for Japanese.

The simple reason for that is that we use the MIME::Lite Perl module for
emailing.

See: http://search.cpan.org/~rjbs/MIME-Lite-3.030/lib/MIME/Lite.pm

Which is actually the problem. Because MIME::Lite doesn't support
emailing in Japanese.

There is a separate version of MIME::Lite available which *can* email in
Japanese:

See:
http://search.cpan.org/~horiuchi/MIME-Lite-TT-Japanese-0.08/lib/MIME/Lite/TT/Japanese.pm

I once tried building that Perl Module and it failed horribly. Even if
it would build, the next problem is that it only supports the charset
'iso-2022-jp', which wouldn't help us.

In my understanding there are two doable approaches. But they both
involve converting the EUC-JP stored vacation message into another
charset for the email. Either convert the EUC-JP encoded vacation
message to UTF-8, or convert it to HTML entities and send the Japanese
vacation messages in HTML format.

I think the best way would be to use the Perl module Encode:JP to do this.

See: http://search.cpan.org/~dankogai/Encode-2.57/JP/JP.pm

It can convert between EUC-JP and UTF-8 - in both directions.

Actually ... let me see if I can build that Perl module. If I can build
an RPM for it and if it works, then this whole matter might be easy to fix.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list