Feature Request
Context
As stated in the documentation, right now, if you want to add a domain catch-all I have to add a new alias in the docker-data/dms/config/postfix-virtual.cf.
Is your Feature Request related to a Problem?
The problem with this approach is that you will have to setup dummy aliases in that file for all users to correctly deliver their emails to their inboxes because if you don't, the catch-all will be selected in the alias resolution phase for all regular users. Pretty cumbersome if you are adding/deleting users regularly.
Describe the Solution you'd like
A better approach for this need is to have a catch-all directive in the vmailbox file, that is to say, in the Postfix virtual_mailbox_maps.
Extract from the Postfix documentation:
Here is an example of a virtual mailbox domain "example.com":
1 /etc/postfix/main.cf:
2 virtual_mailbox_domains = example.com ...more domains...
3 virtual_mailbox_base = /var/mail/vhosts
4 virtual_mailbox_maps = hash:/etc/postfix/vmailbox
5 virtual_minimum_uid = 100
6 virtual_uid_maps = static:5000
7 virtual_gid_maps = static:5000
8 virtual_alias_maps = hash:/etc/postfix/virtual
9
10 /etc/postfix/vmailbox:
11 [email protected] example.com/info
12 [email protected] example.com/sales/
13 # Comment out the entry below to implement a catch-all.
14 # @example.com example.com/catchall
15 ...virtual mailboxes for more domains...
16
17 /etc/postfix/virtual:
18 [email protected] postmaster
But vmailbox is auto-generated by the postfix-accounts.cf file, and it seems that it could potentially not be stable to modify it with user-patches.sh file regarding potential override by the change-detection code.
So it seems this use case needs some code modification around the vmailbox creation and potentially the setup.sh script.
I am new to the architecture of this project, but I feel like this would need a new file to be fed by a new setup.sh catch-all add <DOMAIN> <EMAIL ADDRESS>, let's say vmailbox-catchall.cf for example.
And then, this file should be added to virtual_alias_maps to be merged by Postfix without the risk of DMS change-detection code overriding our mappings.
E.g.:
This will add this line to docker-data/dms/config/vmailbox-catchall.cf:
@domain.ltd /other-domain.tld/user
and this map should be added into /etc/postfix/main.cf generated conf (by default?):
virtual_mailbox_maps =
texthash:/etc/postfix/vmailbox,
texthash:/etc/postfix/vmailbox-catchall
Also, I wonder if this should be processed/copied from vmailbox-catchall.cf to vmailbox-catchall or if we could just feed the final texthash map from the beginning.
Are you going to implement it?
Yes, because I know the probability of someone else doing it is low and I can learn from it.
What are you going to contribute??
Additional context
Alternatives you've considered
Using a Docker volume to inject this vmailbox-catchall file and a user-patches.sh to patch the main.cf file.
Who will that Feature be useful to?
To everyone who wants to setup a catch-all mailbox without the hassle of adding aliases for all their current and future users.
What have you done already?
Nothing.
Feature Request
Context
As stated in the documentation, right now, if you want to add a domain catch-all I have to add a new alias in the
docker-data/dms/config/postfix-virtual.cf.Is your Feature Request related to a Problem?
The problem with this approach is that you will have to setup dummy aliases in that file for all users to correctly deliver their emails to their inboxes because if you don't, the catch-all will be selected in the alias resolution phase for all regular users. Pretty cumbersome if you are adding/deleting users regularly.
Describe the Solution you'd like
A better approach for this need is to have a catch-all directive in the
vmailboxfile, that is to say, in the Postfix virtual_mailbox_maps.Extract from the Postfix documentation:
But
vmailboxis auto-generated by thepostfix-accounts.cffile, and it seems that it could potentially not be stable to modify it withuser-patches.shfile regarding potential override by the change-detection code.So it seems this use case needs some code modification around the
vmailboxcreation and potentially thesetup.shscript.I am new to the architecture of this project, but I feel like this would need a new file to be fed by a new
setup.sh catch-all add <DOMAIN> <EMAIL ADDRESS>, let's sayvmailbox-catchall.cffor example.And then, this file should be added to
virtual_alias_mapsto be merged by Postfix without the risk of DMS change-detection code overriding our mappings.E.g.:
This will add this line to
docker-data/dms/config/vmailbox-catchall.cf:and this map should be added into
/etc/postfix/main.cfgenerated conf (by default?):Also, I wonder if this should be processed/copied from
vmailbox-catchall.cftovmailbox-catchallor if we could just feed the final texthash map from the beginning.Are you going to implement it?
Yes, because I know the probability of someone else doing it is low and I can learn from it.
What are you going to contribute??
Additional context
Alternatives you've considered
Using a Docker volume to inject this
vmailbox-catchallfile and auser-patches.shto patch themain.cffile.Who will that Feature be useful to?
To everyone who wants to setup a catch-all mailbox without the hassle of adding aliases for all their current and future users.
What have you done already?
Nothing.