Cameron Simpson wrote:

> On 16Jul2015 13:02, Chris Down <ch...@chrisdown.name> wrote:
> >I eventually worked this out[0].
> >
> >I had previously tried using a message-hook to set
> >alternative_order, but that didn't work because I didn't realise
> >that alternative_order *appends*, it doesn't overwrite the existing
> >alternative_order.
> >
> >So, the basic solution is to call unalternative_order every time
> >before the message-hook is executed.
> >
> >0: https://github.com/cdown/dotfiles/commit/c5927d
> 
> Yep.
> 
> Just FYI, this is mine:
> 
>    message-hook . 'unalternative_order *; alternative_order text/plain 
> text/html'
>    message-hook '~h "X-Mailer: Apple Mail" ~X 1-' 'unalternative_order *; 
> alternative_order text/html multipart/mixed text/plain'
>    message-hook '%f htmlers | ~f @no-re...@cc.yahoo-inc.com | ~f
> @outlook.com | ~f live.com | ~f @facebookmail.com'
> 'unalternative_order *; alternative_order text/html text/plain'
> 
> In particular, I maintain a mutt group "htmlers" to track specific
> senders which send useless plain text components. Keeps the condition
> readable.
> 
> Cheers,
> Cameron Simpson <c...@zip.com.au>
> 
> The optimist proclaims that we live in the best of all possible worlds;
> the pessimist fears this is true. - Branch Cabell, The Silver Stallion

another approach is to automatically run emails through a filter
that replaces multipart/alternative + text/plain + text/html attachments
with just the text/html attachment if the text/plain attachment is empty
or contains the phrase: 

  Your email client does not support HTML email

the attached perl script can be used with procmail to achieve this without the
need to know in advance who uses email clients that don't understand the
meaning of the word "alternative".

but it is drastic in that it modifies the emails before you see them.
you might see that as overkill and you'd probably be right. :-)

cheers,
raf

Attachment: textmail-htmlonly.gz
Description: Binary data

Reply via email to