Rejo Zenger wrote:

> ++ 20/01/14 21:40 +0100 - Jan-Herbert Damm:
> >i would like to send an automatic answer to html-mails sent to me (because 
> >i'm
> >tired of writing back that i prefer plain-text).
> >
> >I am aware that this is hardly an issue of mutt, but rather procmail
> >or scripting. But i am curious how this could be approached. 
> 
> Procmail would suffice and definately for a rudimentary filter:
> 
>  :0
>  * ^Content-type: text/html
>  * ! ^X-Loop: autoreply_because_html
>  | (formail -rt \
>         -A"Precedence: junk" \
>         -A"X-Loop: autoreply_because_html" ; \
>         cat $HOME/body_of_autoreply.txt) | $SENDMAIL -t
> 
> Or something along those lines. Untested. 
> 
> Procmail has lots of example in the procmailex manpage as well as on the 
> internet. 
> 
> -- 
> Rejo Zenger . <r...@zenger.nl> . 0x21DBEFD4 . <https://rejo.zenger.nl>
> GPG encrypted e-mail preferred . +31.6.39642738 . @rejozenger

this recipe will also fire on emails that contain a multipart/alternative
part containing plain text and html alternatives and so would not be ideal
as mutt will hapily display the text alternative. i expect that
distinguishing such emails from ones that only contain html would take more
effort in procmail-land. better ask a procmail expert.

an alternative is to use procmail and textmail to automatically convert html
emails into plain text on their way into your inbox. the following procmail
recipe just translates html emails into plain text.

  :0 fw
  | textmail -WERPULIAVXBS

it's probably wiser for the recipe to put a copy of the original email
somewhere first.

textmail is available from http://raf.org/textmail/ and it'll need perl and
mktemp and lynx to be installed (and other things if you use its other 
features).

cheers,
raf

Reply via email to