Delete X- headers through milter ?

  • Follow


Hi, all,

I want to change the existence and delete header in following format:

X-<variable>: 

where <variable> is some arbitrary strings.

I'd like to know if it is possible to do that using milter (either in
C or Perl).  I'm using sendmail 8.12.11.

Would anyone please help?  Thanks.

/ST Wong
0
Reply st-wong (32) 6/9/2004 6:17:18 AM

On Tue, 08 Jun 2004 23:17:18 -0700, ST Wong wrote:

> 
> I want to change the existence and delete header in following format:
> 
> X-<variable>: 
> 
> where <variable> is some arbitrary strings.
> 
> I'd like to know if it is possible to do that using milter (either in
> C or Perl).  I'm using sendmail 8.12.11.

Read the ...
http://www.sendmail.com/partner/resources/development/milter_api/smfi_chgheader.html

Regards

-- 
Lothar Schumacher <lschumacher@acm.org>

0
Reply lschumacher (2) 6/9/2004 6:47:01 AM


On Tue, 08 Jun 2004 23:17:18 -0700 ST Wong wrote:

> I want to change the existence and delete header in following format:
> 
> X-<variable>: 
> 
> where <variable> is some arbitrary strings.

If you use a milter for other purposes too, then I can recommend
MimeDefang. It is very easy to delete such header entries with it. Just a
line

action_delete_all_headers("X-Spam-Level");

in the mimedefang-filter and it deletes in my case the X-Spam-Level header
tags my universities SPAM checker adds.

Alexander


-- 
Alexander Dalloz | Enger, Germany
PGP key valid: made 13.07.1999
PGP fingerprint: 2307 88FD 2D41 038E 7416  14CD E197 6E88 ED69 5653

0
Reply alexander.dalloz (723) 6/9/2004 11:22:38 AM

> On Tue, 08 Jun 2004 23:17:18 -0700 ST Wong wrote:
> 
> I want to change the existence and delete header in following format:
> 
> X-<variable>: 
> 
> where <variable> is some arbitrary strings.

Thanks for all response.  Sorry that I didn't specify the question
correctly.
In the headers of the format, X-<variable>, the <variable> is
arbitrary string which is unknown beforehand, say something like this:

X-RBL-host1.domainA
X-DCC-host2.domainB
....

Thus the milter will have to take care of X-* headers.  Is it possible
to handle such X-* headers using wildcard or regular expressions?

Thanks again.
Best Regards,
/ST
0
Reply st-wong (32) 6/10/2004 1:06:23 AM

ST Wong wrote:

> In the headers of the format, X-<variable>, the <variable> is
> arbitrary string which is unknown beforehand, say something like this:

> X-RBL-host1.domainA
> X-DCC-host2.domainB

Using a milter like MIMEDefang, you can go through all the headers
and delete the ones you don't like.  It can probably be done in 10 lines
of Perl.

Regards,

David.
0
Reply dfs6 (705) 6/10/2004 9:10:44 PM

"David F. Skoll" <dfs@roaringpenguin.com> wrote in message news:<ErOdnTr8ctTJU1XdRVn-iQ@magma.ca>...
> ST Wong wrote:
> 
> > In the headers of the format, X-<variable>, the <variable> is
> > arbitrary string which is unknown beforehand, say something like this:
>  
> > X-RBL-host1.domainA
> > X-DCC-host2.domainB
> 
> Using a milter like MIMEDefang, you can go through all the headers
> and delete the ones you don't like.  It can probably be done in 10 lines
> of Perl.
> 
> Regards,
> 
> David.

Thanks.

Can MIMEDefang delete such changing headers which are unknown
beforehand ?  In other words, does MIMEDefang provide regluar
expression or wild card support in header deletion?  Thanks again.

Regards,
/ST
0
Reply st-wong (32) 6/11/2004 6:47:46 AM

On Thu, 10 Jun 2004 23:47:46 -0700 ST Wong wrote:


> Can MIMEDefang delete such changing headers which are unknown
> beforehand ?  In other words, does MIMEDefang provide regluar
> expression or wild card support in header deletion?  Thanks again.

> /ST

As far as Perl can MimeDefang can :)

Alexander


-- 
Alexander Dalloz | Enger, Germany
PGP key valid: made 13.07.1999
PGP fingerprint: 2307 88FD 2D41 038E 7416  14CD E197 6E88 ED69 5653

0
Reply alexander.dalloz (723) 6/11/2004 8:54:33 PM

ST Wong (st-wong@alumni.cuhk.net) wrote:
: "David F. Skoll" <dfs@roaringpenguin.com> wrote in message news:<ErOdnTr8ctTJU1XdRVn-iQ@magma.ca>...
: > ST Wong wrote:
: > 
: > > In the headers of the format, X-<variable>, the <variable> is
: > > arbitrary string which is unknown beforehand, say something like this:
: >  
: > > X-RBL-host1.domainA
: > > X-DCC-host2.domainB
: > 
: > Using a milter like MIMEDefang, you can go through all the headers
: > and delete the ones you don't like.  It can probably be done in 10 lines
: > of Perl.

: Can MIMEDefang delete such changing headers which are unknown
: beforehand ?  In other words, does MIMEDefang provide regluar
: expression or wild card support in header deletion?  Thanks again.

     Not quite.  What you would do is open a file called "HEADERS" (you
will be placed in the correct directory automatically) and read each
line from it.  When you find a header that starts with "X-", you would
pass that header to action_delete_header().
0
Reply jnemeth (94) 7/7/2004 3:54:25 AM

7 Replies
70 Views

(page loaded in 0.109 seconds)

Similiar Articles:













7/26/2012 2:40:06 PM


Reply: