Problem with charset in topics and sender name.

5 posts / 0 new
Last post
#1 Sat, 02/13/2010 - 06:43
moskit
moskit's picture

Problem with charset in topics and sender name.

I have got problem with sendimg mail in usermin. I'm from Poland. In Poland we are using UTF-8 or ISO-8859-2 charset. I don't know how properly set charset in Virtualmin, Webmin and Usermin to don't have problems with characters. The biggest problem I've got with topic of the outgoing mail. When I write an e-mail in MS Outlook 2007 and send it to Usermin account I can read all characters. But when I replay for this letter I will see in Outlook "ê" instead of "ę" etc. I think that even if I set in Usermin ISO-8859-2 charset and the same as Character set for sent mail, E-mails will send with topic and sender name in ISO-8859-1.

How can I change It? My target is to set all charset to UTF-8.

Shoudl I change charset of some config file? Is it possible to add UTF-8 support in English and Polish Translation of Usermin?

I see that Polish translation is a little bit weakly - I can help with it.

moskitos [at] o2.pl

Tue, 11/30/2010 - 07:21
KawMAN

Hi,

I had same problem.

You can make this in 2 ways.

1 way) - fast, less editing but useres cant control charset.
Open file
/usr/share/usermin/mailbox/boxes-lib.pl
Find
my $charset = $params{Charset} || 'ISO-8859-1';
and replace with that
my $charset = $params{Charset} || 'UTF-8';
or similar
Done.

2 way) More editing but user can control this charset by "Mail Preferences => Sending email => Character set for sent mail" value

Open file
/usr/share/usermin/mailbox/send_mail.cgi
Find
$newmid = &generate_message_id($in{'from'});

After in new line add:
%encode_cs = ("Charset", $in{'charset'} || $userconfig{'charset'});

Change all:
&encode_mimewords()
to
&encode_mimewords(, %encode_cs)
in that file

Example:

$mail->{'headers'} = [ [ 'From', &encode_mimewords($in{'from'}, %encode_cs) ],
[ 'Subject', &encode_mimewords($in{'subject'}, %encode_cs) ],
[ 'To', &encode_mimewords($in{'to'}, %encode_cs) ],
[ 'Cc', &encode_mimewords($in{'cc'}, %encode_cs) ],
(...)

Open file
/usr/share/usermin/mailbox/reply_mail.cgi

Find
$newmid = &generate_message_id($from);
After in new line add:
%encode_cs = ("Charset", $in{'charset'} || $userconfig{'charset'});

Change all:
&encode_mimewords()
to
&encode_mimewords(, %encode_cs)
in that file

Done

Fri, 03/02/2012 - 09:06 (Reply to #3)
Aigi

Hi... I have tried both ways you provided but none of them works for me... i have edited /usr/share/webmin/mailbox/ files instead of /usermin/ files.

It is reacting on changes but seems like it just dont know utf-8 character set :(

Can you help me solve this please? Thank you.

Wed, 12/01/2010 - 22:05
08a4210
08a4210's picture

Hi

Couldn't be simpler, Just a function or module in usermin?

Thu, 03/10/2011 - 19:07
webinger

How could i change the charset of the browser for reading mail? I mean some mails are encoded in uft8 some in other charsets - could i also set it according to the charset of an opened mail?

Topic locked