Where does serveradmin store postfix virtual domain settings?

I have an odd issue, not exactly sure what causes it, but here are the symptoms:

In the past I had a catch-all e-mail "@myDomain.net", which in past versions would act as a wildcard.

I gather this no longer works, but the various server upgrade scripts didn't catch that and properly remove it.


Also, for the sake of readability, I entered the domain as myDomain.net and not as my domain.net, which according to RFCs shouldn't make a difference, however any e-mail address I now add causes a mydomain.net domain to be created, in addition to the myDomain.net.

myDomain.net is a secondary domain, I also have a main domain, which I shall call domain.com


So, now in /Library/Server/Mail/Config I end up with one problematic file: virtual_users (and of course virtual_users.db)

This of course says:


### DO NOT MANUALLY EDIT THIS FILE ###

# This file is automatically generated

# any manual modifications will be lost

# myDomain.net

@myDomain.net me

me@myDomain.net me

# domain.com

me@domain.com


In the server's user section, the user me at this point only has one e-mail address assigned: me@domain.com

But in the Mail section, it shows both virtual domains, domain.com and myDomain.net


When I try to delete myDomain.net, it goes away, and seconds later is back.

Trying to delete it from the command line with serveradmin doesn't seem to work, either, and of course deleting the offending lines in the file is futile, as the comments properly indicate, since the file is simply recreated.


So, I need a way to bypass this by finding where serveradmin stores these settings from which it auto-generates the corresponding postfix config files.

If I can get my paws on that file, I can use if need be a binary editor to replace @myDomain.net and me@myDomain.net with my@domain.net and memy@domain.net which would have equal length (so I'm not screwing up any offsets) and I'd be rid of both potential sources of error: the leading @ and the capitalization within the domain name.


I need to get rid of these offending entries, because as long as they are present, any attempt at adding a regular user@mydomain.net results in a non-functional mail configuration, so this is rather bothersome...

Replies

To answer my own question, here's how I solved the issue:

1) stop mail services

2) delete /Library/Server/Mail/Data/db/*_maps.json <i.e. virtual_maps.json and other_maps.json>

3) delete /Library/Server/Mail/Config/postfix/virtual_* <i.e. virtual_domains, virtual_domains.db, virtual_users, virtual_users.db>

4) re-add the proper domains and users

5) start mail services


Be sure not to mess with /Library/Server/Mail/Data/db/.mailusersettings.plist unless you do so in a well calculated and surgical way.


Step 3) is probably not needed, but I wanted to be on the safe side and prevent serveradmin from grabbing bad info from these again...