Fixing unreadable email with mutt and vim
Mutt is my mail client of choice. The reasons are simple: It...
And the tip of the day -- how to fix unreadable (as in -- mojibake mail) to be readable again.
If the subject of the mail is also unreadable, do the following:
- is fast
- is usable from the command line (a big plus)
- lets you do essentially anything to a message
- supports hooks for very flexible configuraiton
And the tip of the day -- how to fix unreadable (as in -- mojibake mail) to be readable again.
- Highlight the mail in the index and press "e". This will fire up your editor (vim in my case) and load the full mail in it.
- Find the "Content-Type" header. Edit the value of the "charset" field on the line. If there is no such header just add one:
Content-Type: text/plain; charset="iso-2022-jp"
If the subject of the mail is also unreadable, do the following:
- Install maildrop
- Select the Subject line and pass it to this command
cat | xargs -ifoo reformime -h "foo" | iconv -f iso-2022-jp -t utf8 | xargs -ibar reformime -o "bar" -c utf8
. In vim speak, this means- /^\csubject:
- Shift-V!cat | xargs -ifoo ...
- Play around with the charsets if you're not getting correct results.
Comments
Post a Comment