Re: wrong subject encoding in /var/mail/<user>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hiisi wrote:
> pe, 2010-10-29 kello 09:08 -0400, Todd Zullinger kirjoitti:
> <--SNIP-->
> I use this command in a bash script:
> cat |grep Subject:|sed 's/Subject: //g'>$OUTFILE

(UUOC there? ;)

> The script is invoked by procmail. The $OUTFILE consists of something
> like that:
> =?utf-8?B?0YLQtdC80LAg0L/QuNGB0YzQvNCw?=
> I would like the information in it to be readable.
> $OUTFILE encoding is 7bit ASCII characters. Converting it to different
> encoding using iconv does not make any difference. If subject encoding
> is right, how can I recode it to something different?

You need to use a tool than understands RFC 2047 and can decode the
headers.  I'd use python¹ to do this, but that's just my preference.
Many languages should be able to do the job.  Just not a simple cat,
grep, and sed (which, btw, you could replace with one call to awk ;).

¹ http://docs.python.org/library/email.header.html

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Human beings, who are almost unique in having the ability to learn
from the experience of others, are also remarkable for their apparent
disinclination to do so.
    -- Douglas Adams

Attachment: pgpMU0ubHDWdk.pgp
Description: PGP signature

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux