procmail log chinese subject

procmail log chinese subject

am 08.09.2005 05:52:12 von cschen

Hi all,
I setup my mail server to log MDA details like


LOGFILE=/var/log/procmail
LOGABSTRACT=all

Now the /var/log/procmail looks like



>From sender@domain Thu Sep 8 11:17:56 2005
Subject:
=?big5?B?xaqo+qq6pUSmrjogpNG8xsBdwXC1uKtLqOdBU01BQi05NDA5MDg tMbi5?=
Folder: /var/mail/recipient
1789


My question is, what should I do for the subject: log that can not show
correct character set?



Thanks in advance

Re: procmail log chinese subject

am 08.09.2005 09:39:33 von Andrzej Adam Filip

cschen@asiaa.sinica.edu.tw writes:

> Hi all,
> I setup my mail server to log MDA details like
>
>
> LOGFILE=/var/log/procmail
> LOGABSTRACT=all
>
> Now the /var/log/procmail looks like
>
>
>
> >From sender@domain Thu Sep 8 11:17:56 2005
> Subject:
> =?big5?B?xaqo+qq6pUSmrjogpNG8xsBdwXC1uKtLqOdBU01BQi05NDA5MDg tMbi5?=
> Folder: /var/mail/recipient
> 1789
>
>
> My question is, what should I do for the subject: log that can not show
> correct character set?

What remedy would you suggest?
e.g. converting sujests/headers to UTF-8

--
Andrzej [en:Andrew] Adam Filip anfi@priv.onet.pl anfi@xl.wp.pl
All that is necessary for the triumph of evil is that good men do nothing
-- Edmund Burke (1729-1797)

Re: procmail log chinese subject

am 08.09.2005 11:33:50 von cschen

Thanks,
If only I can see the subject in CHinese big5

(Subject:
=?big5?B?xaqo+qq6pUSmrjogpNG8xsBdwXC1uKtLqOdBU01BQi05NDA5MDg tMbi5?= )
is indeed a chinese subject. My terminal can show/display chinese well,
but procmail logged something I can not go further.


Cheers
Joshua

Re: procmail log chinese subject

am 09.09.2005 18:58:56 von Andrzej Adam Filip

cschen@asiaa.sinica.edu.tw writes:

> Thanks,
> If only I can see the subject in CHinese big5
>
> (Subject:
> =?big5?B?xaqo+qq6pUSmrjogpNG8xsBdwXC1uKtLqOdBU01BQi05NDA5MDg tMbi5?= )
> is indeed a chinese subject. My terminal can show/display chinese well,
> but procmail logged something I can not go further.

Have you considered using you custom perl script for converting subjects
in procmail log file to encoding you want?

I think it is the easiest option.

--
Andrzej [en:Andrew] Adam Filip anfi@priv.onet.pl anfi@xl.wp.pl
All that is necessary for the triumph of evil is that good men do nothing
-- Edmund Burke (1729-1797)

Re: procmail log chinese subject

am 10.09.2005 17:33:08 von cschen

Dear Andrzej,
Thanks for your reply.
Could you point me further how this work by custom perl script on
procmail? What should I do in a .procmailrc or /etc/procmailrc? Do you
mean adding a recipe like

:0fw
| /some_perl_script


if so, what should be doing in the perl script, and what to do next in
procmailrc to log the subject (which is Chinese Big5 character set)?

Thanks a lot

Joshua

Re: procmail log chinese subject

am 10.09.2005 19:31:17 von AK

cschen@asiaa.sinica.edu.tw wrote:

> Dear Andrzej,
> Thanks for your reply.
> Could you point me further how this work by custom perl script on
> procmail? What should I do in a .procmailrc or /etc/procmailrc? Do you
> mean adding a recipe like
>
> :0fw
> | /some_perl_script
>
>
> if so, what should be doing in the perl script, and what to do next in
> procmailrc to log the subject (which is Chinese Big5 character set)?
>
> Thanks a lot
>
> Joshua
>

SUBJECT=`formail -zx 'Subject:'`
CONVERTED=`echo $SUBJECT | some_perl_script`
:0hfw
|formail -I "Subject: $CONVERTED"

Or you Could first check if the subject is encoded and extract the
subject when it is.


:0
* ^Subject: .big5.
* ^Subject: \/.+$
{
SUBJECT=$MATCH
CONVERTED=`echo $SUBJECT| some_perl_script`

:0hfw
|formail -I "Subject: $CONVERTED"

}

AK