[Mailman-Users] Another passwordless unsubscribe script
Jamey
jamey at infr.com
Thu Apr 12 06:36:13 CEST 2001
I can't seem to get this one to work. I have the script installed and I am
getting NO error messages and a confirmation email address telling me I have
been removed, but when I look at the member list my address is still there.
It is as if the "status=`/home/mailman/bin/remove_members newtest $addr`"
part is not working.
I noticed a few typos in the script and fixed those like "rm -f /tmp/addr"
should be "rm -f /tmp/$addr" unfortunately it still does not work.
Any suggestions?
jamey
--
> From: "Sintz, James" <jsintz at opers.org>
> Date: Tue, 10 Apr 2001 09:10:40 -0400
> To: "'jamey at infr.com'" <jamey at infr.com>
> Subject: FW: [Mailman-Users] Another passwordless unsubscribe script
>
>
>
> -----Original Message-----
> From: Neil Cooler [mailto:ncooler at nandomedia.com]
> Sent: Monday, April 09, 2001 1:27 PM
> To: mailman-users at python.org
> Subject: [Mailman-Users] Another passwordless unsubscribe script
>
>
>
> I tested out bob's Auto-Unsubscribe script
> (http://nleaudio.com/bnotes/mailman.htm).
> I wasnt really too happy with the fact that it asked for the entire site
> password because when a user unsubscribes, an email gets sent to the
> site admin confirming that the action was completed. This email
> contains the site password. I could have set up a separate script for
> each list but that is too much work. The script I wrote calls the
> remove_member's program.
>
> Bob's script did not get the email address in the proper way in my
> opinion. I believe I got around this by getting the return-to address.
>
> The script below also contains simple logic to make sure that the email
> address was actually removed, and not simply attempted to be removed.
>
> I included the script below so feel free to use it however you like.
>
> I am using a beta of the evolution PIM so please be aware that this may
> not word-wrap correctly.
>
> --neil
>
>
>
> #!/bin/bash
> ###################################################################
> # Script for passwordless Mailman list unsubscription via email #
> ###################################################################
> #Neil Cooler <ncooler at nandomedia.com> #
> ###################################################################
> #Last revised: 04/09/01 #
> ###################################################################
> # Call from your /etc/aliases file like: #
> # <listname>-unsubscribe: /home/mailman/unsub <listname) <domain> #
> ###################################################################
>
> #gets $1 and $2 from the commandline input and adds those values to the
> listname and domain vars.
> listname=$1
> domain=$2
>
> #reads the second line of the email
> read a2 ;
>
> #Strips the email address from the second line and puts it in the
> variable 'addr'
> addr="`echo $a2 | awk '{print $2}'`" ;
>
> #Attempts to remove the user. IF it does not succeed, it sends a
> message to the user
> status=`/home/mailman/bin/remove_members newtest $addr`
> if [ -n "$status" ]
> then
> echo "From: $listname-admin@$domain" > /tmp/$addr
> echo "To: $addr" >> /tmp/$addr
> echo "Subject: $listname Unsubscription Confirmation" >> /tmp/$addr
> echo "" >> /tmp/$addr
> echo "There was an error in your attempt to unsusbscribe from the
> $listname mailinglist." >> /tmp/$addr
> echo "It appears that the address you tried to unsubscribe from, $addr
> is not subscribed." >> /tmp/$addr
> echo "Please contact $listname@$domain if you have any questions." >>
> /tmp/$addr
> /usr/lib/sendmail -f $listname-admin@$domain $addr < /tmp/$addr
> rm -f /tmp/addr
>
> #If the request works, it lets the user know he is unsubscribed.
> else
> echo "From: $listname-admin@$domain" > /tmp/$addr
> echo "To: $addr" >> /tmp/$addr
> echo "Subject: $listname Unsubscription Confirmation" >> /tmp/$addr
> echo "" >> /tmp/$addr
> echo "This message was generated to confirm your unsubscription from" >>
> /tmp/$addr
> echo "$listname@$domain. You should no longer recieve any messages
> from" >> /tmp/$addr
> echo "this list. If you change your mind, simply visit the list's" >>
> /tmp/$addr
> echo "Webpage at http://$domain/mailman/listinfo/$listname and subscribe
> again. If you have" >> /tmp/$addr
> echo "any further questions, please email the admin at
> $listname-admin@$domain. " >> /tmp/$addr
> echo "Thank You," >> /tmp/$addr
> echo "List Admin" >> /tmp/$addr
>
> /usr/lib/sendmail -f $listname-admin@$domain $addr < /tmp/$addr
> rm -f /tmp/$addr
> fi
>
>
> ------------------------------------------------------
> Mailman-Users maillist - Mailman-Users at python.org
> http://mail.python.org/mailman/listinfo/mailman-users
More information about the Mailman-Users
mailing list