Форум русскоязычного сообщества Ubuntu


Следите за новостями русскоязычного сообщества Ubuntu в Twitter-ленте @ubuntu_ru_loco

Автор Тема: Непонятки с POSTFIX  (Прочитано 2321 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн Malamut

  • Автор темы
  • Ubuntu Member
  • Администратор
  • Старожил
  • *
  • Сообщений: 3337
  • Я добрый, честно!
    • Просмотр профиля
    • Моя страница на Launchpad
Непонятки с POSTFIX
« : 05 Февраля 2010, 17:08:23 »
Настраиваю POSTFIX на пересылку части коореспонденции на другой сервак, а части - сохранения локально. Вот как выглядит main.cf:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

relay_domains = example.com
relay_recipient_maps = hash:/etc/postfix/relay_users

# Host and domain config

myhostname = mail.example.com
mydestination =
 $mydomain,
 $myhostname,
 mailsrv0.dcn.local
myorigin = $mydomain
mynetworks = 127.0.0.0/8

local_recipient_maps =

# Redirection
disable_dns_lookups = yes
relayhost = smtp.wplus.net

#virtual_transport = hash:/etc/postfix/transport
transport_maps = hash:/etc/postfix/transport

# Aliases
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# Server Options

mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

Вот что даёт postconf -n:

# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
disable_dns_lookups = yes
inet_interfaces = all
inet_protocols = all
local_recipient_maps =
mailbox_size_limit = 0
mydestination = $mydomain, $myhostname, mailsrv0.dcn.local
myhostname = mail.example.com
mynetworks = 127.0.0.0/8
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
relay_domains = example.com
relay_recipient_maps = hash:/etc/postfix/relay_users
relayhost = smtp.wplus.net
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
transport_maps = hash:/etc/postfix/transport

Содержимое transport:

example.com   smtp:[192.168.0.2]
Проблема в том, что эта редиска никак не хочет фильтровать почту по relay_recipient_maps, все письма для $relay_domains благополучно посылаются на внутренний сервак даже если получателя нет в relay_recipient_maps впомине!

Пользователь решил продолжить мысль 05 Февраля 2010, 17:19:26:
Гугление подсказало что relay_recipient_maps не работает, если есть transport_maps с записью для того же домена. Но тогда вопрос: а как указать сервак, на который пересылать почту для конкретных юзеров конкретного домена?
« Последнее редактирование: 05 Февраля 2010, 17:19:27 от Malamut »
"Носителем суверенитета и единственным источником власти в Российской Федерации является ее многонациональный народ" Конституция РФ

Оффлайн aSmile

  • Активист
  • *
  • Сообщений: 755
    • Просмотр профиля
Re: Непонятки с POSTFIX
« Ответ #1 : 05 Февраля 2010, 17:28:40 »
а в alias нельзя?

Оффлайн Karl500

  • Заслуженный пользователь
  • Старожил
  • *
  • Сообщений: 2267
    • Просмотр профиля
Re: Непонятки с POSTFIX
« Ответ #2 : 05 Февраля 2010, 20:32:58 »
Вот это не поможет?
Цитировать
the  table  can  be provided as a regular-expression map where patterns are given as regular expressions
и
Цитировать
       With lookups from indexed files such as DB or DBM, or from
       networked tables such as NIS, LDAP or  SQL,  patterns  are
       tried in the order as listed below:

       user+extension@domain transport:nexthop
              Deliver   mail  for  user+extension@domain  through
              transport to nexthop.

       user@domain transport:nexthop
              Deliver mail for user@domain through  transport  to
              nexthop.

       domain transport:nexthop
              Deliver  mail  for domain through transport to nex-
              thop.

       .domain transport:nexthop
              Deliver mail for any subdomain  of  domain  through
              transport  to  nexthop.  This applies only when the
              string transport_maps is not  listed  in  the  par-
              ent_domain_matches_subdomains   configuration  set-
              ting.  Otherwise, a domain name matches itself  and
              its subdomains.

       * transport:nexthop
              The  special pattern * represents any address (i.e.
              it functions  as  the  wild-card  pattern,  and  is
              unique to Postfix transport tables).
Т.е. можно перечислить, какую почту куда пересылать.

Или я Вас не понял?

 

Страница сгенерирована за 0.017 секунд. Запросов: 21.