ubuntu_exim_mysql_greylisting_simple
Взято из: http://theinternetco.net/projects/exim/greylist
mysql -uroot -p
USE exim;
CREATE TABLE exim_greylist (
id integer NOT NULL auto_increment,
relay_ip varchar(64),
from_domain varchar(255),
block_expires datetime NOT NULL,
record_expires datetime NOT NULL,
origin_type enum('MANUAL','AUTO') NOT NULL default 'AUTO',
create_time datetime NOT NULL,
PRIMARY KEY (id));
QUIT
vi /etc/exim4/exim4.conf
#MACROS
GREYLIST_TEST = SELECT CASE \
WHEN now() - block_expires > 0 THEN 2 \
ELSE 1 \
END \
FROM exim_greylist \
WHERE relay_ip = '${quote_mysql:$sender_host_address}' \
AND from_domain = '${quote_mysql:$sender_address_domain}'
GREYLIST_ADD = INSERT INTO exim_greylist (relay_ip, from_domain, \
block_expires, record_expires, create_time) \
VALUES ( '${quote_mysql:$sender_host_address}', \
'${quote_mysql:$sender_address_domain}', \
DATE_ADD(now(), INTERVAL 5 MINUTE), \
DATE_ADD(now(), INTERVAL 7 DAY), \
now())
...
#ACL CONFIGURATION
begin acl
acl_check_rcpt:
...
warn set acl_m2 = ${lookup mysql{GREYLIST_TEST}{$value}{0}}
defer message = Greylisted - please try again a little later.
condition = ${if eq{$acl_m2}{0}{1}}
condition = ${lookup mysql{GREYLIST_ADD}{yes}{no}}
defer message = Greylisted - please try again shortly.
condition = ${if eq{$acl_m2}{1}{1}}
accept domains = +local_domains
endpass
message = unknown user
verify = recipient
accept domains = +relay_to_domains
endpass
message = unrouteable address
verify = recipient
deny message = relay not permitted
ubuntu_exim_mysql_greylisting_simple.txt · Last modified: 2023/06/12 19:57 by admin