problem - configuring MySQL for postfix/courier catch-all

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 virtualaliasmaps. 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 …

smtpdbanner = $myhostname ESMTP $mailname (Ubuntu)

biff = no

appenddotmydomain = no

readme_directory = no

smtpdsaslauth_enable = yes

brokensaslauth_clients = yes

smtpdsaslauthenticated_header = yes

smtpdrecipientrestrictions = permitmynetworks, permitsaslauthenticated, rejectunauth_destination

smtpdusetls = yes

smtpdtlscert_file = /etc/ssl/certs/mailcert.pem

smtpdtlskeyfile = $smtpdtlscertfile

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

mailboxsizelimit = 0

recipient_delimiter = +

inet_interfaces = all

virtualaliasdomains =

virtualaliasmaps = proxy:mysql:/etc/postfix/mysql-forwards.cf, mysql:/etc/postfix/mysql-email.cf

virtualmailboxdomains = proxy:mysql:/etc/postfix/mysql-domains.cf

virtualmailboxmaps = proxy:mysql:/etc/postfix/mysql-mailboxes.cf

virtualmailboxbase = /home/vmail

virtualuidmaps = static:5000

virtualgidmaps = static:5000

Would I be right in thinking I need to change the above to:

myhostname = localhost

virtualaliasdomains = mydomain.com mydomain2.com another.tld

And .. well, here's where I am most confused what to do…

virtualaliasmaps = 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.

3 Replies

In the past, I have done catch-all addresses in virtualmailboxmaps by creating an entry for @domain.com with the mailbox location. For example if I want the catch-all to go to user1@domain.com

user1@domain.com domain.com/user1/.maildir/
@domain.com domain.com/user1/.maildir/

I've never used mysql though, so not sure if it will work for you.

tx Stever, appreciate that, will try.

hmmn, have gone for Google apps for now!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct