procmail
[Top] [All Lists]

Re: How to extract from message body and rewrite headers

1996-05-23 14:55:05
Bill Jenuwine <wjenuwin(_at_)ford(_dot_)com> writes:
I Must deal with a corporate mainframe (PROFS) email system as well as
my unix email system.  I have the ability to forward email received on
the mainframe to unix, but the mainframe email headers are not
preserved (although they do appear in the message body) and the
message (as seen on unix) looks like it came from me on the mainframe.

I would like to have procmail massage the email and restore the
correct headers by extracting them from the body.  I have done some
simpler procmail recipes, but could use some help on where to start
with this problem.

It would alot easier to help if you included an example of what procmail
will be processing.  If the real headers were the first thing in the
body that procmail sees, then something like this should work:


# If this is from my account on the mainframe and the body has a "From:"
# line, then copy the current header ('1,/^$/d') as well as any other
# leading blank lines ('/^./,$!d').
:0
* ^From(_dot_)*me(_at_)the(_dot_)mainframe
* B ?? ^From:
| sed -e '1,/^$/d' -e '/^./,$!d'


Philip Guenther

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