procmail
[Top] [All Lists]

Re: forwarding with attachments

2001-03-07 17:08:14
"Carlos Eduardo R. L. de Miranda" <consultor(_at_)linuxbr(_dot_)com(_dot_)br> 
writes:
Dear Philip,

It isn't clear from the above want you _want_ to happen.  The nested
filtering recipe is almost certainly not want you want, as it inserts
the lines "==================================" into the _header_ of the
outgoing message, but they're not legal header fields, so your message
is probably being munged by later MTAs.

I am not inserting headers but token on the message body.

Nope.  You wrote:

        :0 fhw
        | ( echo "=================================="; \
            echo "From .....: $FROM_"; \
            echo "To .......: $TO_"; \
            echo "Subject ..: $SUBJ_"; \
            echo "==================================" ; \
            cat - )

You're filtering the header of the message, so whatever the command
in the action spits out first will appear at the top of the header,
not the top of the body.  If you put the "cat" command first, or if you
filtered the body instead, then the output of the echo commmands would
appear at the top of the body.


What do you want the new message to look like?  Do you want it to include
the entire original message (including header or not?) and if so, do you
want the text form or do you want it as a MIME attachment?  (Making it
a legal MIME attachment isn't particularly easy.)  What do you _want_?

I want the new message to include the entire original message (including
header) as it was originally received, with the added tokens. The received
attachments should be part of the new message as mime attachment no as text.

Then you're going to need to do several things:

1) come up with a multipart message boundary string that doesn't appear
   in the message.  (If it does, your mail client may catch fire)
2) Put the entire original message (header and body) into the body of a
   new message, wrapped in the boundary line from above in accordance
   with the MIME rules (c.f. RFC 2045).  Any additional content would
   need to appear as a text/plain (or whatever) part, presumably before
   the embedded message.
3) Generate a completely new message header to go with this that includes
   the proper Mime-Version: and Content-Type: fields.

Note that doing this does *NOT* disable any viral content!

Is that really what you want to be sent to 
rivellis(_at_)terra(_dot_)com(_dot_)br?


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>