[Mimedefang] custom function - stripping attachments based on headers

David F. Skoll dfs at roaringpenguin.com
Tue Apr 30 11:13:51 EDT 2002


On 30 Apr 2002 00:37:12 -0500 Terry Davis <tdavis at approbation.org> wrote:

> I want strip out attachments from emails based on the TO and FROM
> headers and run a script with the headers and attachment(s) as
> arguments.

The message headers are in "./HEADERS"

So:

open(HDRS, "<HEADERS");
while(<HDRS) {
        chomp;
        # Do something with header
}
close(HDRS);

Also, the HEADERS file has the headers "unfolded", so you're guaranteed
that each line in the file is a single complete header.

Regards,

David.




More information about the MIMEDefang mailing list