exim дублирование

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

Модератор: xM

Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
CheGev80
рядовой
Сообщения: 22
Зарегистрирован: 2009-09-11 10:14:53

exim дублирование

Непрочитанное сообщение CheGev80 » 2009-09-11 10:31:21

Настроил связку Exim+Dovecot+Mysql, не много переделал по себя конфиги добытые в инете, короче проблема такая локальный адрес отправителя локального дублируется доменом, т.е. test@exam.com@exam.com. Аутификацию в клиентских прогах хочу именно сделать по пользователю, без домена, но что бы письма скалдывались именно вот так /mail/%d/%n, т.к. сервак будет обсуживать несколько доменов.

Вот что в mysql:
username password name maildir quota domain created modified active
test ******* /mail/%d/%n 0 exam.com 0000-00-00 00:00:00 0000-00-00 00:00:00 1

Вот конфиг exima:

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

primary_hostname = exam.com
hide mysql_servers = localhost/exim/root/******
domainlist local_domains = @ : localhost : localhost.localdomain : exam.com
domainlist relay_to_domains =
acl_smtp_rcpt = acl_check_rcpt
acl_smtp_helo = acl_check_helo
acl_smtp_data = acl_check_data
acl_smtp_mime = acl_check_mime
acl_smtp_mail = acl_check_mail

av_scanner = clamd: /var/run/clamav/clamd

MAIN_TLS_ENABLE='true'
LOCAL_DELIVERY=dovecot_lda
tls_advertise_hosts = *
tls_certificate = /etc/exim4/exim.crt
tls_privatekey = /etc/exim4/exim.key
daemon_smtp_ports = 25
tls_on_connect_ports = 465
never_users = root
rfc1413_query_timeout = 0s
timeout_frozen_after = 15d
freeze_tell = admin@exam.com
helo_accept_junk_hosts = 192.168.0.0/24
auto_thaw = 1h
smtp_banner = "$primary_hostame, ESMTP EXIM "
smtp_accept_max = 50
smtp_accept_max_per_connection = 25

helo_allow_chars = _
ignore_bounce_errors_after = 2d
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 \
acl_check_rcpt:

  accept  hosts = :

  deny    message       = Restricted characters in address
          domains       = +local_domains
          local_parts   = ^[.] : ^.*[@%!/|]

  deny    message       = Restricted characters in address
          domains       = !+local_domains
          local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./


  accept  local_parts   = postmaster
          domains       = +local_domains



  accept  hosts         = +relay_from_hosts
          control       = submission

  accept  authenticated = *
          control       = submission

  require message = relay not permitted
          domains = +local_domains : +relay_to_domains

    deny    message       = "Ваш хост в блэклисте - $dnslist_domain"
            dnslists      =  bl.spamcop.net : dnsbl.sorbs.net

    warn    dnslists      =  bl.spamcop.net : dnsbl.sorbs.net
            add_header    = X-Warning: $sender_host_address is in a black list at $dnslist_domain
            log_message   = found in $dnslist_domain


  accept

acl_check_data:
    deny message         = This message is a virus: ($malware_name)
          demime       = *
          malware      = *

   accept

acl_check_mime:

  deny message = Blacklisted file extension detected
       condition = ${if match \
                        {${lc:$mime_filename}} \
                        {\N(\.exe|\.pif|\.bat|\.scr|\.lnk|\.com)$\N} \
                     {1}{0}}

  accept


acl_check_mail:

    accept  condition = ${if eq{${lc:$authenticated_id}}{${lc:$sender_address}}{yes}{no}}
            sender_domains = +local_domains
             authenticated = *



  accept verify        = sender
       sender_domains = !+local_domains
       !authenticated = *



    deny  message = deny this email $sender_address_local_part
          log_message = deny this email $value

begin routers
dovecot_user:
  driver = accept
condition = ${if eq{} {${lookup mysql{SELECT quota FROM mailbox \
        WHERE username='${local_part}' AND domain='${domain}' \
        AND active='1'}}}{no}{yes}}
  transport = dovecot_delivery


remote_systems:
  debug_print = "R: remote transport for $local_part@$domain"
  driver = dnslookup
  domains = ! +local_domains
  transport = remote_smtp
  same_domain_copy_routing = yes
  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/24 :\
                        192.168.100.0/24 :  255.255.255.255
  cannot_route_message = Facken Ched
  no_more

system_aliases:
  driver = redirect
  allow_fail
  allow_defer
  data = ${lookup{$local_part}lsearch{/etc/aliases}}
  file_transport = address_file
  pipe_transport = address_pipe

userforward:
  driver = redirect
  check_local_user
  file = $home/.forward
  allow_filter
  no_verify
  no_expn
  check_ancestor
  file_transport = address_file
  pipe_transport = address_pipe
  reply_transport = address_reply

localuser:
  driver = accept
  check_local_user
local_part_suffix = +* : -*
local_part_suffix_optional
  transport = local_delivery
  cannot_route_message = Unknown user


begin transports

dovecot_delivery:
  driver = pipe
  command = /usr/lib/dovecot/deliver -d $local_part@$domain
  message_prefix =
  message_suffix =
  delivery_date_add
  envelope_to_add
  return_path_add
  log_output
  user = Debian-exim

remote_smtp:
  driver = smtp

local_delivery:
  driver = appendfile
  file = /var/mail/$local_part
  delivery_date_add
  envelope_to_add
  return_path_add
  group = mail
  mode = 0660

address_file:
  driver = appendfile
  delivery_date_add
  envelope_to_add
  return_path_add

address_reply:
  driver = autoreply
begin retry
*                      *           F,2h,15m; G,16h,1h,1.5; F,4d,6h
begin rewrite

begin authenticators

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

dovecot_plain:
  driver = dovecot
  public_name = PLAIN
  server_socket = /var/run/dovecot/auth-client
  server_set_id = $auth1
Вот dovecot-sql.conf

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

password_query = SELECT `username` as `user`, `password` FROM  `mailbox` WHERE `username` = '%n' AND `domain` = '%d' AND `active`='1'
user_query = SELECT `maildir` AS `home`, 102 AS `uid`, 104 AS `gid` FROM `mailbox` WHERE `username` = '%n' AND `domain` = '%d'
В таблице mysql username=admin home= /mail/%d/%n password=****** domain=exam.com

А в логах вот что:

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

2009-09-09 17:16:24 1MlN28-00050x-Mo <= "test@exam.com"@exam.comH=exam.com (admpc) [192.168.0.100]:2837 I=[192.168.0.16]:25$
2009-09-09 17:16:24 SMTP connection from admpc.exam.com (admpc) [192.168.0.100]:2837 I=[192.168.0.16]:25 closed by QUIT
2009-09-09 17:16:24 cwd=/var/spool/exim4 3 args: /usr/sbin/exim4 -Mc 1MlN28-00050x-Mo
2009-09-09 17:16:24 1MlN28-00050x-Mo => test <test@exam.com> F=<"test@exam.com"@exam.com> R=dovecot_user T=dovecot_delivery$
2009-09-09 17:16:24 1MlN28-00050x-Mo Completed
Вопрос в следущем, как сделать что $Sender_adress была в нормальном виде, test@exam.com?
т.к. некоторые сервера отлуп дают?

Хостинговая компания 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/
Выделенные сервера, Россия, Москва, от 2460 рублей (8 CPU, 8Gb RAM, 2x500Gb HDD, RAID 3ware 9750):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

CaBa
мл. сержант
Сообщения: 72
Зарегистрирован: 2009-06-10 22:10:03

Re: exim дублирование

Непрочитанное сообщение CaBa » 2009-09-11 11:23:11

Поправить нужно:

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

control       = submission/sender_retain
Вот тут смотри:

http://forum.lissyara.su/viewtopic.php? ... der_retain