This method uses a 'Postfix' workaround.

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

Introduction

To be read in conjunction with the mailman installation instructions at
<http://www.list.org/mailman-install/index.html>
and the post by Ed Greenberg at
<http://mail.python.org/pipermail/mailman-users/2004-June/037518.html>

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

#adduser

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/
mail/sendmail.cf

su# grep "DefaultUser" /etc/mail/sendmail.cf
=> #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>
ServerName lists.practiceimprovement.com.au
TransferLog /dev/null
DocumentRoot /usr/home/lists/htdocs/
ScriptAlias /mailman/ /usr/local/mailman/cgi-bin/
Alias&nbsp;&nbsp; /pipermail/ /usr/local/mailman/archives/public/
</VirtualHost>

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 medicine.net.au and the address I wanted to use was practiceimprovement.org.au, even though practiceimprovement.org.au was correctly set up on dns to be delegated to the right server.

So I used Ed Greenberg's clever approach at
<http://mail.python.org/pipermail/mailman-users/2004-June/037518.html>
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
/usr/bin/newaliases

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 sendmail.cf file to include the new alias file
(for me, add this to medicine.net.au.mc)
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
add=>
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 mm_cfg.py has these added

DEFAULT_EMAIL_HOST = 'practiceimprovement.com.au'
DEFAULT_URL_HOST = 'lists.practiceimprovement.com.au'
DEFAULT_URL_PATTERN = 'http://%s/mailman/'
add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)
IMAGE_LOGOS = '/images/'
MTA='Postfix'
POSTFIX_ALIAS_CMD = '/usr/local/bin/sudo /usr/local/sbin/
mailman.aliases'
POSTFIX_STYLE_VIRTUAL_DOMAINS = \[\]

Steps 8 - 15


Follow the rest of the instructions from step 8 on at ->
<http://www.gnu.org/software/mailman/mailman-install/index.html>

Testing

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: tony@pi.com.au
To: testlist@pi.com.au
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: tony@pi.com.au
To: testlist@pi.com.au
Subject: Merry Xmas

test mail body
" \| /bin/sendmail \-tony@pi.com.au testlist@pi.com.au

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)