# mail/mailman , how to manually set userid?



## stefanlasiewski (Jul 27, 2012)

I am building mail/mailman from ports. I need to override the default User ID and Group ID for the Mailman user.

mail/mailman automatically assigns USERID=91 to the mailman user, and then sets the GROUPID to the value of the USERID. This conflicts with my environment (another user has already been assigned UID=91 and GID=91). I need to set a different UID for the Mailman user.


```
[root@host /usr/ports/mail/mailman]# grep USERID Makefile 
MM_USERID?=     91
MM_GROUPID?=    ${MM_USERID}
        @${ECHO} "MM_USERID=91          The user ID of the Mailman user."
        @${ECHO} "MM_GROUPID=MM_USERID  The group ID for the Mailman user."
```

I thought I could override this variable using an environment variable, but my environment variable is ignored.

Note how I set MM_USERID in the environment, but make still says "MM_USERID=91".


```
[root@host /usr/ports/mail/mailman]# make MM_USERID=501 
===>  License GPLv2 accepted by the user
===>  Found saved configuration for mailman-2.1.14_6

You may change the following build options:
MM_USERNAME=mailman     The username of the Mailman user.
MM_USERID=91            The user ID of the Mailman user.
MM_GROUPNAME=mailman    The group to which the Mailman user will belong.
MM_GROUPID=MM_USERID    The group ID for the Mailman user.
MM_DIR=mailman          Mailman will be installed in /usr/local/mailman.
CGI_GID=www             The group name or id under which your web server executes CGI scripts.
IMGDIR=www/icons        Icon images will be installed in /usr/local/www/icons.
```

I also tried adding `MM_USERID=501` to /etc/make.conf, as suggested at http://www.freebsdwiki.net/index.php/Etc/make.conf , but make still sets `MM_USERID=91`.


----------



## SirDice (Jul 30, 2012)

You can set MM_USERID but the text will still print MM_USERID=91. The rest of the script however will use whatever MM_USERID you supplied.


----------



## wblock@ (Jul 30, 2012)

That really should be fixed, and it's pretty easy, just replace MM_USERID=91 with MM_USERID=${MM_USERID} in the Makefile.  stefanlasiewski, please enter a PR.


----------



## stefanlasiewski (Jul 30, 2012)

Thank you. Your suggestions worked. 

The following modification fixes my immediate issues.


```
[root@host /usr/ports/mail/mailman]# diff Makefile Makefile.orig 
42c42
< MM_USERID?=   ${MM_USERID}
---
> MM_USERID?=   91
139c139
<       @${ECHO} "MM_USERID=${MM_USERID}                The user ID of the Mailman user."
---
>       @${ECHO} "MM_USERID=91          The user ID of the Mailman user."

[root@host /usr/ports/mail/mailman]# make install
...

[root@host /usr/ports/mail/mailman]# ls -ld /usr/local/mailman/
drwxrwsr-x  21 mailman  mailman  21 Jul 30 12:26 /usr/local/mailman/
```

The following information is really a topic for another thread, but I want to post some related information for posterity and for other users who find this thread. 

The problem I mentioned above is related to other problems with this port. The proper group ownership for this port is debatable, and there has been no clear fix for a while. Since the setgid bit is set for /usr/local/mailman/ and everything underneath, the group ownership is important. There have been a few fixes, regressions and rollbacks related to this. See the following topics for more information:

   * The following FreeBSD Problem Report: "PR ports/166006: Problem with mail/postfix and mail/mailman integration"
   * "Mailman GID problem" on freebsd-ports
   * "ports/142000: [patch] Wrong MAIL_GID when configuring mail/mailman for postfix MTA" on freebsd-ports


----------

