Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Server 4 not supporting virtual_users/virtual_domains

I upgraded to Yosemite and the new version of Server. However, since upgrading, mail (postfix) seems to be broken. I was running the server as a mailing list server using Mailman, and postfix was supporting virtual domains and virtual users. Now, when the server receives a message for one of the mailing lists, I receive the following:


postfix/local[59661]: error: od[getpwnam_ext]: no record for user complawtech


I'm also receiving errors about the configuration file when attempting to update aliases:


postfix/postalias[59794]: warning: /etc/postfix/main.cf, line 691: overriding earlier entry: config_directory=/etc/postfix


I've looked at the main.cf in /etc/postfix, and it appears to be very different from the main.cf that exists in /Library/Server/Mail/Config/postfix.


Has anyone else run into these sorts of problems, or figured out how to resolve them?

Posted on Nov 18, 2014 9:13 AM

Reply
8 replies

Jan 11, 2015 6:21 AM in response to mmpcrofton

I had the same problem after upgrading from Server 3 to Server 4.


I figured out that mail is working fine when I was editing the main.cf ( /Library/Server/Mail/Config/postfix/main.cf ) and comment out the following line as so:

#smtpd_require_virtual_map = yes


The hint was given here: Mail service on the OS X Server 4.0 works only locally


But this is not a proper solution 'cause every time the Server App receives an update or the Mail Server is updated Server 4 is updating the main.cf also and is un-commenting that certain line so that the mail delivery breaks again.


So, I had to fix this.

Here is the solution which worked for me.


1. Start the Server App. And make sure that Mail and DNS services are up and running.

2. Go to "Mail"

3. In the domain section delete all domains except the one your server is listening to. Let's call it "mymaindomain.com". This domain must be managed by the DNS service on your server.

4. Go to "Accounts" > Users. Doubleclick any user of your decision and have a look on his/her mail address. You should see only one mail address ending with "@mymaindomain.com".

5. In my case I was using the Mac shortnames as the account names. That caused trouble 'cause I want to have the mail addresses in the way "prename.surname@mymaindomain.com". So I had to rename the account names for each user to prename.surname. (there are some "how tos" by Apple to get this done whith keeping any data)

6. Reboot the server. I preferred to turn the server completely off... and on.

7. Go back in the Server App > Mail.

8. In the domain section click on "+" to add a new domain. In the next window type your additional domain in Domain line - let's say "myseconddomain.com". In the section below you should now enter some members of "myseconddomain.com" and validate the mail addresses that are created for the users you specified. Then click on "create" ... The Server App will now create all the files postfix needs to run virtual domains.

9. You are done!


It seems to be necessary to create the mail addresses that way and NOT in the Accounts / Users section.


Robert

Jan 11, 2015 8:43 AM in response to robbie.rob

Robert,


Thanks. I'm not sure how that is going help me solve my configuration. It does give me things to try. Any help would be appreciated.


My Server 3 configuration is given below. This is following the 'Mailing Lists' section in http://www.postfix.org/VIRTUAL_README.html#mailing_lists


I have three domains

  • localdomain.com
  • virtualdomain1.com
  • virtualdomain2.com


/.../virtual_domains

virtualdomain1.com allow

virtualdomain2.com allow


/.../virtual_users

info@virtualdomain1.com info_v1

info@virtualdomain2.com info_v2

...


/.../aliases

info: local_user, remote_user@gmail.com

info_v1: local_user1, remote_user1@gmail.com

info_v2: local_user2, remote_user2@gmail.com

...


These files get overwritten whenever I make a mail change using the Server 4 GUI and I cannot find a way to make it work using the limiting Server 4 GUI.


It appears the Server 4 GUI only allows local accounts when setting them up under Domains.


This is a 24x7 operational business server where downtime must be managed. I have backup copies that I can quickly put back however I'm afraid of an upgrade or an accidental configuration change that resets the files.


Any help would be appreciated.


David

Jan 11, 2015 12:38 PM in response to mmpcrofton

David - do you have the "open directory" service up and running?

If so... maybe you want to try this:


1. In the Server App - delete all network users in the accounts section.

2. Go to the Open Directory

2. Delete the OD Master completely. (there are some how-tos on the net for a complete removal) It is NOT sufficient to delete the OD Master in the Server App.

3. Stop the Open Directory service.

4. Reboot your machine.

5. Go to the Server App and activate the Open Directory service.

6. Set up some network users in the account section.


After this you will probably have to repeat the nine steps from the post above.


Robert

Jan 11, 2015 2:28 PM in response to robbie.rob

Robert,


I do not have OD setup and I'm not against setting it either.


What I need to see before I try anything major since this is a critical business server is the end goal / setup.


I do not see how configuring OD and following the previous steps setup the mail forwarding rules we need for the three domains. Something you usually do in /.../aliases.


Where are the remote_users@gmail.com setup?

Jan 11, 2015 3:32 PM in response to mmpcrofton

Hm... in simple terms, Server 4 / postfix can deliver mail to users known by the server. But from where does Server 4 "know" your users? Especially virtual users? Server 4 seems to override pathes and uses its own ways. The allocations is done in my setup in /Library/Server/Mail/Config/postfix/aliases.


I do recommend to use the (limited) Server App to configure postfix 'cause manual settings will be overwritten by the Server App and you`ll be going nuts. So, either you set up local users (easiest way for up to 10 users I assume) or you set up users as network accounts. If you go for the second way, you have to use the Open Directory service to provide the login possibility for those users. Virtual user must be connected to users know by Server 4 AND there must be explicit accounts (local or network) for these users. This will be done by the Server App...


Robert

Apr 15, 2015 3:09 AM in response to Samuel Lewis

I've found that just running postmap/postalias/postfix under Yosemite leads to all sorts of troubles, because without any arguments, it looks to /etc/postfix for config info, which is wrong. With any of those commands, use the -c argument to specify the non-default configuration directory of postfix at /Library/Server/Mail/Config/postfix:


postmap -c /Library/Server/Mail/Config/postfix /Library/Server/Mail/Config/postfix/access

postfix -c /Library/Server/Mail/Config/postfix reload


When I used those commands without the -c, I got the same error:


postfix/postalias[59794]: warning: /etc/postfix/main.cf, line 691: overriding earlier entry: config_directory=/etc/postfix


And kept getting it until I re-ran those command correctly.

May 25, 2015 9:13 AM in response to Samuel Lewis

Edit /Library/Server/Mail/Config/postfix/main.cf and remove the following line (or set it to "no"):

smtpd_require_virtual_map = yes


When that is set to "yes," postfix requires a specific mapping in the virtual domain file for each username/domain combination (so "user1@domain1" and "user1@domain2" are completely different), whereas setting it to "no" allows each username to receive mail at all domains (so "user1@domain1" and "user1@domain2" go to the same place) without having to explicitly define it in the virtual mapping.


Also, when you run any postfix commands (postfix, postman, postalias, etc.), use the full path to the Server.app versions:

/Applications/Server.app/Contents/ServerRoot/usr/sbin/[command]


The issue here is that Server 4 includes its own version of postfix, but the original versions of the binaries are still installed in the standard /usr/sbin location. When you run the old ones, you get the warning errors you (and others) are seeing.

Server 4 not supporting virtual_users/virtual_domains

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.