Страница 1 из 1

Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 11:58:41
mitry13
Здравствуйте!
Exim+ClamAV+Dovecot на Debian. Настроено, работает... но возникли проблемы при определении пользовательских фильтров.
Конфиг роутеров:

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

smarthost:
  debug_print = "R: smarthost for $local_part@$domain"
  driver = manualroute
  domains = ! +local_domains
  transport = remote_smtp_smarthost
  route_list = * DCsmarthost byname
  ignore_target_hosts = 0.0.0.0:127.0.0.0/8
  host_find_failed = defer
  same_domain_copy_routing = yes
  no_more

.endif

real_local:
  debug_print = "R: real_local for $local_part@$domain"
  driver = accept
  domains = +local_domains
  local_part_prefix = real-
  check_local_user
  transport = LOCAL_DELIVERY

# aliases in SQL database
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}'}}

userforward:
  debug_print = "R: userforward for $local_part@$domain"
  driver = redirect
  domains = +local_domains
  check_local_user
  file = /var/mail/exim/$domain/$local_part/.forward
  require_files = mailnull:/var/mail/exim/$domain/$local_part/.forward
  no_verify
  no_expn
  check_ancestor
  allow_filter
  forbid_smtp_code = true
  directory_transport = address_directory
  file_transport = address_file
  pipe_transport = address_pipe
  reply_transport = address_reply
  skip_syntax_errors

# Use dovecot for local delevery
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
  cannot_route_message = Unknown user  
В папке лежит файл /var/mail/exim/mydomain/trash/.forward
содержанием

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

#Exim filter   <<== do not edit or remove this line!
if error_message then finish endif
if $header_From: contains "@mail.ru"
then
deliver trash@mydomain
deliver dmitry@mydomain
deliverpostmaster@mydomain
endif
Однако письмо приходит как будто фильтра нет :(
и как заставить Эксим писать в логе о применении/неприминении роутеров?

Re: Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 14:12:21
Alex Keda
в отладке запускал?

Re: Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 15:04:52
mitry13
В отладке фильтра все нормально... а есть способ посмотреть где он фильтр ищет в роутере?

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

garmail:/var/mail/exim/mydomain/trash# /usr/sbin/exim4 -bf .forward <test
Return-path taken from "Return-path:" header line
Return-path = mitry13@mail.ru
Sender      = root@mydomain
Recipient   = root@mydomain

Testing Exim filter file ".forward"
Deliver message to: trash@garant.stz.ru
Deliver message to: dmitry@garant.stz.ru
Deliver message to: postmaster@garant.stz.ru
Filtering set up at least one significant delivery or other action.
No other deliveries will occur.

Re: Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 15:14:34
Alex Keda
письмо в отладке отправь

Re: Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 17:13:50
Гость
А как это сделать? :(
если exim -d+all trash@mydomain
From: zzz@mail.ru
To: trash@mydomain
Subject: Test
То в получившемся логе нифига про роутеры и фильтры нет :(

Re: Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 20:18:27
Alex Keda
значит он ими не обрабатывается.
и причина - указана в нём же

Re: Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 22:51:54
Гость
Спасибо! Разобрался... просто почему-то Putty при повторной отправке письма лог полный не выдает... а так дело было в check_local_user т.к. у нас виртуальные а не системные пользователи и в правах к файлу с фильтром (Exim'у не нравился полный доступ на все для всех).

Re: Вопрос по пользовательским фильтрам

Добавлено: 2007-11-27 23:13:13
Alex Keda
а путти вообще странное создание.
может вообще сессию закрыть если резко в консоль много всего лезет...