Dovecot Setup Issue.

Ryan Schmidt ryandesign at
Thu May 5 04:24:37 PDT 2016

> On May 4, 2016, at 8:35 PM, Karl Willoughby <karl at> wrote:
> Hi MacPorts Users.
> I have a Mac mini running OS X Yosemite and I'm attempting to follow these instructions:
> I have a problem here:
> Step 2: create directories
> When I enter the following at the command line:
> sudo chown _dovecot:_dovecot /opt/local/var/log/dovecot OS X responds with the following:
> chown: _dovecot: illegal group name
> Previous command line code entered, from here:
> sudo dscl . -create /Groups/_dovecot
> sudo dscl . -create /Groups/_dovecot UniqueID 30 sudo dscl . -create /Users/_dovecot sudo dscl . -create /Users/_dovecot UserShell /bin/false sudo dscl . -create /Users/_dovecot RealName "Dovecot IMAP Server"
> sudo dscl . -create /Users/_dovecot UniqueID 30 sudo dscl . -create /Users/_dovecot PrimaryGroupID 30 sudo dscl . -create /Users/_dovecot NFSHomeDirectory  /opt/local/var/run/dovecot
> Notes:
> The _dovecot Group isn't assigned a PrimaryGroupID, but instead a UniqueID.
> A PrimaryGroupID of 30 is assigned to the _dovecot User.
> When I view a list of all Groups via the following command:
> dscl . readall /groups
> I see a PrimaryGroupID of 30 has already been assigned to _keytabusers.
> I’m unsure what to do; the following are potential options:
> Assign the Group _dovecot a PrimaryGroupID; this may prevent the 'chown: _dovecot: illegal group name' OS X response.
> Assign a different PrimaryGroupID, i.e. other than 30, to both User and  Group to avoid the potential conflict with _keytabusers.
> There may have already been a _dovecot User or Group in the 200 range that I deleted as a result of my confusion.   Perhaps this was assigned during the earlier 'Install dovecot' command, i.e. 'port install dovecot'.   Do
> you know what the original PrimaryGroupID of such a User or Group was?
> If a different PrimaryGroupID is used, i.e. other than 30, presumably the one I deleted would be best.
> Another option is to upgrade to OS X El Capitan, although I'm not sure  whether that will remove the dovecot install thereby allowing me to start again.   I'm also unsure whether I could run the 'port install dovecot'
> command a second time in OS X Yosemite to restore the _dovecot User / Group.   Alternatively, perhaps 'port uninstall dovecot' is a valid command to allow me to start again.
> I've seen reference to dovecot2 in the macports-users archives; perhaps this requires a different syntax, i.e. not 'port install dovecot'.

The old dovecot port creates a user and group "dovecot" upon installation.

The newer dovecot2 port creates 2 users and groups: "_dovecot" and "_dovenull".

If a port is already installed, telling MacPorts to install it again does mostly nothing.

If MacPorts created the above users and groups for you when you installed those ports, but somehow the users or groups were later removed, and you want them created again, uninstalling and reinstalling the port in question should work.

MacPorts does not use a fixed numeric id for any user or group; it uses whatever id is available next on your system, which varies from system to system depending on what other users or groups you already have.

Upgrading OS X will not uninstall software you installed with MacPorts. However, if you upgrade to a new major version of OS X -- for example, from Yosemite to El Capitan -- you must reinstall MacPorts and all ports, as explained in

More information about the macports-users mailing list