[Alpine-info] Sending multipart/alternative messages from pine?
Andreas Schamanek
schamane at fam.tuwien.ac.at
Thu Oct 20 12:38:47 PDT 2011
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
More information about the Alpine-info
mailing list