I don't know the best way to achieve this. I have some "user" packages which install various users on a linux system. I want the setup to be entirely automated, and as part of this I want to set up some mail aliases for each user, and add their alias to the root alias. Essentially, the following represents one user:
root: bob bob: b...@example.com I have 0 or more of these user packages, and I want to, some how, merge all these aliases together. So, if another user has `root: dole`, the final entry would be equivalent to `root: bob, dole`. I've got something working with augtool which updates the /etc/postfix/aliases file. But, I don't really like this solution. Ideally, I could just have something like /etc/postfix/aliases.d/bob and newaliases would take care of the merging. It seems like it should be possible, given how the database is updated, but I'm not really sure how this should work. I tried reading the man pages of postalise and newalias but it wasn't really obvious how I should do it. And, perhaps there is a better way to achieve this? Kind regards, Samuel