Stefan Siebert wrote:
I would like to insert text at the beginning of an email body and then
forward the email to another account. For normal ascii emails this is
quite easy. However, for multipart-messages this does not work. The text
is inserted after the header and before the multipart-statement. So at
Hi Stefan,
A couple of questions.
First, are you assured that the first part of a multipart MIME message
shall always be text/plain?
Second, if it's a multipart/alternative MIME message with text/plain
and text/HTML, is it enough to only modify the text/plain part?
The following is a starting point ONLY!! and hasn't been thoroughly
tested. Nevertheless, it attempts to add a text/plain part before the
first part of a multipart/mixed message.
LOGFILE=/dev/tty
VERBOSE=yes
SHELL=/bin/sh
:0
* ^Mime-version:
* ^content-type:.*\<multipart/mixed\>.*boundary=\/.*
{
BDY=$MATCH
:0
* BDY ?? ^^"\/[^"]*
{ BDY=$MATCH }
:0 fbw
| set -x; sed -e 1,/$BDY/s//=_yy$BDY/ -e /=_yy$BDY/i"\\
$BDY\\
Content-Type: text/plain\\
\\
text to be added\\
" -e 1,/=_yy$BDY/s//$BDY/
}
--
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information. Sorry.
Collin Park Not a statement of my employer.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail