2009-09-22

mailx implementation that won't barf on UTF-8 encoded GECOS information?

Dear Lazyweb,

I've been having problems with cron jobs that mail their output, because they always manage to garble non-ASCII characters into some unreadable crap.

Upon closer inspection, the real culprit seems to be mailx: no single mailx implementation out there seems to have come to terms with the fact that most contemporary operating systems have their GECOS information encoded in UTF-8, rather than in ASCII.

I had very high hopes for the Heirloom implementation of mailx, except that it, too, fails at encoding mail headers in UTF-8.

I'm thus wondering if there's anything I might have overlooked, perhaps a mailx setting that would enforce encoding of the From, To and Subject lines to UTF-8, or otherwise another mailx implementation that in fact does acknowledge the fact that most operating systems these days have their GECOS information encoded in UTF-8?

4 comments:

Unknown said...

You will probably find that using alpine to send these emails fixes your problem. It's UTF-8 aware.

-- Asheesh.

Unknown said...

Also, as a non-speaker of the language Google uses for your blog, I find it very dificult to comment. (-:

Now I know what the non-English speakers have their life like...

Martin-Éric said...

Installing a MUA does not solve the issue.

I just want a mailx implementation that checks the encoding of /etc/passwd and uses that character-set to encode the From/To/Subject lines, instead of blindly assuming that GECOS only contains ASCII characters would hold true.

Marius Gedminas said...

Do you want to send mail from cron jobs, or do you specifically want to use mailx (and, if so, why?).

Mutt is a MUA that can be used in batch mode to send nicely-encoded Internet-standards-compliant email from scripts.