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: <20000426102600.A11875@clifford.inch.com> <390756BA.B694B852@netscape.com> <20000426182720.B12655@clifford.inch.com>

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-----------
#!/usr/local/bin/perl
# 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 majordomo.cf 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/majordomo.cf";
if ($ARGV[0] eq "-C") {
    $cf = $ARGV[1];
    shift(@ARGV); 
    shift(@ARGV); 
}
if (! -r $cf) {
    die("$cf not readable; stopped");
}
require "$cf";

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

&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

EOM

close(MAIL);

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 listname-zubscribe@domain.com rather than, or
> > > in addition to, the listname-request@domain.com?
> > >
> > > Omar


References:
Indexed By Date Previous: Re: message footer not working
From: dominic soh <dominic@banana.netcentre.com.sg>
Next: Re: restricting post by domain(Year 2000)
From: Dan Liston <dliston@netscape.com>
Indexed By Thread Previous: Re: patches for listname-unzubscribe address?
From: Jeff Lasman <jblists@nobaloney.net>
Next: auto responder
From: John Stevenson <JSteven1@swst.com>

Google
 
Search Internet Search www.greatcircle.com