[Mailman-Users] Re: No required password for WEB unsubscribe

Jon Carnes jonc at haht.com
Tue Jan 22 15:25:24 CET 2002


Fairly simple if you know how to write a CGI.  You can even create a very
simple CGI app that passes in the email address and executes the script.

I do this with my CGI for changing users Passwords across all our systems.
The script modifies local passwords, the NIS, and our PDC (via samba).
Whenever I need to make modifications, I just change the script and since
the Web-based app is simply a GUI for access to the script, the Web works
too.

BTW: that app is comes from Staf Wagemakers.  It is written in C and can be
found at:
   http://www.stafwag.f2s.com/cgipaf

If you ever wanted to learn how to write a CGI in C, then I recommend
downloading his project and playing with it.  The code is modular, well
documented, and easily adapted to other purposes.

Jon Carnes

As my friend Matt always says: if you can't think of three different ways of
doing it (in Linux) then you just aren't trying!

----- Original Message -----
From: "Daniel Abad" <dabad at cidadei.com.br>
To: <jonc at nc.rr.com>; <tdavis at birddog.com>; "Jon Carnes" <jonc at haht.com>
Cc: <mailman-users at python.org>
Sent: Tuesday, January 22, 2002 8:04 AM
Subject: Nno require password for WEB unsubscribe


> Hi all!
>
> I use this like a solution for unsubscribe without a password.. but, how
to
> do the same using my browser?
> I need to create a simple webpage that unsubscribe my user without use
pass.
> Is it possible??
>
> Tks all.
>
> Daniel
>
>
> -----Mensagem original-----
> De: Jon Carnes [mailto:jonc at nc.rr.com]
> Enviada em: quarta-feira, 16 de janeiro de 2002 05:28
> Para: tdavis at birddog.com; Jon Carnes
> Cc: mailman-users at python.org
> Assunto: Re: [Mailman-Users] no require password for unsubscribe?
>
>
> On Tuesday 15 January 2002 16:29, tdavis at birddog.com wrote:
> > I was pondering this idea.  Great idea it is too.
> > But is there a way to get the email address from the FROM headers rather
> > than have them explicity put it in the subject line ?
> >
> > I see a problem in the FROM headers where they can have a bunch of stuff
> > in there like name and whatever else like "Foo Bar <jo at hotmail.com>"
> >
> > Any thoughts here?
> >
>
> Easy, use:
>   UNSUB=`grep -i "From: " - |head -1 |tr "<>" "  " `
>
> The command tr is translate, and we're using it here to convert any < or >
> into a blank.  The rest of the script then handles it from there, looking
> for an isolated string that has a @ inside it.
>
> BTW: A friend of mine (Matt Hoover) came up with a more elegant
> solution for doing the unsubscribes...
>
>  - In the aliases file, add an entry for the unsubscribe email:
>      volleyball-unsub:  "|/home/mailman/ext/v-unsub"
>
>  - 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":
>
> #!/home/mailman/ext/bash_mailman
> # This script runs as user mailman, but is only executable by user mail
> # script to unsubscribe user from volleyball list
> #   Mail to volleyball-unsub at haht.com
> #   Subject: unsubscribe username at domain.com
> UNSUB=`grep -i "Subject: " - |head -1`
> for i in $UNSUB
>   do
>    /home/mailman/bin/remove_members volleyball $i
> done
> # End of script
>
>
>  - Make the script executable:
>      chmod a+x /home/mailman/ext/v-unsub
>
>  - In the /etc/smrsh directory:
>      ln -s /home/mailman/ext/v-unsub v-unsub
>
>  - Copy and modify bash so that it runs as user mailman:
>      cp /bin/bash /home/mailman/ext/bash_mailman
>      chown mailman.mailman /home/mailman/ext/bash_mailman
>      chmod 0555 /home/mailman/ext/bash_mailman
>      chmod u+s,g+s /home/mailman/ext/bash_mailman
>
> ===
>
> The directory /home/mailman/ext has rights such that only the mail user
can
> access the files within.  The copied version of "bash" now called
> "bash_mailman" has it's ownership changed to mailman and then has it's UID
> and GID bits set.  Any script that runs using it as a shell will now run
as
> the user mailman with group mailman.
>
> Wahoo!
>
> Jon Carnes
>
> ------------------------------------------------------
> Mailman-Users maillist  -  Mailman-Users at python.org
> http://mail.python.org/mailman/listinfo/mailman-users





More information about the Mailman-Users mailing list