Showing posts with label mailman. Show all posts
Showing posts with label mailman. Show all posts

Thursday, September 13, 2007

Using mailman and bash to show list subscriptions suspended for bounces

If mail to a mailman mailing list subscriber bounces too many times, further deliveries to that address are suspended. It's often useful to track down these addresses.

# cd /usr/local/mailman/bin/
# for i in `./list_lists -b`; do echo : $i : >>/tmp/bounced.txt;./list_members --fullnames --nomail=bybounce $i >>/tmp/bounced.txt;done

The contents of the file will look like this:

: 2007-announce :
: 2007classgift :
: 2008-announce :
: 2009-announce :
: 2010-announce :
First Last <NETID@emory.edu>
First1 Last1 <NETID1@emory.edu>
: 505a-0ac-5079 :

Then you can investigate why mail to the two members of the 2010-announce list has been bouncing.

To mail a copy of the output file to yourself from the command line, do this:

# mail -s 'Bounces' YOURNAME@YOURDOM.AIN </tmp/bounced.txt

The key to all this is the "./list_lists -b" in the script fragment above. This gives you a bare listing of all the lists in the system. That gets fed back into the script to locate the held messages. Mailman shines at the command line.

Read More...

Monday, September 10, 2007

Quickie script to update mailman aliases

We run sendmail as our MTA and mailman as our list management solution. This is a script that we use to manage updates for mailman aliases. It leverages the built-in mailman command "genaliases" which will regenerate sendmail-style aliases for all of the lists on the system.


#!/bin/bash

#############################################
# local script written to auto-update
# the aliases.mailman file with new list aliases
#
#############################################

/usr/local/mailman/bin/genaliases >/tmp/aliases.mailman
sed -e "1,4d" </tmp/aliases.mailman >/tmp/aliases.mailman2
mv -f /etc/aliases.mailman /etc/aliases.mailman.bak
cp -f /tmp/aliases.mailman2 /etc/aliases.mailman
rm -f /tmp/aliases.mailman*
newaliases


As you can see from the script, all mailman list aliases are stored in the file /etc/aliases.mailman. To make this work, you need a line like this in your /etc/mail/sendmail.mc file:

define(`ALIAS_FILE', `/etc/aliases,/etc/aliases.mailman')dnl

I'm sure there are lots of other ways to do this. I believe that there are contrib scripts for mailman that more tightly integrate it with sendmail. If you're using Postfix, you can take a look at this suggestion.

Read More...