[Mimedefang] Header rewriting in Mime::Parser

Mark admin at asarian-host.net
Mon Feb 7 10:10:08 EST 2005

> -----Original Message-----
> From: mimedefang-bounces at lists.roaringpenguin.com 
> [mailto:mimedefang-bounces at lists.roaringpenguin.com] On 
> Behalf Of David F. Skoll
> Sent: maandag 7 februari 2005 16:00
> To: mimedefang at lists.roaringpenguin.com
> Subject: Re: [Mimedefang] Header rewriting in Mime::Parser
> On Mon, 7 Feb 2005, Mark wrote:
> > Maybe a stupid question, but using Mime::Parser, how do I 
> > change a header?
> You don't; you use action_change_header instead.  See the
> mimedefang-filter(7) man page.

Thank you for your quick reply. I saw something like:

$head->replace('content-type', 'text/plain; charset=US-ASCII');

Now, in a Milter API, you can add a third parameter, the
Nth occurance of the header field. I see no such option
in "action_change_header". The idea was to use
$entity -> head -> as_string, split it in an array, and use
$head->replace to regex over all fields. Except, I cannot seem
to fathom how to deal with multiple instances of a header field.


- Mark

More information about the MIMEDefang mailing list