блэклисты

EXIM, sendmail, postfix, Dovecot и прочие. Решение проблем связанных с работой электронной почты

Модератор: xM

Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
Аватара пользователя
vadim64
майор
Сообщения: 2101
Зарегистрирован: 2009-09-17 15:15:26
Откуда: Засратовец

блэклисты

Непрочитанное сообщение vadim64 » 2011-03-19 14:34:10

Код: Выделить всё

primary_hostname = mail.domain.ru
hide mysql_servers = localhost/exim/exim/exim
domainlist local_domains = ${lookup mysql{SELECT `domain` FROM `domain` WHERE `domain`='${domain}' AND `active`='1'}}
domainlist relay_to_domains = ${lookup mysql{SELECT `domain` FROM `domain` WHERE `domain`='${domain}' AND `active`='1'}}
hostlist   relay_from_hosts = localhost:127.0.0.0/8
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_data = acl_check_data
#av_scanner = clamd:/var/run/clamav/clamd.sock
qualify_domain = domain.ru
qualify_recipient = domain.ru
allow_domain_literals = false
exim_user = mailnull
exim_group = mail
never_users = root
#host_lookup = *
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
freeze_tell = freeze@inteksar.ru
helo_accept_junk_hosts = 172.16.0.0/16
auto_thaw = 1h
smtp_banner = "mx.whitehouse.gov ESMTP MDaemon 9.6.5"
#server_prompts=username:: : password::
smtp_accept_max = 1680
smtp_accept_max_per_connection = 1280
smtp_connect_backlog = 360
smtp_accept_max_per_host = 240
split_spool_directory = true

remote_max_parallel = 160

return_size_limit = 70k

message_size_limit = 10M

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

  require verify        = sender

  deny    message       = "HELO/EHLO require by SMTP RFC"
          condition     = ${if eq{$sender_helo_name}{}{yes}{no}}

  accept  authenticated = *

  deny    condition     = ${if eq{$sender_helo_name}{$interface_address}{yes}{no}}
          hosts         = !127.0.0.1 : !localhost : *
          message       = "main 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       = "can not be only number in HELO!"

  deny    condition     = ${if eq{$sender_address}{}{yes}{no}}
          hosts         = !127.0.0.1 : !localhost : *
          message       = "Where sender of this mail?!"

  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 = 20s
  warn
        hosts = +relay_from_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       = "In my mailserver not stored this user"
          verify        = recipient

  accept  domains       = +relay_to_domains
          endpass
          message       = "main server not know how 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 : dynablock.njabl.org : sbl-xbl.spamhaus.org : zen.spamhaus.org

  deny    message       = "Host in China"
          dnslists      =  cn.countries.nerd.dk

  accept  hosts         = +relay_from_hosts

  deny    message       = "mail.inteksar.ru is not relay"


acl_check_data:

    accept

begin routers

dspam_addspam_router:
  driver = accept
  domains                      = +local_domains
  local_part_prefix = spam-
  transport = dspam_addspam_transport

dspam_notspam_router:
  driver = accept
  domains                      = +local_domains
  local_part_prefix = notspam-
  transport = dspam_notspam_transport

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}'}}

dspam_spamscan_router:
  driver = accept
  domains                      = +local_domains
  no_verify
  condition = "${if and {{!eq {$received_protocol}{spam-scanned}}{!eq {$received_protocol}{local}} } {1}{0}}"
  transport = dspam_spamcheck_transport
  require_files = /usr/local/bin/dspam
  address_test = false

local_delivery_spam_router:
  driver                       = accept
  domains                      = +local_domains
  condition                    = ${if match{$h_X-DSPAM-Result:}{Spam}}
  transport                    = local_delivery_spam_transport
  no_more

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

dovecot_delivery:

  driver = pipe
  command = /usr/local/libexec/dovecot/deliver -d $local_part@$domain
  message_prefix =
  message_suffix =
  delivery_date_add
  envelope_to_add
  return_path_add
  log_output
  user = mailnull

address_pipe:
  driver = pipe
  return_output

address_reply:
  driver = autoreply

dspam_addspam_transport:
  driver = pipe
  command = "/usr/local/bin/dspam --user $local_part@$domain --class=spam --source=error"
  return_path_add = false
  return_fail_output = true
  log_output = true
  home_directory = "/var/db/dspam"
  current_directory = "/var/db/dspam"
  user = mailnull
  group = mail

dspam_notspam_transport:
  driver = pipe
  command = "/usr/local/bin/dspam --user $local_part@$domain --class=innocent --source=error --deliver=innocent %u"
  return_path_add = false
  return_fail_output = true
  log_output = true
  home_directory = "/var/db/dspam"
  current_directory = "/var/db/dspam"
  user = mailnull
  group = mail

dspam_spamcheck_transport:
  driver = pipe
  command = /usr/local/bin/dspam --deliver=innocent --user "$local_part@$domain" -- %u
  user = mailnull
  group = mail
  return_path_add = false
  log_output = true
  return_fail_output = true
  headers_remove        = X-DSPAM-Result

local_delivery_spam_transport:
  driver = pipe
  command = /usr/local/libexec/dovecot/deliver -d $local_part@$domain -m INBOX.Spam
  message_prefix =
  message_suffix =
  delivery_date_add
  envelope_to_add
  return_path_add

begin retry


# Address or Domain  Error   Retries
# -----------------  -----   -------
*                    *       F,2h,15m; G,16h,1h,1.5; F,4d,6h

begin rewrite

begin authenticators

auth_login:
  driver = dovecot
  public_name = LOGIN
  server_socket = /var/run/dovecot/auth-client
  server_set_id = $auth1

auth_plain:
  driver = dovecot
  public_name = PLAIN
  server_socket = /var/run/dovecot/auth-client
  server_set_id = $auth1

auth_cram_md5:
  driver = dovecot
  public_name = CRAM-MD5
  server_socket = /var/run/dovecot/auth-client
  server_set_id = $auth1
но в ящик падают письма от хостов, которые присутствуют в блэклистах. как можно проверить работу блэклистов?
Люди не делятся на национальности, партии, фракции и религии. Люди делятся на умных и дураков, а вот дураки делятся на национальности, партии, фракции и религии.

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
hizel
дядя поня
Сообщения: 9032
Зарегистрирован: 2007-06-29 10:05:02
Откуда: Выборг

Re: блэклисты

Непрочитанное сообщение hizel » 2011-03-19 15:35:20

проверяй до первого accept
не используй endpass
В дурацкие игры он не играет. Он просто жуткий, чу-чу, паровозик, и зовут его Блейн. Блейн --- это Боль.

Аватара пользователя
vadim64
майор
Сообщения: 2101
Зарегистрирован: 2009-09-17 15:15:26
Откуда: Засратовец

Re: блэклисты

Непрочитанное сообщение vadim64 » 2011-03-19 17:44:26

тупой вопрос: а регистрироваться там нигде не нада?
Люди не делятся на национальности, партии, фракции и религии. Люди делятся на умных и дураков, а вот дураки делятся на национальности, партии, фракции и религии.