Post Reply  Post Thread 
[HowTo] Selective greylisting
Author Message
rbtux
Member
***


Posts: 1,200
Group: Registered
Joined: Feb 2007
Status: Away
Reputation: 22
Post: #1
[HowTo] Selective greylisting

Hi there

this howto describes how to use greylisting within postfix only für unknow host or hostname that looks like they are coming out of dynamic ip ranges.

1. Install postfix pcre package

Quote:
> apt-get install postfix-pcre


2. Create new file /etc/postfix/dynip.pcre
EDIT: Attention the long regex is one single line!!!

Quote:
# everything with 4 or more dots/hyphens in the hostname
/(\-.+){4}$/ rc_greylisting
/(\..+){4}$/ rc_greylisting

# some well known dynamic patterns
/(^|[0-9.x_-])(abo|br(e|oa)dband|cabel|(hk)?cablep?|catv|cbl|cidr
|d?client2?|cust(omer)?s?|dhcp|dial?(in|up)?|d[iu]p|[asx]?dsld?|dyn(a(dsl|mic)?)?
|home|in-addr|modem(cable)?|(di)?pool|ppp|ptr|rev|user|YahooBB[0-9]{12}
|c[[:alnum:]]{6,}(\.[a-z]{3})?\.virtua|[1-9]Cust[0-9]+|AC[A-Z][0-9A-F]{5}\.ipt
|pcp[0-9]{6,}pcs|S0106[[:alnum:]]{12,}\.[a-z]{2})[0-9.x_-]/ rc_greylisting

# systems without a hostname
/^unknown$/ rc_greylisting


3. Change the main.cf

Add

Quote:
smtpd_restriction_classes = rc_greylisting

rc_greylisting = check_policy_service inet:127.0.0.1:60000


Change in the smpd_recipient_restrictions:

Quote:
check_policy_service inet:127.0.0.1:60000


to

Quote:
check_client_access pcre:/etc/postfix/dynip.pcre


4. Thats it


OS: Debian Lenny
ispCP Version: Trunk r1033
Activated: AWStats dynamic, Dovecot, Avelsieve, Selective Greylisting, Bogus MX Filter,
No Webtools, Roundcube, Some own modifications

This post was last modified: 11-12-2007 12:51 AM by rbtux.

11-12-2007 12:13 AM
Visit this user's website Find all posts by this user Quote this message in a reply
gOOvER
Documentation Team
***
Docu Team

Posts: 1,283
Group: Docu Team
Joined: Jul 2007
Status: Offline
Reputation: 11
Post: #2
RE: [HowTo] Selective greylisting

How change this Code if i have 904 installed Smile

Code:
rc_greylisting = check_policy_service inet:127.0.0.1:60000


Have i change it to

Code:
rc_greylisting = check_policy_service inet:127.0.0.1:60000,
                      permit


????


OS : Debian 4.0 Etch 64bit
ispCP Version : RC6 r1257 - 01.07.08 (NightlyBuild)
Activated : AWStats dynamic
Mods : none
->SmileThis Signature is OpenSourceSmile<-
11-17-2007 09:33 AM
Visit this user's website Find all posts by this user Quote this message in a reply
rbtux
Member
***


Posts: 1,200
Group: Registered
Joined: Feb 2007
Status: Away
Reputation: 22
Post: #3
RE: [HowTo] Selective greylisting

no you don't have to do it...
the permit in the code doesn't do anything... it just increases the readability of the code...


OS: Debian Lenny
ispCP Version: Trunk r1033
Activated: AWStats dynamic, Dovecot, Avelsieve, Selective Greylisting, Bogus MX Filter,
No Webtools, Roundcube, Some own modifications
11-17-2007 09:45 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump:

| All rights reserved : isp-control.net |