Regional Subject

Questions and answers about how to do stuff
Post Reply
templier
Posts: 10
Joined: 02 Oct 2014 18:33

Regional Subject

Post by templier »

Hi.
I from Russia. In recent messages i see subject as " ðÒÏ×ÅÒËÁ ÒÁÂÏÔÙ ÁÎÔÉÓÐÁÍ-ÆÉÌØÔÒÏ×"
How i can fix it and see our russian subjects with cyrillic?
templier
Posts: 10
Joined: 02 Oct 2014 18:33

Re: Regional Subject

Post by templier »

I suspect that i need to change MySQL Database Collation.
I think that i have user - mailwatch.
Where i can to know password?
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Regional Subject

Post by shawniverson »

templier
Posts: 10
Joined: 02 Oct 2014 18:33

Re: Regional Subject

Post by templier »

http://linuxplayer.org/2011/08/add-utf8 ... atch-1-0-5
I fix only Mailwatch.pm.
Also i fix Collation of table maillog, Database and Mysql to utf8.
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Regional Subject

Post by shawniverson »

niklausbg
Posts: 1
Joined: 14 Oct 2014 05:57

Re: Regional Subject

Post by niklausbg »

Hi Team,

I need a litle help about patching file 'details.php'.
I used that link http://linuxplayer.org/2011/08/add-utf8 ... atch-1-0-5

point 1.) patch Mailwatch.pm successfully, but point 2.) patch mailscanner/detail.php) is not :(

patching file detail.php
Hunk # 1 FAILED at 147.
Hunk # 2 FAILED at 155.

Best regards,
Nikolay
mikhail_dv
Posts: 2
Joined: 05 Dec 2014 08:03

Re: Regional Subject

Post by mikhail_dv »

Migration from CP1252 ISO 8859-1 Latin-1 to UTF-8 | Миграция

I add to my.cnf

Code: Select all

[mysqld]
character-set-server = utf8
collation-server = utf8_unicode_ci

Code: Select all

# from tools https://github.com/mailwatch/1.2.0/tree/master/tools/UTF8_Database
# from file upgrade_mysql_db_to_utf8.sql

mysql -u mailwatch -p`cat /etc/EFA-Config|awk -F: '/MAILWATCHSQLPWD/ {print($2)}'`
use mailscanner;
ALTER DATABASE `mailscanner` CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
ALTER TABLE `audit_log` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `blacklist` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `inq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `maillog` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `mcp_rules` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `mtalog` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `outq` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `sa_rules` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `saved_filters` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `spamscores` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `user_filters` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `users` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `whitelist` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
-- Added by Me:
ALTER TABLE `geoip_country` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE `mtalog_ids` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
-- to test - must be CHARSET=utf8 | для теста, таблица в utf8
show create table maillog;
exit


# install support mb-string functions
yum install php-mbstring
service httpd reload

yum install cpan
cpan
install Encoding::FixLatin
And finally changes by request https://github.com/mailwatch/1.2.0/pull/130/files
I patch this files
MailWatch.pm
mailscanner/detail.php
mailscanner/functions.php
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Regional Subject

Post by shawniverson »

Excellent! :D I will work on this for the update.
Glaster
Posts: 11
Joined: 10 Dec 2014 21:29

Re: Regional Subject

Post by Glaster »

I successfully changed the encoding to UTF-8 using the procedure of mikhail_dv, but when I view the entire contents of e-mail, there are still question marks instead of some characters.
File viewmail.php not be edited.

Does anyone have any idea how to fix this too ??

Thanks
mikhail_dv
Posts: 2
Joined: 05 Dec 2014 08:03

Re: Regional Subject

Post by mikhail_dv »

viewmail.php and viewpart.php deep depends on lib/pear/Mail/mimeDecode.php and other files...
Update mimeDecode.php from 1.5.5 to 1.6.0 (dev ver) not success. http://pear.php.net/package/Mail_mimeDecode
Glaster
Posts: 11
Joined: 10 Dec 2014 21:29

Re: Regional Subject

Post by Glaster »

This means that, at this moment it is not possible to correct charset in the file viewmail.php ??? (full message text)

It would help me fix charset in the Quarantine report or in e-mails generated by the EFA (eg. {Spam not delivered} ...subject...)

Thanks
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Regional Subject

Post by pdwalker »

shawniverson wrote:Excellent! :D I will work on this for the update.
Shawn,

If we attempt to "fix" this now using the suggested changes, will this cause a problem with the 3.1.0.0 update? Or would it be safest just to wait?

(for what it's worth, I'll be dealing with a lot of UTF8, GB2312 and possibly BIG5 encoded messages)

- Paul
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Regional Subject

Post by shawniverson »

Problem is already fixed upstream in the MailWatch project, I believe. We just need to simply do a MailWatch update...
templier
Posts: 10
Joined: 02 Oct 2014 18:33

Re: Regional Subject

Post by templier »

Hi
Now I have the exact same problem with a fresh install of v3.0.8.
Mysql didn't be fixed in distrib, but mailwatch/mailscanner were fixed.

I have russian subject in web interface, but spam notification has unreadable subject in it.
For example, "{Spam not delivered} Íîâûå "çàðïëàòíûå" ñõåìû, íîâûå ñõåìû ëåãàëüíîãî ôîðìèðîâàíèÿ "êîìïåíñàöèîííûõ ïàêåòîâ". 22_03_2015 01_04 57718"
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Regional Subject

Post by pdwalker »

templier

Look at this post. See if those two commands solve your problem.
templier
Posts: 10
Joined: 02 Oct 2014 18:33

Re: Regional Subject

Post by templier »

No, this commands don't help me.
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Regional Subject

Post by shawniverson »

templier,

I am wondering if MailScanner is having a little trouble with unicode...

Can you share the subject as it should appear?
templier
Posts: 10
Joined: 02 Oct 2014 18:33

Re: Regional Subject

Post by templier »

This is original Subject: "Браслет Steel Rage для настоящих мужчин! Когда каждая деталь играет роль..."
This is Subject from Mailscanner: "{Spam not delivered} Áðàñëåò Steel Rage äëÿ íàñòîÿùèõ ìóæ÷èí! Êîãäà êàæäàÿ äåòàëü èãðàåò ðîëü..."
templier
Posts: 10
Joined: 02 Oct 2014 18:33

Re: Regional Subject

Post by templier »

spam.PNG
spam.PNG (3.37 KiB) Viewed 12694 times
User avatar
shawniverson
Posts: 3644
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Regional Subject

Post by shawniverson »

Post Reply