#1  
Old 11th May 2005, 12:09
dirk dirk is offline
Junior Member
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Postfix Header Checks

Hi,

I've read that Postfix can perform certain actions on emails based on the contents of the email header (header checks). How do I make my Postfix act like that? For example, I want Postfix to delete all emails that have a spam score (from SpamAssassin) of 15 or more. The header of such emails contains a line like this:

Code:
X-Spam-Level: ***************
Thanks,

Dirk
Reply With Quote
Sponsored Links
  #2  
Old 12th May 2005, 17:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Here's a small introduction on Postfix header (and body) checks:
http://www.postfix.org/header_checks.5.html

Basically you have to do something like this:
Code:
postconf -e 'header_checks = regexp:/etc/postfix/header_checks'
Now create the file /etc/postfix/header_checks and put something like this into it:
Code:
/^X-Spam-Level: \*{15,}.*/      DISCARD
DISCARD will delete all messages with a spam score of 15 and above. You can choose another action than DISCARD, they are listed in the link I posted at the beginning.

Finally, restart Postfix:
Code:
/etc/init.d/postfix restart
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 13th May 2005, 15:10
dirk dirk is offline
Junior Member
 
Join Date: May 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, Falko.
For the REDIRECT action, I need Postfix 2.1 or above?

Dirk
Reply With Quote
  #4  
Old 24th May 2005, 10:28
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Yes, that's true, the REDIRECT action is new in Postfix 2.1.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 11th March 2009, 11:26
Icaro Icaro is offline
Junior Member
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having problems with REDIRECT action in header_checks.
My postfix is version 2.3.8-2+etch1.

In my main.cf I have:

header_checks = regexp:/etc/postfix/header_checks

And the "header_checks" file:

/^To: .*@(?!mydomain\.com>)/ REDIRECT root@mydomain.com

The problem is that the emails are not being redirected, only rejected.
also if I put REJECT "message" instead of REDIRECT the message I put in the REJECT action doesn't appear in the log....so it seems this actions doesn't work well...

Anyone can help me with this?

Thanks in advance and excuse my english.
Reply With Quote
  #6  
Old 12th March 2009, 16:49
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Quote:
Originally Posted by Icaro View Post
The problem is that the emails are not being redirected, only rejected.
What's in your mail log when this happens?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:52.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.