[prev in list] [next in list] [prev in thread] [next in thread] 

List:       alpine-info
Subject:    Re: [Alpine-info] Sending multipart/alternative messages from  pine?
From:       Andreas Schamanek <schamane () fam ! tuwien ! ac ! at>
Date:       2011-10-20 19:38:47
Message-ID: alpine.DEB.2.02.1110202118260.30643_qp2eml_ () wiener ! fam ! tuwien ! ac ! at
[Download RAW message or body]


Hi Josh,

On Mon, 17 Oct 2011, at 12:36, Joshua Miller wrote:

> sending-filters=/full/path/to/change_mime _TMPFILE_ _MIMETYPE_
...
> Could some sort of sending filter take the plain text body, and jack
> it into a multipart/alternative message (adding minor html formatting
> to the text/html part - just <p> tags really)?

I never used sending-filters before and I wanted to see what it does. 
So, thanks for the incentive. What you found was very helpful, and I 
think it might do what you need.

I created a simple shell script htmlme.sh to be used as "sending 
filter" which -- in Alpine's config -- is set to be run as

  /home/schamane/htmlme.sh _MIMETYPE_ _RESULTFILE_

The script simply reads (what you might want to adjust of course):

#!/bin/bash
# Tell Alpine about the new MIME type
echo "Content-Type: text/html; charset=ISO-8859-15" >"$1"
# Print out the message wrapped in HTML tags
echo "<html><body><pre>"
# Read from stdin, convert to HTML, write to stdout
recode ..html
echo "</pre></body></html>"
# Tell Alpine that we are done
echo "htmlme.sh done" >"$2"

This converts the message to text/html. Obviously, it depends on 
"recode" (or any other program) to do the conversion. One might also 
use "cat" if the text is already valid HTML.

This approach does not include a text/plain alternative!
Use at your own risk ;)

-- 
-- Andreas

_______________________________________________
Alpine-info mailing list
Alpine-info@u.washington.edu
http://mailman2.u.washington.edu/mailman/listinfo/alpine-info

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic