On Apr 23, 2009, at 5:01 PM, Rainer Müller wrote:

Scott Haneda wrote:
Because I can not get dscl to play nice. I need a user of vmail and a
group of vmail with u and g id of 5000.

sudo dscl . -create /Groups/vmail PrimaryGroupID 5000
sudo dscl . -create /Users/vmail UniqueID 5000
sudo dscl . -create /Users/vmail PrimaryGroupID 5000

This will add a group with the name vmail and gid 5000, add a new user
vmail with uid 5000 and set the primary group for this user.

If you additionally set a UserShell such as /usr/bin/false it will not
show up in the login window.

Thanks, I have come up with the following, in case it helps anyone else:
dscl . -create /Users/_vmail
dscl . -append /Users/_vmail RecordName vmail
dscl . -create /Users/_vmail UserShell /usr/bin/false
dscl . -create /Users/_vmail RealName "Virtual Mail Store"
dscl . -create /Users/_vmail UniqueID 5000
dscl . -create /Users/_vmail PrimaryGroupID 5000
dscl . -create /Users/_vmail NFSHomeDirectory /opt/local/var/vmail
dscl . -create /users/_vmail passwd "*"

dscl . -create /groups/_vmail
dscl . -append /groups/_vmail RecordName vmail
dscl . -create /groups/_vmail passwd "*"
dscl . -create /groups/_vmail gid 5000
dscl . -create /groups/_vmail RealName "Virtual Mail Store"

I have made more complex ports in the past that added users, and those
always worked.  Since I can not get a OS X user made on the cli, I
figure, I can coax ports into doing the work for me.

Guess what MacPorts uses internally to create new users... dscl :-)


Yeah, I was looking at the source a bit ago, there was a if condition in there that through me off, so I sort of worked through the above a line at a time, comparing it with
$dscl . read /users/_postfix
until I had them mostly matching up.

I am still stuck with the errors in postfix when an email is attempted to be delivered. I am almost sure it is user/group issues.
--
Scott * If you contact me off list replace talklists@ with scott@ *

_______________________________________________
macports-users mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to