procmail
[Top] [All Lists]

Re: Grab all headers as a variable

2001-08-01 09:46:10
* Kip Turk <kipt(_at_)wcc(_dot_)net> [010725 18:13]:

I'd like to add the original headers when I warn a sender that I denied
their message due to a virus.  I know it's quite trivial to pass just the
headers, but I can't find a simple way to store them all.  Here's the jist
of what I'm after:

:0
< various checks >
{
        :0h
        | (formail -r -I "Subject: Virus/Worm Infection"; \
        echo "You recently sent a message to one of our users that contained 
a virus."; \
        echo "The headers of your original message were: "; \
        echo "$VAR"; \
        echo "To clean the virus, please see $PAGE"; \
        ) | /usr/sbin/sendmail -t
        /dev/null
}

I see it dropping in to the last recipe properly, but I can find an easy
way to throw in the old headers at $VAR.  Everything I checked showed
breaking the headers out singly into variables.  Is this the only way to
go about it?  I also found how to drop the headers into a file and cat
that into the message, but then I'm forced to spawn another process to
wipe the file after each message.

Does something like this not work?

HEADERS=`| formail -X ""` 

-- 
- Matt Dunford <> zoot(_at_)zotikos(_dot_)com ..
-. www.zotikos.com -- o,;-
        
I want to see people using Perl to glue things together creatively, not
just technically but also socially.
  -- Larry Wall in <199702111730(_dot_)JAA28598(_at_)wall(_dot_)org>
--
_______________________________________________
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>