Problem with charset in topics and sender name.

  • moskit
  • 02/13/10
  • Offline
Posted: Sat, 2010-02-13 06:43

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


Hi,I had same problem.You

  • KawMAN
  • 11/30/10
  • Offline
  • Tue, 2010-11-30 07:21

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(<something>)
to
&encode_mimewords(<something>, %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(<something>)
to
&encode_mimewords(<something>, %encode_cs)
in that file

Done


Hi Couldn't be simpler, Just

  • 08a4210
  • 11/07/10
  • Offline
  • Wed, 2010-12-01 22:05

Hi

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


How could i change the

  • webinger
  • 07/24/07
  • Offline
  • Thu, 2011-03-10 19:07

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?