Подскажите как сделать перенаправление почты для определённого юзера? Например есть почтовый сервер : mail.mydomain1.ru c exim+mysql, на нем заведён юзер user1@mydomain1.ru, необходимо чтобы письма приходящие на этот адрес перенаправлялись на user1@mydomain2.ru.
» FAQ по Exim MTA
Dmitry8
Это описанно в любом стандарном конфиге от Ginger или любого другого участника форума
Это описанно в любом стандарном конфиге от Ginger или любого другого участника форума
AndrewProcerov
В новой версии dovecot(a) изменился формат конфига
вот например
Код:
#base_dir = /var/run/dovecot
protocols = pop3 imap pop3s imaps
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
disable_plaintext_auth = no
#auth_debug = yes
protocol imap {
login_executable = /usr/libexec/dovecot/imap-login
mail_executable = /usr/libexec/dovecot/imap
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}
protocol pop3 {
login_executable = /usr/libexec/dovecot/pop3-login }
mail_executable = /usr/libexec/dovecot/pop3
pop3_uidl_format = %08Xu%08Xv
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
#pop3_logout_format = top=%t/%T, retr=%r/%R, del=%d/%m, size=%s
}
mail_extra_groups = mail
#default_mail_env = maildir:/var/vmail/%d/%n
auth default {
mechanisms = plain
passdb sql {
args = /etc/dovecot-mysql.conf
}
userdb sql {
args = /etc/dovecot-mysql.conf
}
}
first_valid_uid = 8
auth_user = mail
auth_verbose = yes
В новой версии dovecot(a) изменился формат конфига
вот например
Код:
#base_dir = /var/run/dovecot
protocols = pop3 imap pop3s imaps
ssl_cert_file = /etc/ssl/certs/dovecot.pem
ssl_key_file = /etc/ssl/private/dovecot.pem
disable_plaintext_auth = no
#auth_debug = yes
protocol imap {
login_executable = /usr/libexec/dovecot/imap-login
mail_executable = /usr/libexec/dovecot/imap
imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
}
protocol pop3 {
login_executable = /usr/libexec/dovecot/pop3-login }
mail_executable = /usr/libexec/dovecot/pop3
pop3_uidl_format = %08Xu%08Xv
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
#pop3_logout_format = top=%t/%T, retr=%r/%R, del=%d/%m, size=%s
}
mail_extra_groups = mail
#default_mail_env = maildir:/var/vmail/%d/%n
auth default {
mechanisms = plain
passdb sql {
args = /etc/dovecot-mysql.conf
}
userdb sql {
args = /etc/dovecot-mysql.conf
}
}
first_valid_uid = 8
auth_user = mail
auth_verbose = yes
Как сделать пересылку писем на определенный адрес, если адрес получателя не указан и базе пользователей?
1. Разыясните, как работает SpamAssassin в связке с Exim.
В sendmail там была связка через Мильтер, а тут наверное чего-то не понимаю
SpamAssasin у меня работал под sendmail и быд настроен, я выключил milter и перезапустил его под тем же пользователем что и Exim.
Прописал изменения в конфиге эксима
[more]
spamd_address = localhost 783
acl_check_content:
deny message = Virus found ($malware_name)
malware = *
warn message = X-Spam-Score: $spam_score ($spam_bar)
hosts = !+relay_from_hosts
spam = nobody:true
warn message = X-Spam-Report: $spam_report
hosts = !+relay_from_hosts
spam = nobody:true
warn message = Subject: ***SPAM*** $h_Subject:
hosts = !+relay_from_hosts
spam = nobody
deny message = This message scored $spam_score spam points.
spam = nobody:true
hosts = !+relay_from_hosts
condition = ${if >{$spam_score_int}{120}{1}{0}}
accept
[/more]
А эксим ругется:
[more]
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: warning - spamd connection to localhost, port 783 failed: Permission denied
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: all spamd servers failed
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw H=ukrcomflot.tenet.odessa.ua (black.ucf.od.ua) [195.138.85.82] Warning: ACL "warn" statement skipped: condition test deferred
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: warning - spamd connection to localhost, port 783 failed: Permission denied
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: all spamd servers failed
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw H=ukrcomflot.tenet.odessa.ua (black.ucf.od.ua) [195.138.85.82] Warning: ACL "warn" statement skipped: condition test deferred
[/more]
А сам SpamD говорит следующее:
[more]
Jun 27 15:03:38 gw spamd[73194]: spamd: connection from localhost [127.0.0.1] at port 63288
Jun 27 15:03:39 gw spamd[73194]: spamd: bad protocol: header error: Return-path: <kant@mail.ru> at /usr/local/bin/spamd line 1673, <GEN12> line 1.
Jun 27 15:03:39 gw spamd[73192]: prefork: child states: II
[/more]
Что тут не так?
2. И еще вопрос, в sendmail у меня был файл /etc/mail/domaintable , в котором шло обощение доменных имен, т.е. ставилось равенство между @amigo.od.ua = @amigo.odessa.ua
А как такую задачу решать в Exim?
3. C Clamav вроде все работает, т.е. все прописал, проверял пути, но никто и ни в какие логи не пишет, что Clamd что-то проверил или что-то непроверил, как убедится, что таки все работает? И куда будут деваться письма с вирусом, и будет ли отправляться уведомление об этом. Т.к. в связки с sendmail все делалось через milter.
PS Варианты отправлять вирусы - мне не подуше.
В sendmail там была связка через Мильтер, а тут наверное чего-то не понимаю
SpamAssasin у меня работал под sendmail и быд настроен, я выключил milter и перезапустил его под тем же пользователем что и Exim.
Прописал изменения в конфиге эксима
[more]
spamd_address = localhost 783
acl_check_content:
deny message = Virus found ($malware_name)
malware = *
warn message = X-Spam-Score: $spam_score ($spam_bar)
hosts = !+relay_from_hosts
spam = nobody:true
warn message = X-Spam-Report: $spam_report
hosts = !+relay_from_hosts
spam = nobody:true
warn message = Subject: ***SPAM*** $h_Subject:
hosts = !+relay_from_hosts
spam = nobody
deny message = This message scored $spam_score spam points.
spam = nobody:true
hosts = !+relay_from_hosts
condition = ${if >{$spam_score_int}{120}{1}{0}}
accept
[/more]
А эксим ругется:
[more]
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: warning - spamd connection to localhost, port 783 failed: Permission denied
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: all spamd servers failed
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw H=ukrcomflot.tenet.odessa.ua (black.ucf.od.ua) [195.138.85.82] Warning: ACL "warn" statement skipped: condition test deferred
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: warning - spamd connection to localhost, port 783 failed: Permission denied
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw spam acl condition: all spamd servers failed
2006-06-27 15:12:06 1FvCQI-000JFZ-Mw H=ukrcomflot.tenet.odessa.ua (black.ucf.od.ua) [195.138.85.82] Warning: ACL "warn" statement skipped: condition test deferred
[/more]
А сам SpamD говорит следующее:
[more]
Jun 27 15:03:38 gw spamd[73194]: spamd: connection from localhost [127.0.0.1] at port 63288
Jun 27 15:03:39 gw spamd[73194]: spamd: bad protocol: header error: Return-path: <kant@mail.ru> at /usr/local/bin/spamd line 1673, <GEN12> line 1.
Jun 27 15:03:39 gw spamd[73192]: prefork: child states: II
[/more]
Что тут не так?
2. И еще вопрос, в sendmail у меня был файл /etc/mail/domaintable , в котором шло обощение доменных имен, т.е. ставилось равенство между @amigo.od.ua = @amigo.odessa.ua
А как такую задачу решать в Exim?
3. C Clamav вроде все работает, т.е. все прописал, проверял пути, но никто и ни в какие логи не пишет, что Clamd что-то проверил или что-то непроверил, как убедится, что таки все работает? И куда будут деваться письма с вирусом, и будет ли отправляться уведомление об этом. Т.к. в связки с sendmail все делалось через milter.
PS Варианты отправлять вирусы - мне не подуше.
AndrewProcerov
Ответ на вопрос 2
userforward:
driver = redirect
allow_fail
allow_defer
data = ${lookup mysql{\
SELECT recipients FROM userforward \
WHERE local_part='${local_part}' AND domain='${domain}' \
UNION SELECT recipients FROM userforward WHERE local_part = '${local_part}' AND domain = '*'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '${domain}'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '*' LIMIT 0 , 1 }}
Ответ на вопрос 3
Пошли себе тестовый вирь и всё станет понятно
Добавлено:
dimidrol10
Также
Добавлено:
AndrewProcerov
Мне вообще интересно как работает спам асассин)))
Ответ на вопрос 2
userforward:
driver = redirect
allow_fail
allow_defer
data = ${lookup mysql{\
SELECT recipients FROM userforward \
WHERE local_part='${local_part}' AND domain='${domain}' \
UNION SELECT recipients FROM userforward WHERE local_part = '${local_part}' AND domain = '*'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '${domain}'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '*' LIMIT 0 , 1 }}
Ответ на вопрос 3
Пошли себе тестовый вирь и всё станет понятно
Добавлено:
dimidrol10
Также
Добавлено:
AndrewProcerov
Мне вообще интересно как работает спам асассин)))
Где все ?
darkomen
Цитата:
[offtop]
наверное в отпусках
[/offtop]
Цитата:
Где все ?
[offtop]
наверное в отпусках
[/offtop]
AndrewProcerov
Цитата:
мой конфиг [more=тут]
Код:
LogFile /var/log/clamav/clamd.log
LogFileUnlock
LogFileMaxSize 2M
LogTime
#LogClean
LogSyslog
LogFacility LOG_MAIL
LogVerbose
PidFile /var/run/clamav/clamd.pid
DatabaseDirectory /var/db/clamav
LocalSocket /var/run/clamav/clamd
FixStaleSocket
#TCPSocket 3310
#TCPAddr 127.0.0.1
MaxConnectionQueueLength 30
StreamMaxLength 20M
# Limit port range.
# Default: 1024
#StreamMinPort 30000
# Default: 2048
#StreamMaxPort 32000
MaxThreads 20
ReadTimeout 300
IdleTimeout 60
MaxDirectoryRecursion 20
FollowDirectorySymlinks
FollowFileSymlinks
SelfCheck 600
# Execute a command when virus is found. In the command string %v will
# be replaced by a virus name.
# Default: disabled
#VirusEvent /usr/local/bin/send_sms 123456789 "VIRUS ALERT: %v"
User mail
AllowSupplementaryGroups
ExitOnOOM
Debug
#LeaveTemporaryFiles
ScanPE
#DetectBrokenExecutables
ScanOLE2
ScanMail
#MailFollowURLs
ScanHTML
ScanArchive
ScanRAR
ArchiveMaxFileSize 15M
ArchiveMaxRecursion 5
ArchiveMaxFiles 100
ArchiveMaxCompressionRatio 200
ArchiveLimitMemoryUsage
#ArchiveBlockEncrypted
#ArchiveBlockMax
Цитата:
3. C Clamav вроде все работает, т.е. все прописал, проверял пути, но никто и ни в какие логи не пишет, что Clamd что-то проверил или что-то непроверил, как убедится, что таки все работает? И куда будут деваться письма с вирусом, и будет ли отправляться уведомление об этом. Т.к. в связки с sendmail все делалось через milter.
мой конфиг [more=тут]
Код:
LogFile /var/log/clamav/clamd.log
LogFileUnlock
LogFileMaxSize 2M
LogTime
#LogClean
LogSyslog
LogFacility LOG_MAIL
LogVerbose
PidFile /var/run/clamav/clamd.pid
DatabaseDirectory /var/db/clamav
LocalSocket /var/run/clamav/clamd
FixStaleSocket
#TCPSocket 3310
#TCPAddr 127.0.0.1
MaxConnectionQueueLength 30
StreamMaxLength 20M
# Limit port range.
# Default: 1024
#StreamMinPort 30000
# Default: 2048
#StreamMaxPort 32000
MaxThreads 20
ReadTimeout 300
IdleTimeout 60
MaxDirectoryRecursion 20
FollowDirectorySymlinks
FollowFileSymlinks
SelfCheck 600
# Execute a command when virus is found. In the command string %v will
# be replaced by a virus name.
# Default: disabled
#VirusEvent /usr/local/bin/send_sms 123456789 "VIRUS ALERT: %v"
User mail
AllowSupplementaryGroups
ExitOnOOM
Debug
#LeaveTemporaryFiles
ScanPE
#DetectBrokenExecutables
ScanOLE2
ScanMail
#MailFollowURLs
ScanHTML
ScanArchive
ScanRAR
ArchiveMaxFileSize 15M
ArchiveMaxRecursion 5
ArchiveMaxFiles 100
ArchiveMaxCompressionRatio 200
ArchiveLimitMemoryUsage
#ArchiveBlockEncrypted
#ArchiveBlockMax
Никто незнает, как сделать так, чтобы exim не принимал почту в случае превышения квоты пользователя на этапе взаимодействия сервер - сервер, а не в разделе TRANSPORTS CONFIGURATION ?
Pleshkov
Он у тебя нормально 3 рар проверяет?
Добавлено:
Pleshkov
Можешь подсказать как сделать чтобы исходящая почта не обрабатывалась кламавом?
Он у тебя нормально 3 рар проверяет?
Добавлено:
Pleshkov
Можешь подсказать как сделать чтобы исходящая почта не обрабатывалась кламавом?
darkomen
Цитата:
вот этого не знаю. если я не ошибаюсь кламав обрабатывает всю почту проходящую через MTA
Цитата:
Можешь подсказать как сделать чтобы исходящая почта не обрабатывалась кламавом?
вот этого не знаю. если я не ошибаюсь кламав обрабатывает всю почту проходящую через MTA
а как жыж condition ?
acl_check_data:
# Deny if the message contains a virus. Before enabling this check, you
# must install a virus scanner and set the av_scanner option above.
#
deny malware = *
message = This message contains a virus ($malware_name).
condition = ! +relay_from_hosts
как-то так вобщем, хотя я не уверен, но вобщем думаю мысль понятна, в каком направлении двигаться.
acl_check_data:
# Deny if the message contains a virus. Before enabling this check, you
# must install a virus scanner and set the av_scanner option above.
#
deny malware = *
message = This message contains a virus ($malware_name).
condition = ! +relay_from_hosts
как-то так вобщем, хотя я не уверен, но вобщем думаю мысль понятна, в каком направлении двигаться.
tankistua
Это означает что почта после обработки всего лишь не будет блокироваться, но обрабатываться оно будет всеравно
Это означает что почта после обработки всего лишь не будет блокироваться, но обрабатываться оно будет всеравно
логично в принципе.
Цитата:
Можешь подсказать как сделать чтобы исходящая почта не обрабатывалась кламавом?
Первый совет: блокируй по типу вложений, это облегчит работу антивирусу:
deny message = Your message contain deny file extention!
condition = ${if match {${lc:$mime_filename}}{\N(\.exe|\.cpl|\.pif|\.bat|\.scr|\.lnk|\.com|\.reg|\.dll|\.bin|\.cm
d|\.chm|\.hlp|\.ocx|\.sys|\.sh|\.url|\.pl|\.vb|\.vbe|\.vbs|\.rc|\.uu|\.mim|\.pif|\.hta|\.cab)$\N}{1}{0}}
Дальше пусть обрабатывает антивирус. Ограничь размер проверяемого файла. Типичный размер вируса - не более 700кб.
Поэтому делай так:
deny malware = *
message = This message contains a virus ($malware_name).
condition = ${if <{$message_size}{700k}{1}{0}}
hosts = ! +relay_from_hosts
Кажется так.
Но это неправильно. Если внутри сети кто-то будет заражен и будет рассылать вирусы внутри твоей сети, ты огребешь проблем море. Лучше убрать проверку антиспамом писем из твоей сети, это разгрузит сервер сильно.
http://www.exim.org/exim-html-4.62/doc/html/spec_html/ch40.html
The next example shows how to use an ACL variable to scan with both sophie and aveserver. It assumes you have set:
av_scanner = $acl_m0
in the main Exim configuration.
deny message = This message contains malware ($malware_name)
set acl_m0 = sophie
malware = *
deny message = This message contains malware ($malware_name)
set acl_m0 = aveserver
malware = *
может так попробовать как-то ? В ацл уже можно кондишин запихать.
The next example shows how to use an ACL variable to scan with both sophie and aveserver. It assumes you have set:
av_scanner = $acl_m0
in the main Exim configuration.
deny message = This message contains malware ($malware_name)
set acl_m0 = sophie
malware = *
deny message = This message contains malware ($malware_name)
set acl_m0 = aveserver
malware = *
может так попробовать как-то ? В ацл уже можно кондишин запихать.
Цитата:
может так попробовать как-то ?
Эта структура для двух антивирусов.
DarkHost
это я понял. Но никто ж не запрещает прописать один. Или я чего-то не понимаю.
это я понял. Но никто ж не запрещает прописать один. Или я чего-то не понимаю.
Зачем? Вам так не терпится ввести новую переменную? Не вижу смысла.
Я дал рабочий вариант ACL, который от вашего отличается лишь отсутствием ненужного геммороя. Будьте рациональнее.
Я дал рабочий вариант ACL, который от вашего отличается лишь отсутствием ненужного геммороя. Будьте рациональнее.
DarkHost
дык все равно ж проверяться будет.
дык все равно ж проверяться будет.
Дело не только в "проверяться", но и в логичном построении конфига. Всю эту хрень в конфиге можно разбросать так, что сам черт ногу сломит. А решит он усложнить конфиг, что тогда? Куча ненужных переменных и acl_m60.
Если делать, то делать нормально, на совесть.
Если делать, то делать нормально, на совесть.
DarkHost
кто в лес, кто по дрова - вопрос был , как не сканировать на вирусы почту от определенных хостов. точка.
А не как лучше или хуже писать конфиги.
кто в лес, кто по дрова - вопрос был , как не сканировать на вирусы почту от определенных хостов. точка.
А не как лучше или хуже писать конфиги.
Мой конфиг
[more]
### exim.conf ###
######################################################################
# MAIN CONFIGURATION SETTINGS #
######################################################################
# serial : 2006052602
MAILNAME =
MAINDOMAIN =
daemon_smtp_ports = 25 : 465
hide mysql_servers = localhost/exim/
#SMARTHOST_ROUTELIST =
CERTNAME = /etc/ssl/certs/ca/mail.crt
# Enable teergrubing on acl errors and say how long we delay (unset to disable).
TEERGRUBE = 60s
timezone = Europe/Moscow
ALLOWEDRCPTFAIL = 3
HOSTREJECTRCPT1 = SELECT message FROM blacklists WHERE address='${sender_host_address}' AND type='REJRCPT'
RFC1918 = 172.16.0.0/12 : 192.168.0.0/16
BOGUSIPS = 127.0.0.1/8 : 169.254.0.0/16 : 192.0.2.0/24 : RFC1918
NO_RANDOM_CALLBACK = SELECT domain FROM callbackdomains WHERE domain='${domain:$header_from:}' AND type='NORND'
HDR_DOMAIN_DISABLE_CALLBACK = SELECT domain FROM callbackdomains WHERE domain='${domain:$header_from:}' AND type='NOHDR'
BLOCKENVSEND1 = SELECT message FROM blacklists WHERE address='${sender_address}' AND type='SENDER'
addresslist denyenvsenders = mysql;BLOCKENVSEND1
.ifdef MAILNAME
primary_hostname = MAILNAME
qualify_domain = MAINDOMAIN
.else
MAILNAME = @
.endif
domainlist local_domains = @ : @[] : localhost : MAILNAME : \
${lookup mysql{SELECT domain FROM domains \
WHERE domain='${domain}' AND (type='LOCAL' OR type='VIRTUAL')}}
domainlist relay_to_domains = ${lookup mysql{SELECT domain FROM domains \
WHERE domain='${domain}' AND type='RELAY'}}
domainlist envdomain_disable_callback = ${lookup mysql{SELECT domain \
FROM callbackdomains WHERE domain='${sender_host_name}' \
AND type='NOENV'}}
domainlist domains_callback_norandom = mysql;NO_RANDOM_CALLBACK
domainlist nodnsdomains = ${lookup mysql{SELECT domain FROM \
callbackdomains WHERE domain='${sender_host_name}' AND type='NODNS'}}
localpartlist noenvfromcheck = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist noenvfromcallback = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist nosarej = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist nohdrsyncheck = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist nohdrfromcallback = ${lookup mysql{SELECT address FROM whitelist}}
hostlist rfc1918 = RFC1918
hostlist bogusips = BOGUSIPS
hostlist localadds = +rfc1918 : @ : @[] : localhost : \
${lookup mysql{SELECT domain FROM domains \
WHERE domain='${domain}' AND (type='LOCAL' OR type='VIRTUAL')}}
hostlist host_reject = ${lookup mysql{SELECT address FROM blacklists \
WHERE address='${sender_host_address}' AND type='HOSTREJ'}}
hostlist host_reject_rcpt = net-mysql;HOSTREJECTRCPT1
hostlist hosts_disable_callback = ${lookup mysql{SELECT hostname FROM \
hostlists WHERE hostname='${sender_host_address}' AND type='NOCALL'}}
hostlist relay_from_hosts = +localadds : ${lookup mysql{SELECT domain \
FROM domains WHERE domain='${domain}' AND type='RELAY'}}
hostlist auth_relay_hosts = *
.ifdef CERTNAME
hostlist auth_over_tls_hosts = *
.endif
hostlist expn_hosts = *.MAINDOMAIN:localhost
hostlist vrfy_hosts = *.MAINDOMAIN:localhost
hostlist hosts_avoid_tls = ${lookup mysql{SELECT hostname FROM hostlists \
WHERE hostname='${sender_host_address}' AND type='AVOIDTLS'}}
hostlist hosts_try_auth = ${lookup mysql{SELECT hostname FROM hostlists \
WHERE hostname='${sender_host_address}' AND type='TRYAUTH'}}
acl_smtp_connect = check_connect
acl_smtp_starttls = check_tls
acl_smtp_mail = check_mail
acl_smtp_rcpt = check_rcpt
acl_smtp_mime = check_mime
#acl_smtp_data = check_data
acl_smtp_auth = check_auth
acl_smtp_vrfy = check_vrfy
#acl_not_smtp = check_nonsmtp
#local_scan_path = /usr/lib/sa-exim.so
#av_scanner = clamd:/var/lib/clamav/clamd.socket
log_selector = \
+address_rewrite \
+all_parents \
+arguments \
+connection_reject \
+delay_delivery \
+delivery_size \
+dnslist_defer \
+incoming_interface \
+incoming_port \
+lost_incoming_connection \
+queue_run \
+received_sender \
+received_recipients \
+retry_defer \
+sender_on_delivery \
+size_reject \
+skip_delivery \
+smtp_confirmation \
+smtp_connection \
+smtp_protocol_error \
+smtp_syntax_error \
+subject \
+tls_cipher \
+tls_peerdn
#system_filter = /etc/exim/system-filter
#system_filter_file_transport = address_file
#system_filter_pipe_transport = address_pipe
.ifdef CERTNAME
tls_certificate = CERTNAME
tls_privatekey = /etc/ssl/certs/ca/mail.key
tls_on_connect_ports = 465
tls_advertise_hosts = ${if exists {CERTNAME}{*}{127.0.0.1/8}}
.endif
###############################CLAMAV#######################
acl_smtp_data = acl_check_content
av_scanner = clamd:/usr/local/clamav/var/tmp/clamd.sock
spamd_address = 127.0.0.1 783
############################################################
allow_domain_literals = false
never_users = root
host_lookup = *
helo_allow_chars = _
trusted_users = mail:www
trusted_groups = mail
rfc1413_hosts = !*
rfc1413_query_timeout = 0s
auth_advertise_hosts = !+relay_from_hosts : +auth_relay_hosts
helo_verify_hosts = !*
helo_try_verify_hosts = !*
helo_accept_junk_hosts = !*
smtp_accept_max_nonmail_hosts = *
ignore_bounce_errors_after = 30m
timeout_frozen_after = 3d
#gecos_pattern = ^([^,:]*)
#gecos_name = $1
freeze_tell = postmaster
auto_thaw = 1h
message_body_visible = 5000
message_size_limit = 200M
smtp_accept_max = 50
smtp_accept_max_per_connection = 50
smtp_accept_queue_per_connection = 100
smtp_connect_backlog = 50
smtp_accept_max_per_host = 25
split_spool_directory = true
syslog_timestamp = false
message_logs = false
remote_max_parallel = 15
smtp_reserve_hosts = +relay_from_hosts
smtp_load_reserve = 40
smtp_accept_max_nonmail = 7
smtp_max_unknown_commands = 1
sender_unqualified_hosts = +localadds
recipient_unqualified_hosts = +localadds
host_reject_connection = +host_reject
######################################################################
# ACL CONFIGURATION #
# Specifies access control lists for incoming SMTP mail #
######################################################################
begin acl
check_connect:
accept
.ifdef CERTNAME
check_tls:
accept
.endif
check_mail:
accept
check_rcpt:
accept hosts = 192.168.5.108 :
accept authenticated = *
# deny message = SEND YOUR E-MAIL to @dtb.ru or VISIT HERE https://mx.dtb.ru/mesg.html
# condition = ${if eq {${domain}} {ctrv.ru} {yes} {no}}
accept hosts = 127.0.0.1/8 : 192.168.5.204
deny local_parts = ^.*[@%!/|] : ^\\.
warn message = X-WhitelistedRCPT-nohdrsyncheck: Yes
local_parts = +nohdrsyncheck:postmaster:abuse
warn message = X-WhitelistedRCPT-nohdrfromcallback: Yes
local_parts = +nohdrfromcallback:postmaster:abuse
warn message = X-SA-Do-Not-Rej: Yes
local_parts = +nosarej:postmaster:abuse
warn message = X-SA-Do-Not-Run: Yes
hosts = +relay_from_hosts
warn message = X-SA-Do-Not-Run: Yes
authenticated = *
warn message = X-Broken-Reverse-DNS: no host name for IP address $sender_host_address
!verify = reverse_host_lookup
accept local_parts = postmaster
domains = +local_domains
deny message = "HELO/EHLO required by SMTP RFC"
condition = ${if eq{$sender_helo_name}{}{yes}{no}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny message = Forged domain detected in HELO/EHLO - $sender_helo_name
condition = ${if and{{match{$sender_helo_name} \
{(example|yahoo|hotmail|compuserve)}} \
{!match{$sender_host_name}{${rxquote:$1}}}}{yes}{no}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny message = Only one recipient accepted for NULL sender
senders = :
condition = ${if >{$rcpt_count}{1}{1}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
.ifdef TEERGRUBE
deny log_message = Teergrube: dictionnary attack (ALLOWEDRCPTFAIL failed probes)
message = unknown user
condition = ${if >{$rcpt_fail_count}{1} {1}{0}}
.else
drop log_message = Dictionnary attack ($rcpt_fail_count failed probes). Dropping connection
message = unknown user ($rcpt_fail_count failed queries)
condition = ${if >{$rcpt_fail_count}{${eval:ALLOWEDRCPTFAIL-2}} {1}{0}}
.endif
delay = ${eval:30*$rcpt_fail_count}s
domains = +local_domains
!verify = recipient
deny condition = ${if eq{$sender_ident}{CacheFlow Server}{1}{0}}
message = Rejected - appears to be an unsecured proxy: $sender_ident
deny hosts = +host_reject_rcpt
message = Host $sender_host_address is blocked: ${lookup mysql{HOSTREJECTRCPT1}{$value}{"unspecified reason"}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny senders = +denyenvsenders
message = Sender $sender_address is blocked: ${lookup mysql{BLOCKENVSEND1}{$value}{"unspecified reason"}}
deny local_parts = !+noenvfromcheck
!verify = sender
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
# deny message = $sender_host_address is not allowed to send mail from $sender_address_domain
# spf = softfail : neutral
# !authenticated = *
#.ifdef TEERGRUBE
# delay = TEERGRUBE
#.endif
deny hosts = !+localadds:!+hosts_disable_callback:*
sender_domains = !+envdomain_disable_callback:!+domains_callback_norandom:*
local_parts = !+noenvfromcallback
!verify = sender/callout=90s,random,postmaster
# !spf = pass
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny hosts = !+localadds:!+hosts_disable_callback:*
sender_domains = +domains_callback_norandom
local_parts = !+noenvfromcallback
!verify = sender/callout=90s,postmaster
# !spf = pass
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
# warn message = $spf_received
# domains = +local_domains
deny message = host is listed in $dnslist_domain
log_message = found in $dnslist_domain
!authenticated = *
dnslists = sbl-xbl.spamhaus.org : relays.ordb.org : \
combined.njabl.org : bl.spamcop.net
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
# deny message = Spam blocked see: \
# http://www.spamcop.net/w3m?action=checkblock&ip=$sender_host_address
# log_message = found in $dnslist_domain
# !authenticated = *
# dnslists = bl.spamcop.net
accept domains = +local_domains
endpass
message = unknown user
verify = recipient
accept domains = +relay_to_domains
endpass
message = unrouteable address
verify = recipient/callout=30s/callout_defer_ok
accept hosts = +localadds:+relay_from_hosts
verify = recipient
accept hosts = +auth_relay_hosts
endpass
message = authentication required
authenticated = *
deny message = relay not permitted
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
check_mime:
warn decode = default
deny message = Blacklisted file extension detected
condition = ${if match {${lc:$mime_filename}} \
{\N(\.pif|\.bat|\.scr|\.lnk|\.com)$\N} {1}{0}}
deny message = Sorry, noone speaks Chinese here
condition = ${if eq{$mime_charset}{gb2312}{1}{0}}
accept
check_data:
deny !verify = header_syntax
!condition = $header_X-WhitelistedRCPT-nohdrsyncheck:
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
accept hosts = :
accept hosts = 127.0.0.1/8
deny hosts = !+localadds:!+hosts_disable_callback:*
!condition = $header_X-WhitelistedRCPT-nohdrfromcallback:
!condition = ${lookup mysql{HDR_DOMAIN_DISABLE_CALLBACK} {yes}{no}}
!condition = ${lookup mysql{NO_RANDOM_CALLBACK} {yes}{no}}
!verify = header_sender/callout=90s,postmaster,random
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny hosts = !+localadds:!+hosts_disable_callback:*
!condition = $header_X-WhitelistedRCPT-nohdrfromcallback:
!condition = ${lookup mysql{HDR_DOMAIN_DISABLE_CALLBACK} {yes}{no}}
condition = ${lookup mysql{NO_RANDOM_CALLBACK} {yes}{no}}
!verify = header_sender/callout=90s,postmaster
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny message = Serious MIME defect detected ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
# deny message = This message contains VIRUS ($malware_name)
# malware = *
accept
check_auth:
.ifdef CERTNAME
accept hosts = +auth_over_tls_hosts
endpass
message = STARTTLS required before AUTH
encrypted = *
.endif
accept
check_expn:
accept hosts = +expn_hosts
deny message = expn not allowed from this host, sorry
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
check_vrfy:
accept hosts = +vrfy_hosts
deny message = vrfy not allowed from this host, sorry
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
check_nonsmtp:
acl_check_content:
deny message = Virus found ($malware_name)
hosts = *:!192.168.5.18/32
malware = *
# !authenticated = *
warn message = X-Spam-Score: $spam_score ($spam_bar)
hosts = !+relay_from_hosts
spam = mail:true
warn message = X-Spam-Report: $spam_report\nX-Spam-Score-Int:$spam_score_int
condition = ${if <{$message_size}{200k}{1}{0}}
hosts = +relay_from_hosts
spam = mail:true
warn message = Subject: ***SPAM*** $h_Subject:
hosts = !+relay_from_hosts
spam = mail
deny message = This message scored $spam_score spam points.
!hosts = +relay_from_hosts
condition = ${if >{$spam_score_int}{120}{1}{0}}
accept
######################################################################
# ROUTERS CONFIGURATION #
# Specifies how addresses are handled #
######################################################################
# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! #
# An address is passed to each router in turn until it is accepted. #
######################################################################
begin routers
always_verify:
driver = manualroute
domains = +nodnsdomains
verify_sender
verify_only
route_list = *
.ifdef SMARTHOST_ROUTELIST
smarthost:
driver = manualroute
domains = ! +local_domains
route_list = SMARTHOST_ROUTELIST
ignore_target_hosts = +bogusips
no_verify
host_find_failed = defer
same_domain_copy_routing = yes
transport = remote_smtp
.endif
dnslookup:
driver = dnslookup
domains = ! +local_domains
ignore_target_hosts = +bogusips
same_domain_copy_routing = yes
transport = remote_smtp
no_more
system_aliases:
driver = redirect
allow_defer
allow_fail
data = ${lookup mysql{SELECT recipients FROM aliases \
WHERE local_part='${local_part}' AND domain='${domain}'}}
domain_forward:
driver=redirect
allow_fail
allow_defer
data = ${local_part}@${lookup mysql{SELECT dest FROM rdomain \
WHERE domain = '${domain}'}}
condition = ${if eq {${domain}} {ctrv.ru} {yes} {no}}
userforward:
driver = redirect
allow_fail
allow_defer
data = ${lookup mysql{\
SELECT recipients FROM userforward \
WHERE local_part='${local_part}' AND domain='${domain}' \
UNION SELECT recipients FROM userforward WHERE local_part = '${local_part}' AND domain = '*'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '${domain}'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '*' LIMIT 0 , 1 }}
spamd_router:
no_verify
driver = accept
check_local_user
condition = ${if and{{def:spam_score_int}{>{$spam_score_int}{55}}}{yes}{no}}
transport = spamd_delivery
cannot_route_message = Unknown user
mysqluser:
driver = accept
condition = ${if eq{} {${lookup mysql{SELECT home FROM users \
WHERE id='${local_part}' AND mbox_host='${domain}' \
AND active='Y'}}}{no}{yes}}
local_part_suffix = +*
local_part_suffix_optional
transport = mysql_delivery
######################################################################
# TRANSPORTS CONFIGURATION #
######################################################################
# ORDER DOES NOT MATTER #
# Only one appropriate transport is called for each delivery. #
######################################################################
begin transports
mysql_delivery:
driver = appendfile
maildir_format
create_directory
maildir_tag = ,S=$message_size
directory = ${lookup mysql{SELECT CONCAT(home, "/Maildir") FROM users \
WHERE id='${local_part}' AND mbox_host='${domain}'}}
return_path_add
delivery_date_add
envelope_to_add
group = mail
mode = 0660
no_mode_fail_narrower
headers_remove = "Lines"
headers_add = "Lines: $body_linecount\n"
check_string = ""
directory_mode = 700
message_prefix = ""
message_suffix = ""
quota = ${lookup mysql{SELECT quota FROM users \
WHERE id='${local_part}' AND mbox_host='${domain}'}{${value}M}}
quota_size_regex = S=(\d+)$
quota_warn_threshold = 75%
address_pipe:
driver = pipe
log_defer_output
log_fail_output
path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin"
return_output
user = mail
group = mail
headers_remove = "Lines"
headers_add = "Lines: $body_linecount\n"
address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
user = mail
group = mail
address_reply:
driver = autoreply
spamd_delivery:
driver = appendfile
check_string = ""
create_directory
delivery_date_add
directory = /mail/vmail/domains/dtb.ru/spam/Maildir
directory_mode = 770
envelope_to_add
group = mail
maildir_format
maildir_tag = ,S=$message_size
message_prefix = ""
message_suffix = ""
mode = 0600
return_path_add
remote_smtp:
driver = smtp
dns_qualify_single = false
hosts_nopass_tls = *
hosts_avoid_tls = +hosts_avoid_tls
hosts_try_auth = +hosts_try_auth
# headers_remove = "X-SA-Do-Not-Run:X-SA-Exim-Scanned:X-SA-Exim-Mail-From:X-SA-Exim-Rcpt-To:X-SA-Exim-Connect-IP"
######################################################################
# RETRY CONFIGURATION #
######################################################################
begin retry
# Domain Error Retries
# ------ ----- -------
* quota
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
######################################################################
# REWRITE CONFIGURATION #
######################################################################
begin rewrite
######################################################################
# AUTHENTICATION CONFIGURATION #
######################################################################
begin authenticators
#auth_plain:
# driver = plaintext
# public_name = PLAIN
# server_condition = ${lookup mysql{SELECT id FROM users \
# WHERE id = '${quote_mysql:${local_part:$2}}' \
# AND mbox_host = '${quote_mysql:${domain:$2}}' \
# AND passwd = '${quote_mysql:$3}' \
# AND active = 'Y'}{yes}{no}}
# server_prompts = :
#server_set_id = $2
#
#auth_login:
# driver = plaintext
# public_name = LOGIN
# server_condition = ${lookup mysql{SELECT id FROM users \
# WHERE id = '${quote_mysql:${local_part:$1}}' \
# AND mbox_host = '${quote_mysql:${domain:$1}}' \
# AND passwd = '${quote_mysql:$2}' \
# AND active = 'Y'}{yes}{no}}
# server_prompts = Username:: : Password::
#server_set_id = $1
auth_plain:
driver = plaintext
public_name = PLAIN
server_condition = ${if crypteq{$3} \
{${lookup mysql{SELECT crypt FROM users \
WHERE id = '${quote_mysql:${local_part:$2}}' \
AND mbox_host = '${quote_mysql:${domain:$2}}' \
# AND passwd = '${quote_mysql:$3}' \
AND active = 'Y'}{$value}{*}}}{yes}{no}}
server_prompts = :
server_set_id = $2
# AUTH LOGIN authentication method used by MS Outlook.
auth_login:
driver = plaintext
public_name = LOGIN
server_condition = ${if crypteq{$2} {${lookup mysql{SELECT crypt FROM users \
WHERE id = '${quote_mysql:${local_part:$1}}' \
AND mbox_host = '${quote_mysql:${domain:$1}}' \
# AND passwd = '${quote_mysql:$2}' \
AND active = 'Y'}{$value}{*}}}{yes}{no}}
server_prompts = Username:: : Password::
server_set_id = $1
auth_cram_md5:
driver = cram_md5
public_name = CRAM-MD5
server_secret = ${lookup mysql{SELECT passwd FROM users \
WHERE id = '${quote_mysql:${local_part:$1}}' \
AND mbox_host = '${quote_mysql:${domain:$1}}' \
AND active = 'Y'}{$value}fail}
server_set_id = $1
# End of Exim configuration file
[/more]
DarkHost
Конечно блочу расширения, exe блочить не разрешает руководство. По размеру смысла нет.
Экспериментировал по разному, по авторизации по хостам, всеравно в топе при отсылке письма видно нагрузку на проц кламавом
[more]
### exim.conf ###
######################################################################
# MAIN CONFIGURATION SETTINGS #
######################################################################
# serial : 2006052602
MAILNAME =
MAINDOMAIN =
daemon_smtp_ports = 25 : 465
hide mysql_servers = localhost/exim/
#SMARTHOST_ROUTELIST =
CERTNAME = /etc/ssl/certs/ca/mail.crt
# Enable teergrubing on acl errors and say how long we delay (unset to disable).
TEERGRUBE = 60s
timezone = Europe/Moscow
ALLOWEDRCPTFAIL = 3
HOSTREJECTRCPT1 = SELECT message FROM blacklists WHERE address='${sender_host_address}' AND type='REJRCPT'
RFC1918 = 172.16.0.0/12 : 192.168.0.0/16
BOGUSIPS = 127.0.0.1/8 : 169.254.0.0/16 : 192.0.2.0/24 : RFC1918
NO_RANDOM_CALLBACK = SELECT domain FROM callbackdomains WHERE domain='${domain:$header_from:}' AND type='NORND'
HDR_DOMAIN_DISABLE_CALLBACK = SELECT domain FROM callbackdomains WHERE domain='${domain:$header_from:}' AND type='NOHDR'
BLOCKENVSEND1 = SELECT message FROM blacklists WHERE address='${sender_address}' AND type='SENDER'
addresslist denyenvsenders = mysql;BLOCKENVSEND1
.ifdef MAILNAME
primary_hostname = MAILNAME
qualify_domain = MAINDOMAIN
.else
MAILNAME = @
.endif
domainlist local_domains = @ : @[] : localhost : MAILNAME : \
${lookup mysql{SELECT domain FROM domains \
WHERE domain='${domain}' AND (type='LOCAL' OR type='VIRTUAL')}}
domainlist relay_to_domains = ${lookup mysql{SELECT domain FROM domains \
WHERE domain='${domain}' AND type='RELAY'}}
domainlist envdomain_disable_callback = ${lookup mysql{SELECT domain \
FROM callbackdomains WHERE domain='${sender_host_name}' \
AND type='NOENV'}}
domainlist domains_callback_norandom = mysql;NO_RANDOM_CALLBACK
domainlist nodnsdomains = ${lookup mysql{SELECT domain FROM \
callbackdomains WHERE domain='${sender_host_name}' AND type='NODNS'}}
localpartlist noenvfromcheck = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist noenvfromcallback = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist nosarej = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist nohdrsyncheck = ${lookup mysql{SELECT address FROM whitelist}}
localpartlist nohdrfromcallback = ${lookup mysql{SELECT address FROM whitelist}}
hostlist rfc1918 = RFC1918
hostlist bogusips = BOGUSIPS
hostlist localadds = +rfc1918 : @ : @[] : localhost : \
${lookup mysql{SELECT domain FROM domains \
WHERE domain='${domain}' AND (type='LOCAL' OR type='VIRTUAL')}}
hostlist host_reject = ${lookup mysql{SELECT address FROM blacklists \
WHERE address='${sender_host_address}' AND type='HOSTREJ'}}
hostlist host_reject_rcpt = net-mysql;HOSTREJECTRCPT1
hostlist hosts_disable_callback = ${lookup mysql{SELECT hostname FROM \
hostlists WHERE hostname='${sender_host_address}' AND type='NOCALL'}}
hostlist relay_from_hosts = +localadds : ${lookup mysql{SELECT domain \
FROM domains WHERE domain='${domain}' AND type='RELAY'}}
hostlist auth_relay_hosts = *
.ifdef CERTNAME
hostlist auth_over_tls_hosts = *
.endif
hostlist expn_hosts = *.MAINDOMAIN:localhost
hostlist vrfy_hosts = *.MAINDOMAIN:localhost
hostlist hosts_avoid_tls = ${lookup mysql{SELECT hostname FROM hostlists \
WHERE hostname='${sender_host_address}' AND type='AVOIDTLS'}}
hostlist hosts_try_auth = ${lookup mysql{SELECT hostname FROM hostlists \
WHERE hostname='${sender_host_address}' AND type='TRYAUTH'}}
acl_smtp_connect = check_connect
acl_smtp_starttls = check_tls
acl_smtp_mail = check_mail
acl_smtp_rcpt = check_rcpt
acl_smtp_mime = check_mime
#acl_smtp_data = check_data
acl_smtp_auth = check_auth
acl_smtp_vrfy = check_vrfy
#acl_not_smtp = check_nonsmtp
#local_scan_path = /usr/lib/sa-exim.so
#av_scanner = clamd:/var/lib/clamav/clamd.socket
log_selector = \
+address_rewrite \
+all_parents \
+arguments \
+connection_reject \
+delay_delivery \
+delivery_size \
+dnslist_defer \
+incoming_interface \
+incoming_port \
+lost_incoming_connection \
+queue_run \
+received_sender \
+received_recipients \
+retry_defer \
+sender_on_delivery \
+size_reject \
+skip_delivery \
+smtp_confirmation \
+smtp_connection \
+smtp_protocol_error \
+smtp_syntax_error \
+subject \
+tls_cipher \
+tls_peerdn
#system_filter = /etc/exim/system-filter
#system_filter_file_transport = address_file
#system_filter_pipe_transport = address_pipe
.ifdef CERTNAME
tls_certificate = CERTNAME
tls_privatekey = /etc/ssl/certs/ca/mail.key
tls_on_connect_ports = 465
tls_advertise_hosts = ${if exists {CERTNAME}{*}{127.0.0.1/8}}
.endif
###############################CLAMAV#######################
acl_smtp_data = acl_check_content
av_scanner = clamd:/usr/local/clamav/var/tmp/clamd.sock
spamd_address = 127.0.0.1 783
############################################################
allow_domain_literals = false
never_users = root
host_lookup = *
helo_allow_chars = _
trusted_users = mail:www
trusted_groups = mail
rfc1413_hosts = !*
rfc1413_query_timeout = 0s
auth_advertise_hosts = !+relay_from_hosts : +auth_relay_hosts
helo_verify_hosts = !*
helo_try_verify_hosts = !*
helo_accept_junk_hosts = !*
smtp_accept_max_nonmail_hosts = *
ignore_bounce_errors_after = 30m
timeout_frozen_after = 3d
#gecos_pattern = ^([^,:]*)
#gecos_name = $1
freeze_tell = postmaster
auto_thaw = 1h
message_body_visible = 5000
message_size_limit = 200M
smtp_accept_max = 50
smtp_accept_max_per_connection = 50
smtp_accept_queue_per_connection = 100
smtp_connect_backlog = 50
smtp_accept_max_per_host = 25
split_spool_directory = true
syslog_timestamp = false
message_logs = false
remote_max_parallel = 15
smtp_reserve_hosts = +relay_from_hosts
smtp_load_reserve = 40
smtp_accept_max_nonmail = 7
smtp_max_unknown_commands = 1
sender_unqualified_hosts = +localadds
recipient_unqualified_hosts = +localadds
host_reject_connection = +host_reject
######################################################################
# ACL CONFIGURATION #
# Specifies access control lists for incoming SMTP mail #
######################################################################
begin acl
check_connect:
accept
.ifdef CERTNAME
check_tls:
accept
.endif
check_mail:
accept
check_rcpt:
accept hosts = 192.168.5.108 :
accept authenticated = *
# deny message = SEND YOUR E-MAIL to @dtb.ru or VISIT HERE https://mx.dtb.ru/mesg.html
# condition = ${if eq {${domain}} {ctrv.ru} {yes} {no}}
accept hosts = 127.0.0.1/8 : 192.168.5.204
deny local_parts = ^.*[@%!/|] : ^\\.
warn message = X-WhitelistedRCPT-nohdrsyncheck: Yes
local_parts = +nohdrsyncheck:postmaster:abuse
warn message = X-WhitelistedRCPT-nohdrfromcallback: Yes
local_parts = +nohdrfromcallback:postmaster:abuse
warn message = X-SA-Do-Not-Rej: Yes
local_parts = +nosarej:postmaster:abuse
warn message = X-SA-Do-Not-Run: Yes
hosts = +relay_from_hosts
warn message = X-SA-Do-Not-Run: Yes
authenticated = *
warn message = X-Broken-Reverse-DNS: no host name for IP address $sender_host_address
!verify = reverse_host_lookup
accept local_parts = postmaster
domains = +local_domains
deny message = "HELO/EHLO required by SMTP RFC"
condition = ${if eq{$sender_helo_name}{}{yes}{no}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny message = Forged domain detected in HELO/EHLO - $sender_helo_name
condition = ${if and{{match{$sender_helo_name} \
{(example|yahoo|hotmail|compuserve)}} \
{!match{$sender_host_name}{${rxquote:$1}}}}{yes}{no}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny message = Only one recipient accepted for NULL sender
senders = :
condition = ${if >{$rcpt_count}{1}{1}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
.ifdef TEERGRUBE
deny log_message = Teergrube: dictionnary attack (ALLOWEDRCPTFAIL failed probes)
message = unknown user
condition = ${if >{$rcpt_fail_count}{1} {1}{0}}
.else
drop log_message = Dictionnary attack ($rcpt_fail_count failed probes). Dropping connection
message = unknown user ($rcpt_fail_count failed queries)
condition = ${if >{$rcpt_fail_count}{${eval:ALLOWEDRCPTFAIL-2}} {1}{0}}
.endif
delay = ${eval:30*$rcpt_fail_count}s
domains = +local_domains
!verify = recipient
deny condition = ${if eq{$sender_ident}{CacheFlow Server}{1}{0}}
message = Rejected - appears to be an unsecured proxy: $sender_ident
deny hosts = +host_reject_rcpt
message = Host $sender_host_address is blocked: ${lookup mysql{HOSTREJECTRCPT1}{$value}{"unspecified reason"}}
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny senders = +denyenvsenders
message = Sender $sender_address is blocked: ${lookup mysql{BLOCKENVSEND1}{$value}{"unspecified reason"}}
deny local_parts = !+noenvfromcheck
!verify = sender
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
# deny message = $sender_host_address is not allowed to send mail from $sender_address_domain
# spf = softfail : neutral
# !authenticated = *
#.ifdef TEERGRUBE
# delay = TEERGRUBE
#.endif
deny hosts = !+localadds:!+hosts_disable_callback:*
sender_domains = !+envdomain_disable_callback:!+domains_callback_norandom:*
local_parts = !+noenvfromcallback
!verify = sender/callout=90s,random,postmaster
# !spf = pass
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny hosts = !+localadds:!+hosts_disable_callback:*
sender_domains = +domains_callback_norandom
local_parts = !+noenvfromcallback
!verify = sender/callout=90s,postmaster
# !spf = pass
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
# warn message = $spf_received
# domains = +local_domains
deny message = host is listed in $dnslist_domain
log_message = found in $dnslist_domain
!authenticated = *
dnslists = sbl-xbl.spamhaus.org : relays.ordb.org : \
combined.njabl.org : bl.spamcop.net
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
# deny message = Spam blocked see: \
# http://www.spamcop.net/w3m?action=checkblock&ip=$sender_host_address
# log_message = found in $dnslist_domain
# !authenticated = *
# dnslists = bl.spamcop.net
accept domains = +local_domains
endpass
message = unknown user
verify = recipient
accept domains = +relay_to_domains
endpass
message = unrouteable address
verify = recipient/callout=30s/callout_defer_ok
accept hosts = +localadds:+relay_from_hosts
verify = recipient
accept hosts = +auth_relay_hosts
endpass
message = authentication required
authenticated = *
deny message = relay not permitted
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
check_mime:
warn decode = default
deny message = Blacklisted file extension detected
condition = ${if match {${lc:$mime_filename}} \
{\N(\.pif|\.bat|\.scr|\.lnk|\.com)$\N} {1}{0}}
deny message = Sorry, noone speaks Chinese here
condition = ${if eq{$mime_charset}{gb2312}{1}{0}}
accept
check_data:
deny !verify = header_syntax
!condition = $header_X-WhitelistedRCPT-nohdrsyncheck:
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
accept hosts = :
accept hosts = 127.0.0.1/8
deny hosts = !+localadds:!+hosts_disable_callback:*
!condition = $header_X-WhitelistedRCPT-nohdrfromcallback:
!condition = ${lookup mysql{HDR_DOMAIN_DISABLE_CALLBACK} {yes}{no}}
!condition = ${lookup mysql{NO_RANDOM_CALLBACK} {yes}{no}}
!verify = header_sender/callout=90s,postmaster,random
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny hosts = !+localadds:!+hosts_disable_callback:*
!condition = $header_X-WhitelistedRCPT-nohdrfromcallback:
!condition = ${lookup mysql{HDR_DOMAIN_DISABLE_CALLBACK} {yes}{no}}
condition = ${lookup mysql{NO_RANDOM_CALLBACK} {yes}{no}}
!verify = header_sender/callout=90s,postmaster
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
deny message = Serious MIME defect detected ($demime_reason)
demime = *
condition = ${if >{$demime_errorlevel}{2}{1}{0}}
# deny message = This message contains VIRUS ($malware_name)
# malware = *
accept
check_auth:
.ifdef CERTNAME
accept hosts = +auth_over_tls_hosts
endpass
message = STARTTLS required before AUTH
encrypted = *
.endif
accept
check_expn:
accept hosts = +expn_hosts
deny message = expn not allowed from this host, sorry
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
check_vrfy:
accept hosts = +vrfy_hosts
deny message = vrfy not allowed from this host, sorry
.ifdef TEERGRUBE
delay = TEERGRUBE
.endif
check_nonsmtp:
acl_check_content:
deny message = Virus found ($malware_name)
hosts = *:!192.168.5.18/32
malware = *
# !authenticated = *
warn message = X-Spam-Score: $spam_score ($spam_bar)
hosts = !+relay_from_hosts
spam = mail:true
warn message = X-Spam-Report: $spam_report\nX-Spam-Score-Int:$spam_score_int
condition = ${if <{$message_size}{200k}{1}{0}}
hosts = +relay_from_hosts
spam = mail:true
warn message = Subject: ***SPAM*** $h_Subject:
hosts = !+relay_from_hosts
spam = mail
deny message = This message scored $spam_score spam points.
!hosts = +relay_from_hosts
condition = ${if >{$spam_score_int}{120}{1}{0}}
accept
######################################################################
# ROUTERS CONFIGURATION #
# Specifies how addresses are handled #
######################################################################
# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! #
# An address is passed to each router in turn until it is accepted. #
######################################################################
begin routers
always_verify:
driver = manualroute
domains = +nodnsdomains
verify_sender
verify_only
route_list = *
.ifdef SMARTHOST_ROUTELIST
smarthost:
driver = manualroute
domains = ! +local_domains
route_list = SMARTHOST_ROUTELIST
ignore_target_hosts = +bogusips
no_verify
host_find_failed = defer
same_domain_copy_routing = yes
transport = remote_smtp
.endif
dnslookup:
driver = dnslookup
domains = ! +local_domains
ignore_target_hosts = +bogusips
same_domain_copy_routing = yes
transport = remote_smtp
no_more
system_aliases:
driver = redirect
allow_defer
allow_fail
data = ${lookup mysql{SELECT recipients FROM aliases \
WHERE local_part='${local_part}' AND domain='${domain}'}}
domain_forward:
driver=redirect
allow_fail
allow_defer
data = ${local_part}@${lookup mysql{SELECT dest FROM rdomain \
WHERE domain = '${domain}'}}
condition = ${if eq {${domain}} {ctrv.ru} {yes} {no}}
userforward:
driver = redirect
allow_fail
allow_defer
data = ${lookup mysql{\
SELECT recipients FROM userforward \
WHERE local_part='${local_part}' AND domain='${domain}' \
UNION SELECT recipients FROM userforward WHERE local_part = '${local_part}' AND domain = '*'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '${domain}'\
UNION SELECT recipients FROM userforward WHERE local_part = '*' AND domain = '*' LIMIT 0 , 1 }}
spamd_router:
no_verify
driver = accept
check_local_user
condition = ${if and{{def:spam_score_int}{>{$spam_score_int}{55}}}{yes}{no}}
transport = spamd_delivery
cannot_route_message = Unknown user
mysqluser:
driver = accept
condition = ${if eq{} {${lookup mysql{SELECT home FROM users \
WHERE id='${local_part}' AND mbox_host='${domain}' \
AND active='Y'}}}{no}{yes}}
local_part_suffix = +*
local_part_suffix_optional
transport = mysql_delivery
######################################################################
# TRANSPORTS CONFIGURATION #
######################################################################
# ORDER DOES NOT MATTER #
# Only one appropriate transport is called for each delivery. #
######################################################################
begin transports
mysql_delivery:
driver = appendfile
maildir_format
create_directory
maildir_tag = ,S=$message_size
directory = ${lookup mysql{SELECT CONCAT(home, "/Maildir") FROM users \
WHERE id='${local_part}' AND mbox_host='${domain}'}}
return_path_add
delivery_date_add
envelope_to_add
group = mail
mode = 0660
no_mode_fail_narrower
headers_remove = "Lines"
headers_add = "Lines: $body_linecount\n"
check_string = ""
directory_mode = 700
message_prefix = ""
message_suffix = ""
quota = ${lookup mysql{SELECT quota FROM users \
WHERE id='${local_part}' AND mbox_host='${domain}'}{${value}M}}
quota_size_regex = S=(\d+)$
quota_warn_threshold = 75%
address_pipe:
driver = pipe
log_defer_output
log_fail_output
path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin"
return_output
user = mail
group = mail
headers_remove = "Lines"
headers_add = "Lines: $body_linecount\n"
address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add
user = mail
group = mail
address_reply:
driver = autoreply
spamd_delivery:
driver = appendfile
check_string = ""
create_directory
delivery_date_add
directory = /mail/vmail/domains/dtb.ru/spam/Maildir
directory_mode = 770
envelope_to_add
group = mail
maildir_format
maildir_tag = ,S=$message_size
message_prefix = ""
message_suffix = ""
mode = 0600
return_path_add
remote_smtp:
driver = smtp
dns_qualify_single = false
hosts_nopass_tls = *
hosts_avoid_tls = +hosts_avoid_tls
hosts_try_auth = +hosts_try_auth
# headers_remove = "X-SA-Do-Not-Run:X-SA-Exim-Scanned:X-SA-Exim-Mail-From:X-SA-Exim-Rcpt-To:X-SA-Exim-Connect-IP"
######################################################################
# RETRY CONFIGURATION #
######################################################################
begin retry
# Domain Error Retries
# ------ ----- -------
* quota
* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
######################################################################
# REWRITE CONFIGURATION #
######################################################################
begin rewrite
######################################################################
# AUTHENTICATION CONFIGURATION #
######################################################################
begin authenticators
#auth_plain:
# driver = plaintext
# public_name = PLAIN
# server_condition = ${lookup mysql{SELECT id FROM users \
# WHERE id = '${quote_mysql:${local_part:$2}}' \
# AND mbox_host = '${quote_mysql:${domain:$2}}' \
# AND passwd = '${quote_mysql:$3}' \
# AND active = 'Y'}{yes}{no}}
# server_prompts = :
#server_set_id = $2
#
#auth_login:
# driver = plaintext
# public_name = LOGIN
# server_condition = ${lookup mysql{SELECT id FROM users \
# WHERE id = '${quote_mysql:${local_part:$1}}' \
# AND mbox_host = '${quote_mysql:${domain:$1}}' \
# AND passwd = '${quote_mysql:$2}' \
# AND active = 'Y'}{yes}{no}}
# server_prompts = Username:: : Password::
#server_set_id = $1
auth_plain:
driver = plaintext
public_name = PLAIN
server_condition = ${if crypteq{$3} \
{${lookup mysql{SELECT crypt FROM users \
WHERE id = '${quote_mysql:${local_part:$2}}' \
AND mbox_host = '${quote_mysql:${domain:$2}}' \
# AND passwd = '${quote_mysql:$3}' \
AND active = 'Y'}{$value}{*}}}{yes}{no}}
server_prompts = :
server_set_id = $2
# AUTH LOGIN authentication method used by MS Outlook.
auth_login:
driver = plaintext
public_name = LOGIN
server_condition = ${if crypteq{$2} {${lookup mysql{SELECT crypt FROM users \
WHERE id = '${quote_mysql:${local_part:$1}}' \
AND mbox_host = '${quote_mysql:${domain:$1}}' \
# AND passwd = '${quote_mysql:$2}' \
AND active = 'Y'}{$value}{*}}}{yes}{no}}
server_prompts = Username:: : Password::
server_set_id = $1
auth_cram_md5:
driver = cram_md5
public_name = CRAM-MD5
server_secret = ${lookup mysql{SELECT passwd FROM users \
WHERE id = '${quote_mysql:${local_part:$1}}' \
AND mbox_host = '${quote_mysql:${domain:$1}}' \
AND active = 'Y'}{$value}fail}
server_set_id = $1
# End of Exim configuration file
[/more]
DarkHost
Конечно блочу расширения, exe блочить не разрешает руководство. По размеру смысла нет.
Экспериментировал по разному, по авторизации по хостам, всеравно в топе при отсылке письма видно нагрузку на проц кламавом
Цитата:
вопрос был , как не сканировать на вирусы почту от определенных хостов. точка.
Ты не внимательно читал вопрос, перечитай.
Мне абсолютно все равно, кто как пишет конфиги. Каждый дро... кто как хо...
Цитата:
exe блочить не разрешает руководство
Сказать куда в таком случае посылается руководство? Ты занимаешься почтой, а не слепо выполняешь указания. Спорь, доказывай свою точку зрения и пусть начальство идет лесом. Ты все exe все равно нормально не проверишь.
Я же говорю, добавляешь в ACL:
hosts = ! +relay_from_hosts
и исходящая почта не проверяется. Хочешь перечислить хосты и сети, пиши:
hosts = ! 127.0.0.1 : ! x.x.x.0/24 : ...
DarkHost
проверяется она, просто не блокируется
проверяется она, просто не блокируется
Цитата:
проверяется она, просто не блокируется
Это невозможно. Для того, чтобы clamav проверил письмо, ему его должен Exim передать.
Вот это:
hosts = *:!192.168.5.18/32
неверно. Вот так:
hosts = ! 127.0.0.1 : ! 192.168.5.18/32
верно.
А можно ли как-нибудь сделать свои сообщения об ошибках?
Чтоб например когда ящик заполнен, письмо на русском отправлялось , ну и т.д.
Чтоб например когда ящик заполнен, письмо на русском отправлялось , ну и т.д.
DarkHost
Хм, ты велик, оно работает
Добавлено:
deny message = Virus found ($malware_name)
malware = *
!authenticated = *
а почему так не работает? они все автризуются по смтп
Хм, ты велик, оно работает
Добавлено:
deny message = Virus found ($malware_name)
malware = *
!authenticated = *
а почему так не работает? они все автризуются по смтп
Цитата:
Чтоб например когда ящик заполнен, письмо на русском отправлялось
Можно. Как точно, не скажу, но можно warn_message вызывать из файла, где будет хранится текст твоего письма.
Добавлено:
Цитата:
а почему так не работает
deny message = Virus found ($malware_name)
malware = *
сondition = ${eq {$tls_cipher}{}{1}{0}}
Ибо:
"If the session is encrypted, $tls_cipher is not empty"
Achtung!!!! НЕ ПРОВЕРЕНО!!!
Страницы: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
Предыдущая тема: MS Outlook Возвращает: Не удается доставить.
Форум Ru-Board.club — поднят 15-09-2016 числа. Цель - сохранить наследие старого Ru-Board, истории становления российского интернета. Сделано для людей.