Great Circle Associates Majordomo-Users
(August 2004)
 

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

Subject: Re: How do I set up a separate zubscription address for each list?
From: Daniel Liston <dliston @ sonny . org>
Date: Sat, 28 Aug 2004 21:01:18 -0500
To: Gino Lucrezi <gino-majordomo-users @ lucrezi . net>
Cc: majordomo-users @ greatcircle . com
In-reply-to: <1ugfbtmrasaiqdj.210820040017@hostingtrader.com>
References: <1ugfbtmrasaiqdj.210820040017@hostingtrader.com>
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)



Gino Lucrezi wrote:

> I need a separate zubscription address for each list I manage.

This is the default method of operation.  (list-request@your.domain)
> 
> Some email address like list-zubscribe@mydomain where a user can write without needing to type anything in the body of his email.

OK, now you need a script I wrote several years ago.
> 
> I know I can setup list-request@mydomain, and a user will only need to type "zubscribe" in the body, but I need something even simpler.
> 
> I'm sure there must be some way to implement it, be it with some alias magic or some nifty little script.

Actually it takes both.  This is also documented in my script.

It's been so long, I couldn't even remember what I called it. :(

Dan Liston

PS.  I FOUND IT!!!!  It is called "subscribe".  Read the comments
for the documentation. :)

#!/usr/bin/perl
# The above needs to be edited to match your system.

# $Revision: 1.1 $
# $Date: 2000/10/02 17:16:44 $
# $Author: majordomo $
# Shamelessly borrowed/stolen from request-answer

# PATH is set in the wrapper, so there is no need to set it here.

# syntax:  wrapper subscribe [-u] listname
# where wrapper = fully qualified /path/to/majordomo/wrapper,
# subscribe = the name you saved this file as,
# [-u] = an optional "unsubscribe" modifier,
# and listname = the unqualified name of your mailing list.

# Any variables defined in majordomo.cf will not be defined here.

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

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

# NOTE: your mailing $list should be configured with an open or auto
# subscribe and unsubscribe policy for maximum script efficiency.

# 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));

$zub_command = "subscribe";
$list = $ARGV[0];
if ($list eq "-u") {
     $zub_command = "unsubscribe";
     $list = $ARGV[1];
}

die("$zub_command: $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"};

#$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-$zub_command\@$whereami
In-Reply-To: $in_reply_to

$zub_command $list $reply_to

EOM

close(MAIL);

exit 0;




References:
Indexed By Date Previous: Sendmail & smtp & results
From: "EuroHosting | www.eurohosting.name" <info@eurohosting.name>
Next: Re: sending to mailing list giving Group writable directory
From: Daniel Liston <dliston@sonny.org>
Indexed By Thread Previous: How do I set up a separate zubscription address for each list?
From: Gino Lucrezi <gino-majordomo-users@lucrezi.net>
Next: sending to mailing list giving Group writable directory
From: "jawed" <jawed@ssuet.edu.pk>

Google
 
Search Internet Search www.greatcircle.com