mlmmj is a nice, clean mailing list manager. Postfix setup on Gentoo is pretty easy, following the Postfix README. The following assumes you've already got Postfix working.


Install mlmmj:

# emerge -av mlmmj

Add a mlmmj user, so the list doesn't have to run with root permissions:

# useradd -rmd /dev/null -s /sbin/nologin mlmmj

Make a spool directory:

# mkdir /var/spool/mlmmj
# chown mlmmj.mlmmj /var/spool/mlmmj

Create a mailing list (e.g. mlmmj-test):

# sudo -c mlmmj:mlmmj -L mlmmj-test

Use a transport map so Postfix can invoke the mlmmj executables as the mlmmj user. In /etc/postfix/

virtual_alias_maps = hash:/etc/postfix/virtual
transport_maps = hash:/etc/postfix/transport
mlmmj_destination_recipient_limit = 1

In /etc/postfix/virtual, add a line for each mailing list.

In /etc/postfix/transport, add a line for each mailing list. The following line maps the virtual address ( to a transport (mlmmj) with a given nexthop address (mlmmj-test):        mlmmj:mlmmj-test

Add the referenced transport to /etc/postfix/

mlmmj   unix  -       n       n       -       -       pipe
  flags=DORhu user=mlmmj argv=/usr/bin/mlmmj-recieve -F -L /var/spool/mlmmj/$nexthop/

The flags are:

  • D - Prepend a 'Delivered-To: recipient' header
  • O - Prepend an 'X-Original-To: recipient' header
  • R - Prepend a 'Return-Path:'. header
  • h - fold $nexthop to lowercase
  • u - fold $recipient to lowercase

Restart Postfix:

# /etc/init.d/postfix restart

Add the maintenance daemon (which will drop permissions automatically) to the root crontab:

0 */2 * * *  /usr/bin/mlmmj-maintd -F -d /var/spool/mlmmj

Configuring the list

Set custom headers:

# cat /var/spool/mlmmj/mlmmj-test/control/customheaders
X-Mailinglist: mlmmj-test

Set custom footers:

# cat /var/spool/mlmmj/mlmmj-test/control/customfooters
To unsubscribe send a mail to

Set a subject prefix (e.g. Subject: [mlmmj-test] how are we doing?)

# echo '[mlmmj-test]' > /var/spool/mlmmj/mlmmj-test/control/prefix

Make a moderated list:

# touch /var/spool/mlmmj/mlmmj-test/control/moderated
# echo ' > /var/spool/mlmmj/mlmmj-test/control/moderators
# echo ' >> /var/spool/mlmmj/mlmmj-test/control/moderators

Command line maintenance

Subscribe users:

# mlmmj-sub -L /var/spool/mlmmj/mlmmj-test/ -a

Unsubscribe users:

# mlmmj-unsub -L /var/spool/mlmmj/mlmmj-test/ -a

See the other mlmmj-* utilities for more goodies.

Email interface

In the following, listname should be replaced by the name of the list. For example, mlmmj-test from the examples above.

  • Send mail to the list at
  • Send off-list mail to the list owner at
  • Send off-list mail to the list moderators at
  • Subscribe with an empty email to
  • Unsubscribe with an empty email to
  • Get help on other features of mlmmj by sending an empty email to