LINUX.ORG.RU
ФорумAdmin

Postfix+Cyrus+Sasl Виртуальные ящики/домены как?


0

0

никак не разберусь с почтовыми ящиками...
висят 4 домена на 1 ип (web настроен на виртуальные хосты)

есть учетка info
письма на info@domain1.ru, info@domain2.ru и т.д.
приходят во все учетки т.е. домены воспринимаются не как виртуальные домены а как синонимы :(

пишу virtual и такое ощущение что он вообще не воспринимает его, хотя db создается

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


# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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

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

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

# 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:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# Sasl parameters
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_authenticated_header = yes
smtpd_sasl_application_name = smtpd

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname

mydestination = domain1.ru, domain2.ru, domain3.ru, domain4.ru, localhost, localhost.localdomain

relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

#предоставим возможность cyrus забирать почту у postfix
mailbox_transport = lmtp:unix:/var/run/cyrus/socket/lmtp

#В случае с pam-авторизацией по логинам и паролям системных
#пользователей все cработало бы без проблем.
#Но когда имена и пароли хранятся в формате, отличном от системного,
#необходимо указать данную опцию. Она означает "принимать письма для любого адресата".
#Это, конечно, не лучший выход, однако лучшего пока найти не удалось
local_recipient_maps =

content_filter=smtp-amavis:[127.0.0.1]:10025
receive_override_options = no_address_mappings

#проба виртуальных карт
virtual_domains = domain1.ru, domain2.ru, domain3.ru, domain4.ru
virtual_maps = hash:/etc/postfix/virtual

/postfix/virtual
info@domain1.ru info
@domain1.ru postmaster


При таком раскладе я могу послать письмо например на info@domain3.ru
и принять его на учетке info@domain2.ru

Возможно это тебе поможет:

Here is an example of a virtual mailbox domain "example.com":

1 /etc/postfix/main.cf: 2 virtual_mailbox_domains = example.com ...more domains... 3 virtual_mailbox_base = /var/mail/vhosts 4 virtual_mailbox_maps = hash:/etc/postfix/vmailbox 5 virtual_minimum_uid = 100 6 virtual_uid_maps = static:5000 7 virtual_gid_maps = static:5000 8 virtual_alias_maps = hash:/etc/postfix/virtual 9 10 /etc/postfix/vmailbox: 11 info@example.com example.com/info 12 sales@example.com example.com/sales/ 13 # Comment out the entry below to implement a catch-all. 14 # @example.com example.com/catchall 15 ...virtual mailboxes for more domains... 16 17 /etc/postfix/virtual: 18 postmaster@example.com postmaster

Notes:

* Line 2: The virtual_mailbox_domains setting tells Postfix that example.com is a so-called virtual mailbox domain. If you omit this setting then Postfix will reject mail (relay access denied) or will not be able to deliver it (mail for example.com loops back to myself).

NEVER list a virtual MAILBOX domain name as a mydestination domain!

NEVER list a virtual MAILBOX domain name as a virtual ALIAS domain!

* Line 3: The virtual_mailbox_base parameter specifies a prefix for all virtual mailbox pathnames. This is a safety mechanism in case someone makes a mistake. It prevents mail from being delivered all over the file system.

* Lines 4, 10-15: The virtual_mailbox_maps parameter specifies the lookup table with mailbox (or maildir) pathnames, indexed by the virtual mail address. In this example, mail for info@example.com goes to the mailbox at /var/mail/vhosts/example.com/info while mail for sales@example.com goes to the maildir located at /var/mail/vhosts/example.com/sales/.

* Line 5: The virtual_minimum_uid specifies a lower bound on the mailbox or maildir owner's UID. This is a safety mechanism in case someone makes a mistake. It prevents mail from being written to sensitive files.

* Lines 6, 7: The virtual_uid_maps and virtual_gid_maps parameters specify that all the virtual mailboxes are owned by a fixed uid and gid 5000. If this is not what you want, specify lookup tables that are searched by the recipient's mail address.

* Line 14: The commented out entry (text after #) shows how one would implement a catch-all virtual mailbox address. Be prepared to receive a lot of spam, as well as bounced spam that was sent in the name of anything@example.com.

NEVER put a virtual MAILBOX wild-card in the virtual ALIAS file!!

* Lines 8, 17, 18: As you see, it is possible to mix virtual aliases with virtual mailboxes. We use this feature to redirect mail for example.com's postmaster address to the local postmaster. You can use the same mechanism to redirect an address to a remote address.

* Line 18: This example assumes that in main.cf, $myorigin is listed under the mydestination parameter setting. If that is not the case, specify an explicit domain name on the right-hand side of the virtual alias table entries or else mail will go to the wrong domain.

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.