Re: Email character set conversion in procmail

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Howarth wrote:
> Does anyone have a procmail recipe for email character set
> conversion? I help to run an email newsletter, where people send in
> contributions that get edited together into a single message that is
> then sent out to all the list members. It would be nice if all of
> the incoming messages were in the same character set (e.g. utf8,
> iso-8859-1, whatever) from the point of view of pasting them into a
> single document, but I haven't been able to find a recipe for doing
> this automatically. Any suggestions?

Something piping the mail through iconv or recode is what I'd think
you want.  Here's one I found via google and tweaked a little:

# convert utf to latin (if the subject is translate me)
:0
* ^Subject: translate me$
* ^Content-Type: text/(plain|html); .*charset=.?utf-8
{
    :0 fbw
        |iconv -f UTF-8 -t ISO-8859-1//TRANSLIT

    :0 fhw
        * ^Content-Type: text/plain
        |formail -c -i "Content-Type: text/plain; charset=ISO-8859-1"

    :0 Efhw
        * ^Content-Type: text/html
        |formail -c -i "Content-Type: text/html; charset=ISO-8859-1"
}

Maybe that'll get you started on a good solution.  Or maybe it will
inspire someone that knows much better than I to post a better
solution. :)

It's probably better to go in the other direction, from latin to utf,
as there are bound to be characters in utf that can't get converted to
latin.  But I'm not a charset guru so it's all guesswork for me.

- -- 
Todd        OpenPGP -> KeyID: 0xD654075A | URL: www.pobox.com/~tmz/pgp
======================================================================
Everyone needs to believe in something. I believe I'll have another
beer.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: When crypto is outlawed bayl bhgynjf jvyy unir cevinpl.

iG0EARECAC0FAkRyMkkmGGh0dHA6Ly93d3cucG9ib3guY29tL350bXovcGdwL3Rt
ei5hc2MACgkQuv+09NZUB1opxwCglObJnURvoZ7wuXRlwyMCQF+cpgAAoKiNCZeX
7Yhx5W142q6XaW9NEzPM
=nVlZ
-----END PGP SIGNATURE-----

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux