#!/bin/bash # # Mailman auto unsubscription by Bob Puff 01/15/01 # # Pass two parameters to this script: # /home/mailman/unsub # Call from your aliases file like: # test-unsub: /home/mailman/unsub test yourdomain.com # sp="xxxx" # *** Put your site password here *** # # read fl ; addr="`echo $fl | awk '{print $2}'`" ; # Yeah, it's crude, but it gets the user's address most of the time echo "From: $1-admin@$2" > /tmp/$addr echo "To: $1-request@$2" >> /tmp/$addr echo "Subject: unsubscribe $sp $addr" >> /tmp/$addr echo "" >> /tmp/$addr echo "unsubscribe $sp $addr" >> /tmp/$addr echo "" >> /tmp/$addr /usr/lib/sendmail -f $1-admin@$2 $1-request@$2 < /tmp/$addr rm /tmp/$addr # send the unsub to mailman, and clean up echo "From: $1-admin@$2" > /tmp/$addr echo "To: $addr" >> /tmp/$addr echo "Subject: Unsubscription Confirmation" >> /tmp/$addr echo "" >> /tmp/$addr echo "This message is to confirm your unsubscription request to" >> /tmp/$addr echo "the $1 list. You will receive no more messages from" >> /tmp/$addr echo "this list. Thank you." >> /tmp/$addr echo "" >> /tmp/$addr /usr/lib/sendmail -f $1-admin@$2 $addr < /tmp/$addr rm /tmp/$addr # send msg to the person, and clean up