Great Circle Associates Majordomo-Users
(April 2000)

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: patches for listname-(un)zubscribe address?
From: Dan Liston <dliston @ netscape . com>
Organization: iPlanet E-Commerce Solutions, A Sun Netscape Alliance
Date: Fri, 28 Apr 2000 00:36:28 -0500
To: majordomo-users @ greatcircle . com
Cc: Omar Thameen <omar @ clifford . inch . com>, Jeff Lasman <jblists @ nobaloney . net>, majordomo-workers @ greatcircle . com
References: <> <> <>

Your list must have an open or auto (un)zubscribe_policy if you do not want
the user to be burdened with a confirmation message.  It will work with
open+confirm, but that kind of defeats the purpose, doesn't it.

This is how I set up the alias;

listname-(un)zubscribe: "|/majordomo/wrapper (un)zubscribe listname"

By copying zubscribe to unzubscribe and replacing all occurances of
zubscribe in the file with unzubscribe, you get the second tool.

I suppose I could have got fancy and used the same tool for both
zubscribe and unzubscribe depending on which way it was called, like
the bounce tool does, or even grabbed the $sender variable from the
listname.config file, but this is the down and dirty and IT WORKS! :)

You will need to edit the location of perl, and if you have a
preference, choose a $sender to match your taste as well.

Please consider this a skeleton with lots of room for flesh.

Dan Liston

--------BEGIN FILE-----------
# The above needs to be edited to match your system

# $Revision: 0.01 $
# $Date: 2000/04/27 22:44:33 $
# $Author: dliston $
# Shamelessly stolen from request-answer

# PATH is set in the wrapper, so there is no need to set it here.
# Any variables defined in will not be defined here.

# Example aliases file entry:
# $list-subscribe:  "|/path/to/majordomo/wrapper subscribe $list"

# Uncomment the $sender variable of your liking.  Just be sure you
# have an entry in aliases that matches the $sender that you choose.
# The default $sender, owner-$list fits sendmail systems perfectly.

# Read and execute the .cf file
$cf = $ENV{"MAJORDOMO_CF"} || "/etc/";
if ($ARGV[0] eq "-C") {
    $cf = $ARGV[1];
if (! -r $cf) {
    die("$cf not readable; stopped");
require "$cf";

chdir($homedir) || die("Can't chdir(\"$homedir\"): $!");
unshift(@INC, $homedir);
require "";
require "";

&ParseMailHeader(STDIN, *hdrs);
$reply_to = &RetMailAddr(*hdrs);
$reply_to = join(", ", &ParseAddrs($reply_to));

die("subscribe: $reply_to is not a valid return address.\n") 
    if (! &valid_addr($reply_to));

# robots should not reply to other robots...
if ($reply_to =~ m/$majordomo_dont_reply/i) {
    &abort( "$whoami: not replying to $1 to avoid mail loop.\n");

$in_reply_to = $hdrs{"message-id"} . ", from " . $hdrs{"from"};
$list = $ARGV[0];

$sender = "owner-$list\@$whereami";
#$sender = "$list-owner\@$whereami";
#$sender = "$list-request\@$whereami";
#$sender = "$list-approval\@$whereami";

$mailcmd = eval qq/"$bounce_mailer"/;

if (defined($isParent = open(MAIL, "|-"))) {
    &do_exec_sendmail(split(' ',$mailcmd))
        unless $isParent;
} else {
    &abort("Failed to fork prior to mailer exec");

print MAIL <<"EOM";
To: $whoami
From: $reply_to
Subject: mail to $list-subscribe\@$whereami
In-Reply-To: $in_reply_to

subscribe $list $reply_to



exit 0;
---------------END FILE-----------------

Final note:
I have tested both the subscribe and unsubscribe versions of this file
on my system successfully.

Omar Thameen wrote:
> The majordomo program will still require that you put the request in the
> body of the message.  I was hoping to find a way such that any email to
> listname-zubscribe would add them to the list.
> Omar
> On Wed, Apr 26, 2000 at 03:51:06PM -0500, Dan Liston wrote:
> > No patch needed.  Just create an alias like;
> > listname-zubscribe: "|/whatever/majordomo/wrapper majordomo -l listname"
> >
> > Dan Liston
> >
> > Omar Thameen wrote:
> > >
> > > Are there any patches to Mj1 which allow users to zubscribe by
> > > sending email to rather than, or
> > > in addition to, the
> > >
> > > Omar

Indexed By Date Previous: Re: message footer not working
From: dominic soh <>
Next: Re: restricting post by domain(Year 2000)
From: Dan Liston <>
Indexed By Thread Previous: Re: patches for listname-unzubscribe address?
From: Jeff Lasman <>
Next: auto responder
From: John Stevenson <>

Search Internet Search