Добрый день! не удается настроить aliases, отправляю письмо на test(приходит нормально) а test2(пусто).
таблицы в mysql
mysql> select * from virtual_aliases; +----+-----------+--------+-------------------+
| id | domain_id | source | destination |
+----+-----------+--------+-------------------+
| 1 | 1 | test | test@el.vrn.ru |
| 2 | 1 | test | test2@el.vrn.ru |
+----+-----------+--------+-------------------+
2 rows in set (0.00 sec)
mysql> select * from view_aliases; +------------------+-------------------+
| email | destination |
+------------------+-------------------+
| test@el.vrn.ru | test@el.vrn.ru |
| test@el.vrn.ru | test2@el.vrn.ru |
+------------------+-------------------+
2 rows in set (0.01 sec)
в логах упоминаний про aliases вообще нет.
Nov 29 14:58:49 mail postfix/smtpd[10270]: connect from unknown[192.168.100.81]
Nov 29 14:58:49 mail postfix/smtpd[10270]: setting up TLS connection from unknown[192.
168.100.81]
Nov 29 14:58:49 mail postfix/smtpd[10270]: Anonymous TLS connection established from u
nknown[192.168.100.81]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Nov 29 14:58:49 mail postfix/smtpd[10270]: A7D1E20CB7: client=unknown[192.168.100.81],
sasl_method=PLAIN, sasl_username=postmaster@el.vrn.ru
Nov 29 14:58:49 mail postfix/cleanup[10274]: A7D1E20CB7: message-id=<50B7400B.60008@el.vrn.ru>
Nov 29 14:58:49 mail postfix/qmgr[9431]: A7D1E20CB7: from=<postmaster@el.vrn.ru>, si
ze=706, nrcpt=1 (queue active)
Nov 29 14:58:49 mail postfix/smtpd[10270]: disconnect from unknown[192.168.100.81]
Nov 29 14:58:50 mail postfix/pickup[9432]: B5C5920D5C: uid=5002 from=<postmaster@el.vrn.ru>
Nov 29 14:58:50 mail postfix/cleanup[10274]: B5C5920D5C: message-id=<50B7400B.60008@el.vrn.ru>
Nov 29 14:58:50 mail postfix/pipe[10275]: A7D1E20CB7: to=<test@el.vrn.ru>, relay=spa
massassin, delay=1.2, delays=0.17/0.05/0/0.93, dsn=2.0.0, status=sent (delivered via s
pamassassin service)
Nov 29 14:58:50 mail postfix/qmgr[9431]: A7D1E20CB7: removed
Nov 29 14:58:50 mail postfix/qmgr[9431]: B5C5920D5C: from=<postmaster@el.vrn.ru>, si
ze=1001, nrcpt=1 (queue active)
Nov 29 14:58:50 mail clamsmtpd: 100038: accepted connection from: 127.0.0.1
Nov 29 14:58:51 mail postfix/smtpd[10281]: connect from localhost[127.0.0.1]
Nov 29 14:58:51 mail postfix/smtpd[10281]: 3570820CB7: client=localhost[127.0.0.1]
Nov 29 14:58:51 mail postfix/cleanup[10274]: 3570820CB7: message-id=<50B7400B.60008@el.vrn.ru>
Nov 29 14:58:51 mail postfix/qmgr[9431]: 3570820CB7: from=<postmaster@eli.vrn.ru>, si
ze=1216, nrcpt=1 (queue active)
Nov 29 14:58:51 mail clamsmtpd: 100038: from=postmaster@el.vrn.ru, to=test@el.vrn.
ru, status=CLEAN
Nov 29 14:58:51 mail postfix/smtp[10279]: B5C5920D5C: to=<test@el.vrn.ru>, relay=127
.0.0.1[127.0.0.1]:10025, delay=0.75, delays=0.18/0.11/0.22/0.25, dsn=2.0.0, status=sen
t (250 2.0.0 Ok: queued as 3570820CB7)
Nov 29 14:58:51 mail postfix/smtpd[10281]: disconnect from localhost[127.0.0.1]
Nov 29 14:58:51 mail postfix/qmgr[9431]: B5C5920D5C: removed
Nov 29 14:58:51 mail postfix/pipe[10283]: 3570820CB7: to=<test@el.vrn.ru>, relay=dov
ecot, delay=0.51, delays=0.23/0.1/0/0.17, dsn=2.0.0, status=sent (delivered via doveco
t service)
Nov 29 14:58:51 mail postfix/qmgr[9431]: 3570820CB7: removed
Настраиваю по этому ману (http://rubuntu.ru/blog/471/ustanovka-pochtovogo-servera-post...)
postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
body_checks = regexp:/etc/postfix/body_checks
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = scan:127.0.0.1:10025
header_checks = regexp:/etc/postfix/header_checks
home_mailbox = Maildir/
inet_interfaces = all
mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-dovecot-postfix.conf -n -m "${EXTENSION}"
mailbox_size_limit = 0
message_size_limit = 20000000
mydestination = localhost, localhost.$myhostname, $myhostname
mydomain = el.vrn.ru
myhostname = mail.el.vrn.ru
mynetworks = 127.0.0.0/8 192.168.100.0/24
myorigin = $mydomain
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_domains = no
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_banner = $myhostname Welcome to the Sendmail server
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated,
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination, check_policy_service inet:127.0.0.1:10023
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unknown_sender_domain
smtpd_tls_CAfile = /etc/postfix/ssl/smtpd.pem
smtpd_tls_CApath = /etc/ssl/cert
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.pem
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
transport_maps = hash:/etc/postfix/transport
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_minimum_uid = 1000
virtual_transport = dovecot
virtual_uid_maps = static:5000
master.cf
smtp inet n - - - - smtpd
-o content_filter=spamassassin
# -o receive_override_options=
submission inet n - n - - smtpd
-o content_filter=spamassassin
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
smtps inet n - n - - smtpd
-o content_filter=spamassassin
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o milter_macro_daemon_name=ORIGINATING
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}
scan unix - - n - 16 smtp
-o smtp_send_xforward_command=yes
127.0.0.1:10026 inet n - n - 16 smtpd
-o content_filter=
# -o receive_override_options=no_address_mappings
-o smtpd_helo_restrictions=
-o smtpd_client_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks_style=host
-o smtpd_authorized_xforward_hosts=127.0.0.0/8
spamassassin unix - n n - - pipe
user=spamI argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}
***********************************************************************
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
user = user
password = **********
hosts = 127.0.0.1
dbname = server
query = SELECT destination FROM view_aliases WHERE email='%s'
*************************************************************************
mysql:/etc/postfix/mysql-email2email.cf
user = user
password = ********
hosts = 127.0.0.1
dbname = server
query = SELECT email FROM view_users WHERE email='%s'
************************************************************************************
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
Код:
user = user
password = *******
hosts = 127.0.0.1
dbname = server
query = SELECT 1 FROM virtual_domains WHERE name='%s'
**************************************************************************************
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
user = user
password = ********
hosts = 127.0.0.1
dbname = server
query = SELECT 1 FROM view_users WHERE email='%s'
***************************************************************************************
postmap -q test@el.vrn.ru mysql:/etc/postfix/mysql-virtual-alias-maps.cf
test@el.vrn.ru,test2@el.vrn.ru
***************************************************************************************
Если отключить
receive_override_options = no_address_mappings то письма приходят(дублированные)
Пробовал такой вариант (http://cervus-alces.blogspot.ru/2009/01/postfixclamsmtpd.html), не помогло.
подскажите.