I've got Postfix working with Courier and MySQL, but now want to set up catch-all mail accounts. But how? I am particularly confused about using MySQL for virtual_alias_maps. I guess I have to somehow cross-reference existing tables, and maybe create a catchall table for each domain. (I have next to no experience playing with this.)
My main.cf reads ...
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/ssl/certs/mailcert.pem
smtpd_tls_key_file = $smtpd_tls_cert_file
myhostname = mail.mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =
relayhost =
mynetworks = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-forwards.cf, mysql:/etc/postfix/mysql-email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
...
Would I be right in thinking I need to change the above to:
myhostname = localhost
virtual_alias_domains = mydomain.com mydomain2.com another.tld
And .. well, here's where I am most confused what to do...
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-forwards.cf, mysql:/etc/postfix/mysql-email.cf # What do I do here??
...
Were I not using MySQL, I guess I would set up /etc/postfix/virtual map file and add something like:
@mydomain.com
newbie@mydomain.com
@another.tld
newbie@mydomain.com
... but as I have created mySQL tables for domains, users, email and forward, I am guessing I need to do something different,
...and thought I would ask before messing everything up.
Any pointers greatly appreciated.