Добрый день!Есть связка Exim+Dovecot+MySQL+ClamAV установленная на CentOS 6.4 x32
Все бы хорошо, но спам валит "стерва".
Так как серые списки много спама отсеивают, решено было установить Greylist на Exim.
Кандидаты на установку:
1. greylistd
2. exim-greylist
3. postgrey
Как самый простой в установке, был выбран exim-greylist.
Мануал по установке находится в https://github.com/Exim/exim/wiki/SimpleGreylisting
Так вот начал устанавливать сие чудо, возникли проблемы.
Добавил в /etc/exim/exim.conf
.include /etc/exim/exim-greylist.conf.inc
require acl = greylist_mail
Конфиг Exim.conf
---------------------------------------------
primary_hostname = mx.company.ru
hide mysql_servers = localhost/vexim/vexim/password
domainlist local_domains = ${lookup mysql{SELECT `domain` \
FROM `domain` WHERE \
`domain`='${quote_mysql:$domain}' AND \
`active`='1'}}
domainlist relay_to_domains = ${lookup mysql{SELECT `domain` \
FROM `domain` WHERE \
`domain`='${quote_mysql:$domain}' AND \
`active`='1'}}
hostlist relay_from_hosts = localhost:127.0.0.0/8:192.168.1.0/24 #add the hosts from which you allow relaying here
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
.include /etc/exim/exim-greylist.conf.inc
av_scanner = clamd:/var/run/clamav/clamd.socket
# spamd_address = 127.0.0.1 783
qualify_domain = company.ru
qualify_recipient = company.ru
allow_domain_literals = false
exim_user = exim
exim_group = exim
never_users = root
rfc1413_query_timeout = 0s
sender_unqualified_hosts = +relay_from_hosts
recipient_unqualified_hosts = +relay_from_hosts
ignore_bounce_errors_after = 45m
timeout_frozen_after = 15d
helo_accept_junk_hosts = 192.168.1.0/24
auto_thaw = 1h
smtp_banner = "$primary_hostname, ESMTP EXIM $version_number"
smtp_accept_max = 50
smtp_accept_max_per_connection = 25
smtp_connect_backlog = 30
smtp_accept_max_per_host = 20
split_spool_directory = true
remote_max_parallel = 15
return_size_limit = 70k
message_size_limit = 64M
helo_allow_chars = _
smtp_enforce_sync = true
log_selector = \
+all_parents \
+connection_reject \
+incoming_interface \
+lost_incoming_connection \
+received_sender \
+received_recipients \
+smtp_confirmation \
+smtp_syntax_error \
+smtp_protocol_error \
-queue_run
syslog_timestamp = no
begin acl
acl_check_rcpt:
accept hosts = :
deny message = "incorrect symbol in address"
domains = +local_domains
local_parts = ^[.] : ^.*[@%!/|]
deny message = "incorrect symbol in address"
domains = !+local_domains
local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
accept local_parts = postmaster
domains = +local_domains
deny message = "HELO/EHLO required by SMTP RFC"
condition = ${if eq{$sender_helo_name}{/etc/exim/exim-greylist.conf.inc}{yes}{no}}
accept authenticated = *
deny message = "Your IP in HELO - access denied!"
hosts = * : !+relay_from_hosts : !81-196.company.ru
condition = ${if eq{$sender_helo_name}\
{$sender_host_address}{true}{false}}
deny condition = ${if eq{$sender_helo_name}\
{$interface_address}{yes}{no}}
hosts = !127.0.0.1 : !localhost : *
message = "My IP in your HELO! Access denied!"
deny condition = ${if match{$sender_helo_name}\
{\N^\d+$\N}{yes}{no}}
hosts = !127.0.0.1 : !localhost : *
message = "Incorrect HELO string"
# filter spammers from dynamic ips
deny message = "your hostname is bad (adsl, poll, ppp & etc)."
condition = ${if match{$sender_host_name} \
{adsl|dialup|pool|peer|dhcp} \
{yes}{no}}
warn
set acl_m0 = 30s
warn
hosts = +relay_from_hosts:4.3.2.1/32:192.168.1.0/24 #disable waits for 'friendly' hosts
set acl_m0 = 0s
warn
logwrite = Delay $acl_m0 for $sender_host_name \
[$sender_host_address] with HELO=$sender_helo_name. Mail \
from $sender_address to $local_part@$domain.
delay = $acl_m0
accept domains = +local_domains
endpass
message = "No such user"
verify = recipient
accept domains = +relay_to_domains
endpass
message = "i don't know how to relay to this address"
verify = recipient
# deny message = "you in blacklist - $dnslist_domain \n $dnslist_text"
# dnslists = opm.blitzed.org : \
# cbl.abuseat.org : \
# bl.csma.biz
accept hosts = +relay_from_hosts
deny message = "Homo hominus lupus est"
acl_check_data:
require acl = greylist_mail
# check for viruses
deny malware = *
message = "Your message contains viruses: $malware_name"
# if needed - add spam filtering here
# permit everything else
accept
begin routers
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup mysql{SELECT `goto` FROM `alias` WHERE \
`address`='${quote_mysql:$local_part@$domain}' OR \
`address`='${quote_mysql:@$domain}'}}
dovecot_user:
driver = accept
condition = ${lookup mysql{SELECT `goto` FROM \
`alias` WHERE \
`address`='${quote_mysql:$local_part@$domain}' OR \
`address`='${quote_mysql:@$domain}'}{yes}{no}}
transport = dovecot_delivery
begin transports
remote_smtp:
driver = smtp
#interface = 4.3.2.1 #your public ip address, if it's the main server ip - you could skip this parameter. if it's an alias- it must be specified in clear
dovecot_delivery:
driver = pipe
command = /usr/libexec/dovecot/deliver -d $local_part@$domain
message_prefix =
message_suffix =
delivery_date_add
envelope_to_add
return_path_add
log_output
user = exim
address_pipe:
driver = pipe
return_output
address_reply:
driver = autoreply
begin retry
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
begin rewrite
begin authenticators
auth_plain:
driver = plaintext
public_name = LOGIN
server_prompts = Username:: : Password::
server_condition = "${if crypteq{$2}{${lookup mysql{SELECT `password` FROM `mailbox` WHERE `username` = '${quote_mysql:$1}'}}}{yes}{no}}"
server_set_id = $1
auth_login:
driver = plaintext
public_name = PLAIN
server_condition = "${if crypteq{$3}{${lookup mysql{SELECT `password` FROM `mailbox` WHERE `username` = '${quote_mysql:$2}'}}}{yes}{no}}"
server_prompts = :
server_set_id = $2
auth_cram_md5:
driver = dovecot
public_name = CRAM-MD5
server_socket = /var/run/dovecot/auth-client
server_set_id = $auth1
----------------------------------------------
Дальше перезапускаю exim, а он ругается:
# service exim restart
Shutting down exim: [FAILED]
Starting exim: 2013-09-20 03:16:48 Exim configuration error in line 48 of /etc/exim/exim-greylist.conf.inc:
option "accept" unknown ("driver" must be specified before any private options)
ИЛИ
# service exim restart
Shutting down exim: [FAILED]
Starting exim: 2013-09-20 03:17:34 Exim configuration error in line 46 of /etc/exim/exim-greylist.conf.inc:
main option "greylist_mail" unknown
Помогите решить проблему. Вроде все по мануалу, но не взлетает что-то.
Заранее спасибо!