You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Gregory Colpart f570931b5b
8 years ago
.pc init 8 years ago
debian init 8 years ago
tpl init 8 years ago
.depend init 8 years ago
COPYING init 8 years ago
ChangeLog init 8 years ago
Makefile init 8 years ago
README init 8 years ago init 8 years ago
policy.mli init 8 years ago init 8 years ago
rules.mli init 8 years ago init 8 years ago
server.mli init 8 years ago
whitelister-example.conf init 8 years ago init 8 years ago


whitelister is a Postfix Policy Server (see [1]).

the aim is to accept every really clean mail immediately, and to reserve the
evil treatments (like greylisting) to suspicious mails.


you need :
* a recent ocaml distribution (like 3.08.3), supporting Unix module and
native compilation.
* ocamlfind
* the package syslog

then you only have to run `make' and it should produce a `whitelister'

Note for Debian : if you have a deb-src line in your /etc/apt/source.list,
you can get the Build Dependecies of whitelister by simply running :
`apt-get build-dep whitelister'


It is intended to be used like that :

(1) Default inet socket :

in your :

smtpd_recipient_restrictions =
check_policy_service inet:
... here your nasty treatments , like postgrey ...

in your whitelister.conf, don't specify sock as its default value is OK.

(2) Unix socket

if you use a unix socket (more efficient on most systems) :

smtpd_recipient_restrictions =
check_policy_service unix:private/whitelister.ctl
... here your nasty treatments , like postgrey ...

in your whitelister.conf, set :

sock: /var/spool/postfix/private/whitelister.ctl

Some Notes :

Postfix DOC states :

In case of trouble the policy server must not send a reply. Instead the
server must log a warning and disconnect. Postfix will retry the
request at some later time.

But whitelister does not work that way. Either the mail seems to be clean
(wrt whitelister checks) and whitelister returns 'OK' (and the mail is also
accepted), or one check fails and it returns 'DUNNO' in order to let the
mail go through the nexts checks (like greylister).

That's why, you *have* to use whitelister as one of the *last* rules in your
smtpd_recipient_restrictions. Else, it can transform your smtp server into
an open-relay.

Any failure (in DNS e.g.) is also interpreted as a suspicious mail, and it
will also go through the next restrictions checks too.


whitelister search for two config files, named whitelister.conf in :
o /etc/whitelister.conf
o the same directory as itself
and it aggregates the configuration of both files.

the syntax is : <20> key: value <20> where key is the setting key, and value its
value without quotes or anything. Comments begin with a # at the first char
of the line see whitelister-example.conf for an example config file.

current settings are :

(1) Daemon Options

verb verbosity of the logs.
`0' means don't log `Clean' mails
`1' means log everything

pidf path to the pidfile whitelister will write its pid into.
default is /var/run/ ,
use /dev/null if you don't want to use the feature

sock the socket whitelister will listen to.
the value is the path for a unix socket,
or ip:port for a TCP one.

last setting is used (/etc/whitelister.conf overrides local configs)

user name of the user used to run whitelister if launched as root
default is nobody

group name of the group used to run whitelister if launched as root
default is nogroup

(2) Rules Configuration

rbl hostname of a rbl service

rhbl_rcpt / rhbl_helo / rhbl_client / rhbl_sender

hostname of a rhbl service.

rcpt/helo/client/sender refers to the classical postfix
terminology related to the settings :
smtpd_(recipient, helo, client, sender)_restriction

it means that an rhbl check is performed on (resp.) :
- the domain of the recipient
- the domain from the HELO/EHLO command
- the domain of the client connection
- the domain part of the sender address

spf spf checkings :
0 means no check.

for the rest, see the table :
level | pass | neutal | empty record | other
1 | ok | ok | ok | !!!!
2 | ok | ok | !!!! | !!!!
3 | ok | !!!! | !!!! | !!!!

spfrej reject mail on invalid SPF (default is yes), possible values are