On Wed, Feb 06, 2019 at 01:00:48PM +1100, Cameron Simpson wrote: > On 05Feb2019 22:10, Chris Green <c...@isbd.net> wrote: > > I am getting notification E-Mails from DPD which aren't handled > > correctly by 'auto_view text/html' in my muttrc and 'text/html; lynx > > -dump %s; copiousoutput; nametemplate=%s.html' in .mailcap. > > > > Presumably it's simply that there is no 'text/html' string in the > > headers, I just get to see the raw HTML. In fact there is the > > following:- > > > > ... > > ... > > ... > > Subject: Your order 3179771 is due for delivery by DHL Parcel UK > > Content-Type: multipart/alternative; > > boundary="--boundary_145134_db6b4c85-2751-452f-bf4b-c56010b07587" > > Message-ID: > > <eaa14d01-a923-4fcd-8ff1-88ed5b135...@bh-exch01.business-post.com> > > Status: RO > > Content-Length: 20807 > > Lines: 285 > > > > Content-Type: text/plain; charset="us-ascii" > > Content-Transfer-Encoding: quoted-printable > > > > <!DOCTYPE HTML> > > <html> > > <head> > > <!-- Define Charset --> > > ... > > ... > > ... > > > > So that would explain it! Is there any way to manually ask mutt to > > treat this as text/html? > > Kinda. > > Firstly, is that really the entirely of the relevant headers? No text/html > or multipart/mixed? DHL are really sending HTML notifications (ugh!) > identified as text/plain? That is a new low. > Yes! It's the only message I've ever received (well, I've received a couple of these from DHL recently) which has done this to me. Everyone else's HTML (spit) E-Mail gets fed into Lynx correctly.
> (My previous low is the many senders who send multipart/mixed with either > the HTML duplicated in the text/plain half or outright absent - empty > text/plain half.) > > So: are DHL sending _only_ an text/plain section or both text/plain and > text/html? In my experience it is usually the latter. > There's only the HTML, identified as plain! > Scenario A: Both text/html and text/plain, but the text/plain contains HTML. > I get this a lot. I have this in my muttrc: > Not this I think. > > Scenario B: > > If DHL really are sending HTML in a standalone text/plain body then you've > got 2 choices. > > The first is to act when you receive the email; if you're using procmail or > something similar to file you email you could match these messages and > modify the Content-Type: header to say "text/html". > > The alternative is to match the message with mutt, and to set display_filter > specially for this message. You could use your normal display_filter and use > a message-hook to override it with the command from the mailcap ("lynx > -dump"). > OK, thanks, it's quite rare and, at the moment, only DHL notifications doing this that I actually want to see the content. -- Chris Green