This method uses a 'Postfix' workaround.

See also Integrating Mailman with Sendmail - Method 1 which uses mm-handler.


To be read in conjunction with the mailman installation instructions at
and the post by Ed Greenberg at

Step 1 - Installation requirements

I'm using Apache2, Mailman 2.19 and FreeBSD4 and Python 2.4

Step 2 - Set Up Your System

As root


I used -> user: mailman, group:mailman, password: n

Step 3 - Build and Install Mailman

create Installation Directory (as root)

su# cd /usr/local/
su# mkdir mailman
su# chown mailman mailman
su# su mailman
su# cd mailman
su# chgrp mailnull .
su# chmod a+rx,g+ws .

Now, go to the directory where you have downloaded mailman

su# cd /usr/home/xxxxx/mailman-2.1.9

Change back to user root

su# su root

You can ascertain the correct option for --with-mail-gid from /etc/

su# grep "DefaultUser" /etc/mail/
=> #O DefaultUser=mailnull
So use mailnull

su# su root
su# make clean
su# configure \--with-mail-gid=mailnull

I'm on FreeBSD so use this command

su# make DIRSETGID=: install

Now check permissions

su# cd /usr/local/mailman
su# bin/check_perms \-f

My webserver runs as nobody (check httpd.conf on your system to confirm)

su# grep "User " /usr/local/apache2/conf/httpd.conf
=> User nobody

su# cd archives
su# chown nobody private
su# chmod o-x private

Step 4 - Check your installation

su# cd /usr/local/mailman
su# bin/check_perms \-f

Step 5 - Set up your webserver

Add this to your httpd-vhosts.conf, or httpd.conf depending on which 
version of Apache you are using

<VirtualHost \*:80>
TransferLog /dev/null
DocumentRoot /usr/home/lists/htdocs/
ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/
Alias&nbsp;&nbsp; /pipermail/ /usr/local/mailman/archives/public/

and restart apache

Step 6 - Integrating sendmail and mailman

Integrating sendmail and mailman

mm-handler would not work for me (after considerable amount of time trying) - I think because by server was and the address I wanted to use was, even though was correctly set up on dns to be delegated to the right server.

So I used Ed Greenberg's clever approach at
which seems better to me anyway.

Note: On Freebsd I first had to build sudo!

create the file /usr/sbin/mailman.aliases

su# pico /usr/bin/mailman.aliases

containing the lines below =>

/bin/cp /usr/local/mailman/data/aliases /etc/mail/mailman.aliases

Note: I spent a lot of time bug testing as I used 'cp' in the 
mailman.aliases script rather than /bin/cp
(it worked from the command line but not the web interface)

make it executable

su# chmod 755 /usr/sbin/mailman.aliases

Change your file to include the new alias file
(for me, add this to
define(ALIAS_FILE', /etc/mail/aliases,/etc/mail/mailman.aliases')
(and then as root)

su# /etc/mail/make install restart

Update your sudoers file ('nobody' is the user apache runs under - 
check your httpd.conf)

su# visudo
nobody ALL= NOPASSWD: /usr/local/sbin/mailman.aliases
mailman ALL= NOPASSWD: /usr/local/sbin/mailman.aliases

Also, if you have

Defaults requiretty

in the sudoers file, you need to remove or comment it.

Step 7 - Review your site defaults

my has these added

DEFAULT_URL_PATTERN = 'http://%s/mailman/'
IMAGE_LOGOS = '/images/'
POSTFIX_ALIAS_CMD = '/usr/local/bin/sudo /usr/local/sbin/

Steps 8 - 15

Follow the rest of the instructions from step 8 on at ->


When you create a list using /bin/newlist, you should find that the file /etc/mail/mailman.aliases has been created / updated.
(I had some permissions to sort out in a few directories before it all worked smoothly)
The error log is helpful at /usr/local/mailman/logs/error

These commands can be helpful for troubleshooting, after you have successfully created a testlist and subscribed yourself to that list

To test mailman

su# echo "From:
Subject: Happy New Year

test mail body
" \| /usr/local/mailman/mail/mailman post testlist

If that works, use this to test your sendmail/mailman integration

su# echo "From:
Subject: Merry Xmas

test mail body
" \| /bin/sendmail \

Hope this helps someone and would welcome corrections or improvements.

MailmanWiki: DOC/Integrating Mailman with Sendmail - Method 2 (last edited 2016-06-21 16:34:47 by msapiro)