Re: Header Checks, examples?

This is a discussion on Re: Header Checks, examples? within the mailing.postfix.users forums, part of the Mail Servers and Related category; On Friday 18 February 2005 02:48, Michael Nguyen wrote: > Hmm....maybe I can't do things in the ...


Go Back   Usenet Forums > Mail Servers and Related > mailing.postfix.users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2005
Marshal Newrock
 
Posts: n/a
Default Re: Header Checks, examples?

On Friday 18 February 2005 02:48, Michael Nguyen wrote:

> Hmm....maybe I can't do things in the way that I initially planned,
> but is there anything else I could do using the header_check
> functionality that I have available to me? The situation is like
> this:
>
> - Email comes into a server
> - If the email hasn't already been forwarded to the filtering server
> once, forward it
> - If the email has touched the filtering server, deliver it
>
> We do this with our current MTA by either slapping a header
> (x-sa-scanned) into the message if the header doesn't exist and
> forwarding to the scanner or merely delivering the message if the
> x-sa-scanned header exists.
>
> That part of procedure is unimportant. The general idea of sending
> the email to the scanner if it hasn't been there yet and delivering
> the email if it has been there is what I want to accomplish. I feel
> like Postfix can do this. Does anyone here have any ideas on how I
> could implement this?


That sounds like a job for a content filter (see
http://www.postfix.org/FILTER_README.html) or possibly a delivery agent
such as procmail. Note that using procmail means that outgoing or
forwarded (using aliases) mail will never be scanned. The only time to
do what you want is after the entire email has been received. Any
decent content filter can check for various message characteristics,
including the presence of a header line.

> > So, the expression
> >
> > !/^Subject: / WHATEVER
> >
> > will not match messages that have no Subject line, it will match
> > all messages that contain a header that does not match the
> > expression (i.e. all messages will be matched).

>
> Well....maybe I lack creativity here, but in that case I can't think
> of a single example where !/<pattern>/ would be useful.


I don't use these patterns, but this (crude example) occurs to me:

# subject line checks. ignore forwarded messages.
if /^Subject: /
if !/^Subject: FW /
/evil pattern/ REJECT
endif
endif

# don't ever check received lines
!/^Received: / OK

And keep in mind that OK in header and body checks means skip to the
next line, not accept this message.

--
Marshal Newrock
Ideal Solution, LLC - http://www.idealso.com

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:47 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0