[Mailman-Users] Please review this procedure for sendmail integration

Ed Greenberg edg at greenberg.org
Sat Jun 19 16:45:53 CEST 2004


Since many people cannot use David Champion's mm-handler due to shared use 
of domains, I've worked this up. I'd appreciate some constructive comments, 
yea or nay, on this procedure.

Using the postfix MTA functionality to do automatic sendmail alias handling
---------------------------------------------------------------------------

In order to add a list to mailman on a sendmail based system, you need to
add a bunch of aliases for that list to the alias file. In this 
customization,
we implement a second alias file and teach sendmail about it.

We use a mailman feature that was designed for the postfix mail program - a 
replacement for sendmail.  This feature creates /home/mailman/data/aliases

1. We have a script that will copy the alias file and then process it. We 
need to do this
since sendmail doesn't like alias files to be in directories that don't 
meet very
specific permission requirements.  /home/mailman/data doesn't meet this 
requirement. Our script will copy the alias file from /home/mailman/data to 
/etc. It uses a different name in order not to clash with the existing 
/etc/aliases

Create /usr/local/sbin/mailman.aliases with these commands:

/bin/cp /home/mailman/data/aliases /etc/mailman.aliases
/usr/bin/newaliases

2. We have to tell mailman that it is using postfix. We lie.

Add these to mm_cfg.py:

MTA='Postfix'
POSTFIX_ALIAS_CMD = '/usr/bin/sudo /usr/local/sbin/mailman.aliases'
POSTFIX_STYLE_VIRTUAL_DOMAINS = []

3. We have to tell sendmail about the new alias file.

in /etc/mail/sendmail.mc find this line:
define(`ALIAS_FILE', `/etc/aliases')dnl
and change it to:
define(`ALIAS_FILE', `/etc/aliases,/etc/mailman.aliases')dnl
Run a make (or otherwise refresh sendmail.cf and then restart sendmail

Now when we run newaliases, it will rebuild both alias files.

4. We need permission for apache and mailman to run our script from step 1.

In the /etc/sudoers file (use the command /usr/sbin/visudo) we need two 
lines:
apache ALL= NOPASSWD: /usr/local/sbin/mailman.aliases
mailman ALL= NOPASSWD: /usr/local/sbin/mailman.aliases

Note that your web server may not run as 'apache' It may run as 'www' or 
'nobody'.
Whatever it runs as is what you need where it says apache.


5. As mailman, run /home/mailman/bin/genaliases
Check for a file /home/mailman/data/aliases and
also TWO files /etc/mailman.aliases and /etc/mailman.aliases.db

6. Test creating a list using /home/mailman/bin/newlist
Check for the appearance of aliases for that list in /etc/mailman.aliases
Add some users and test the list

7. Test for creating a list using http://domain.com/mailman/create
Check for the appearance of aliases for that list in /etc/mailman.aliases
Add some users and test the list

Ed Greenberg
edg at greenberg.org
6/19/2004




More information about the Mailman-Users mailing list