schleuder + postfix whole (sub-)domain mapping seems to erroneously hairpin root domain through postfix as well
I have the following in my postfix main.cf, to avoid having to update postfix each time I create a new list and/or list under a new (sub-)domain:
# Schleuder - To dedicate a whole domain to Schleuder, add these lines to main.cf:
schleuder_destination_recipient_limit = 1
virtual_mailbox_domains = sqlite:/etc/postfix/schleuder_domain_sqlite.cf
virtual_transport = schleuder
virtual_alias_maps = hash:/etc/postfix/virtual_aliases
virtual_mailbox_maps = sqlite:/etc/postfix/schleuder_list_sqlite.cf
And here are the contents of /etc/postfix/schleuder_domain_sqlite.cf:
dbpath = /var/lib/schleuder/db.sqlite
query = select distinct substr(email, instr(email, '@') + 1) from lists
where email like '%%%s'
This has been working fine until today, when I created a new list under a new (sub-)domain ... let's call it newlist@dl.example.com. After creating this list via schleduer-cli I suddenly began receiving errors from schleduer trying to process messages for other lists that had recipients whose email addresses were part of the root domain (example.com)
To restore things, I had to delete newlist@dl.example.com using schleuder-cli & also needed to restart postfix at which point messages once again started flowing to users@example.com
It seems the creation of the newlist@dl.example.com caused postfix to think it should be handling all mail for users@example.com locally, which I would suspect is a result of the data returned from the sqlite db when it is queried for the virtual_mailbox_domains directive