[Mailman-Users] Re: un-subscription problems

Jon Carnes jonc at nc.rr.com
Mon Sep 23 16:16:41 CEST 2002

On Sun, 2002-09-22 at 23:37, Anthony Carmody wrote:
> ~gulp~ I am not a python programmer. and the users of the list needing the unsubscribe address are artists [do i need to
> say more?]  ..and although I am not 'completely' new to Mailman, I have only had it on my system for a few months AND in
> a moderately vanilla state. I lease a Virtual Server without smrsh that I can see, and I only have a pseudos-root
> permission. I have virtual domains making it a little trickier. I have searched the archives and have not been able to
> find anything that works for me as of yet.
> I suppose what I need to know is: Is there a script [adding addresses to a temp file, hourly cron is fine] that someone
> 'has working' that they can post me that does not need smrsh and has the alias entries examples. preferably something
> that I can pass the variables to like so:
> <mailinlistname>-unsub:            "|/usr/lib/mailman/localbin/unsubscribe.sh <mailinlistname>- <virtualdomain>-"

How about something like this:

 - In the aliases file, add an entry for the unsubscribe email:
     volleyball-unsub:  "|/home/mailman/ext/v-unsub.alias"

 - Create the directory /home/mailman/ext
     mkdir /home/mailman/ext
     chown mail /home/mailman/ext
     chmod 0700 /home/mailman/ext

 - In /home/mailman/ext create the script "v-unsub.alias":
  #! /bin/bash
  # Script to unsubscribe user from volleyball list.
  # Loads file /home/mailman/ext/v-unsub.txt
  # That file is later processed by a Mailman cron job
  #   /home/mailman/ext/v-unsub.cron
  #   Mail to volleyball-unsub at haht.com
  #   Subject: unsubscribe username at domain.com
  UNSUB=`grep -i "Subject: " - |head -1 |cut -f2- -d:`
  for i in $UNSUB
     echo $i >> /home/mailman/ext/v-unsub.txt
  # End of script

 - Create the script v-unsub.cron
  #! /bin/bash
  # Script to unsubscribe user from volleyball list.
  # Removes users found in file /home/mailman/ext/v-unsub.txt
  # The file is loaded via an unsubscribe alias: v-unsub.alias
  for i in `cat /home/mailman/ext/v-unsub.txt`
     /home/mailman/bin/remove_members volleyball $i

 - Make the scripts executable:
     chmod a+x /home/mailman/ext/v-unsub.alias
     chmod a+x /home/mailman/ext/v-unsub.cron

 - Add the script to the Mailman cron jobs:
  su mailman
  cron -i
    15 * * * *   /home/mailman/ext/v-unsub.cron

There is no error checking on any of the scripts and basically anyone
can unsubscribe anyone (or everyone) from the list, but it should work
as a base.

Take care - Jon Carnes

More information about the Mailman-Users mailing list