[Dovecot] Postfix, MySQL, Dovecot LDA and alias domains
Lampa
lampacz at gmail.com
Tue Jun 22 15:30:42 EEST 2010
Hello,
you must combine 2 queries (first for real domain, second for aliased
domain), see my user_query
SELECT CONCAT('/home/mail/', d.domena, '/', u.uzivatel) AS home, 500
AS uid, 500 AS gid, u.quota AS quota_rule, 'Trash:ignore' AS
quota_rule2 FROM uzivatele AS u JOIN
domeny AS d ON d.id = u.domeny_id WHERE u.domeny_id = (SELECT
a.domeny_id_realna FROM domeny_aliasy AS a JOIN domeny AS d ON d.id =
a.domeny_id_alias JOIN domeny AS dd ON dd.id = a
.domeny_id_realna WHERE d.domena = '%d' AND d.priznak & 2 = 2 AND
d.priznak & 1 = 0 AND dd.priznak & 1 = 0 UNION SELECT id FROM domeny
WHERE domena = '%d' AND priznak & 2 = 0 AND p
riznak & 1 = 0) AND u.uzivatel = '%n' AND u.priznak & 1 = 0
tables:
uzivatele = users
domeny = domains
domeny_aliasy = domain aliases
colums:
domena = domain
uzivatel = user
domeny_id = domain_id
domeny_id_realna = real_domain_id
domeny_id_alias = alias_domain_id
priznak = bit flags (for domain - disabled, alias, ...., for users - disabled)
2010/6/22 Darek M <fafaforza at gmail.com>:
> On Tue, Jun 22, 2010 at 7:08 AM, Charles Marcus
> <CMarcus at media-brokers.com> wrote:
>> On 2010-06-22 7:06 AM, Darek M wrote:
>>> I have a postfix/postfixadmin/mysql/dovecot install that was using
>>> 'virtual' for the LDA. I tried the 'dovecot' LDA to enable Sieve but
>>> ran into trouble with aliases. With domain "some-domain.com" being an
>>> alias to "somedomain.com", mail sent to *@somedomain.com would be
>>> delivered to the Maildir fine, but the 'dovecot' LDA tossed "unknown
>>> user" for anything sent to *@some-domain.com (the alias to the other
>>> domain).
>>
>> The MTA is what does recipient validation...
>>
>> postconf -n output would be helpful...
>>
>
>
> I reverted back to 'virtual', so replace the "virtual_*" directives at
> the end with the 3 lines at the very bottom for what my config was
> when using the 'dovecot' LDA.
>
>
> alias_database = hash:/etc/aliases
> alias_maps = hash:/etc/aliases
> alternate_config_directories = /etc/postfix-in
> broken_sasl_auth_clients = yes
> command_directory = /usr/sbin
> config_directory = /etc/postfix
> content_filter = amavisfeed:[127.0.0.1]:10024
> daemon_directory = /usr/libexec/postfix
> data_directory = /var/lib/postfix
> debug_peer_level = 2
> html_directory = no
> inet_interfaces = localhost 1.2.3.4
> inet_protocols = ipv4
> mail_owner = postfix
> mailq_path = /usr/bin/mailq.postfix
> manpage_directory = /usr/share/man
> message_size_limit = 104857600
> mydestination = localhost.$mydomain, localhost
> myhostname = domain.com
> mynetworks = 127.0.0.0/8 1.2.3.4/29
> mynetworks_style = host
> newaliases_path = /usr/bin/newaliases.postfix
> queue_directory = /var/spool/postfix
> readme_directory = /usr/share/doc/postfix-2.6.5/README_FILES
> sample_directory = /usr/share/doc/postfix-2.6.5/samples
> sendmail_path = /usr/sbin/sendmail.postfix
> setgid_group = postdrop
> smtp_tls_note_starttls_offer = yes
> smtp_use_tls = yes
> smtpd_recipient_restrictions = reject_non_fqdn_recipient
> permit_mynetworks permit_sasl_authenticated
> reject_unauth_destination reject
> smtpd_sasl_auth_enable = yes
> smtpd_sasl_authenticated_header = no
> smtpd_sasl_local_domain = domain.com
> smtpd_sasl_path = private/auth
> smtpd_sasl_security_options = noanonymous
> smtpd_sasl_type = dovecot
> smtpd_tls_CAfile = /etc/postfix/ssl/smtpd.pem
> 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
> soft_bounce = no
> tls_random_source = dev:/dev/urandom
> transport_maps = hash:/etc/postfix/transport
> unknown_local_recipient_reject_code = 550
> virtual_alias_maps =
> proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf,
> proxy:mysql:/etc/postfix/mysql_virtual_alias_domain_maps.cf
>
> virtual_gid_maps = static:5000
> virtual_mailbox_base = /home/vmail
> virtual_mailbox_domains =
> proxy:mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
> virtual_mailbox_limit = 209715200
> virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
> virtual_minimum_uid = 100
> virtual_uid_maps = static:5000
>
>
> dovecot_destination_recipient_limit = 1
> virtual_mailbox_domains =
> proxy:mysql:/etc/postfix/mysql_virtual_mailbox_domains.cf
> virtual_transport = dovecot
>
>
>
> master.cf:
>
> # Dovecot LDA
> dovecot unix - n n - - pipe
> flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -d ${recipient}
>
--
Lampa
More information about the dovecot
mailing list