Hi Sandorferenczy,
OS X Server updates seem to regularly break aliases .... I posted problem with then back when Server 3 was introduced and have once more had problems with them in Server 4.x
To try to get to the bottom of the problems, I did some testing using band new VMWare Fusion Yosemite 10.10.3 install and then updated this with Server 4.1 install.
Here are various findings:
1. By default an OS X install includes the postfix mail system that sits behind OS X Server (www.postfix.org).
2. This install has the following aliases related files included:
1. "/etc/aliases" - which is actually a soft link to "postfix/aliases"
2. "/etc/aliases.db" - which is the hash map created from "/etc/aliases" source file
3.. This default install has all the main postfix configuration files in the directory: "/etc/postfix"
1. The postfix startup configuration file: "/etc/postfix/main.cf" has all the alias related directives commented out
4. On installing OS X Server the following additional and duplicate postfix configuration file area is created.
1. "/Library/Server/Mail/Config/postfix"
2. This new configuration directory also contains the aliases files: "aliases" & "aliases.db"
3. And most importantly the launch script: "/System/Library/LaunchDaemons/com.postfix.master.plist"
4. If you open the property list (.plist) file you will see the command line arguments provided to start the mail system
5. The new OS X Server is started based on the launch script and this can be validated by doing:
1. "ps -ax | grep postfix"
2. If mail server is running you should see "<pid-number> master -f /Library/Server/Mail/Config/postfix/main.cf"
3. This shows that the mail server has been started with the configuration from the OS X Server install
4. Now you can start to work out what is going on....
6. All this is important as if you reading the man pages included if has examples that assume you are working with a standard configuration.
So if you do a command "postconf config_directory" command it might tell you that postfix is using the config in "/etc/postfix", when in fact it is not...
7. So by default with OS X Server mail (I know this is true for Server 3 & 4) the config used is the one in "/Library/Server/Mail/Config/postfix"
1. Now that you are identified the config location, the following are the key items to look for in "main.cf"
2. "alias_maps = hash:/<location>" - this will tell you the location of the "<aliases>.db" file
3. "alias_database = hash:/<location>" - this will tell you the location of the "aliases" file used to generate the hash/db file above
4. "local_recipient_maps = proxy:unix:passwd.byname $alias_maps" - this command is very important
... it is what cause the mail server to trivially reject mail to uses that are not defined. This looks at the known login user ids (via proxy) and
the $alias_maps - which are as above in item 2...
5. "virtual_alias_maps = $virtual_maps hash:/<virtual-users-location> - if you are hosting multiple mail domains within a single server
8. This now gives you flexibility to:
1. Put traditional "aliases" & "aliases.db" at any location you would like and manage then in standard way
2. Have aliases which are by fully qualified domain names as "virtual_users"
3. Use Server Users administration interface via the "Advanced Options..." to create aliases that are held within "Open Directory"
NOTE: In my set up I have machine which is dedicated "Open Directory" master and then replicate this to mail host.
I think this may require that any user within "Open Directory" should be flags as being able to login in order for them to be visible as local recipient,
but have not tested to confirm this. I was finding some strange behavior and enable local accounts on "Open Directory" master and this
appeared to fix problem, with local_receipient , but I also changed other things, so need to confirm this.
NOTE 2: I think that Postfix is cache'ing for lookup to avoid going back to map files and proxy server , which is why there sometimes appears to be very strange
behaviour at time, as it takes a while for update to propagate. Stop / Start mail server to avoid this.
I hope this provides helpful information to anyone trying to diagnose problems with Aliases and OS X Server.
Cheers,
Zebity.