CCL Home Page
Up Directory CCL 0519.html
Majordomo Archive: Re: majordomo list <--> newsgroup

Re: majordomo list <--> newsgroup

Elizabeth Lear (eliz@world.std.com)
Mon, 07 Aug 1995 12:51:47 -0400

>From: "Franklin R. Jones" <frjones@sa.mnet.uswest.com>
>newsgroup?
>
> e.g. anything posted to the list appears in the news group and
>anything posted to the newsgroup is reflected to the majordomo list
>without dup'ing back to the newsgroup.

Here's what I do for this. This is a repeat of my posting here on 1
June 95.

...eliz

To explain how this is set up, I'll use my gateway of
rec.arts.theatre.musicals as an example. I offer a straight bounce
list and a digest version of the newsgroup to email subscribers. All
messages to the newsgroup are automatically sent to the mailing list.
In order to keep things from looping, submissions to the list aren't
sent to the list, they are posted to the newsgroup and then find their
way to the list.

The /etc/aliases entry:

#
musicals: "|/usr/local/lib/majordomo/wrapper resend -l musicals -h world.std.com musicals-outgoing"
musicals-outgoing: :include: /usr/local/lib/majordomo/Lists/musicals, "|/usr/local/lib/majordomo/wrapper digest -r -C -l musicals-digest musicals-digest-outgoing"
owner-musicals: eliz
musicals-request: "|/usr/local/lib/majordomo/wrapper majordomo -l musicals"
musicals-approval: eliz
#
musicals-digest: musicals-post
musicals-digest-outgoing: :include:/usr/local/lib/majordomo/Lists/musicals-digest musicals-digest-request: "|/usr/local/lib/majordomo/wrapper majordomo -l musicals-digest"
musicals-digest-approval: eliz
owner-musicals-digest: eliz
owner-musicals-digest-request: eliz
#
musicals-post:
"|/usr/local/lib/news/mail2news rec.arts.theatre.musicals world"
#

The /usr/lib/news/sys entry:

musicals:rec.arts.theatre.musicals/all,!local,!wstd::/bin/mail musicals@world.std.com

The config file sets the list to use 'musicals-post@world.std.com' as
the Reply-To address so replies go to the newsgroup.

The program "news2mail":

#!/usr/local/bin/perl

# Gateway a local news group back to a mailing list
# Written by Spike (spike@world.std.com)
# add "local.group.name local-mail-alias" to /usr/lib/news/moderators
# add then add something like to /etc/aliases:
# local-mail-alias:
# "|/usr/local/lib/news/news2mail list-address@somehost"

$list = shift;

if ($list eq "-") {
open(MAIL,"|/bin/cat -u");
} else {
open(MAIL,"|/usr/lib/sendmail $list");
}

while (<>) {

next if (/^From /);
last unless (/^[^ \t]*:/ || (/^[ \t]/ && $. > 1));
if (/^Newsgroups: /i || /^Distribution: /i || /Apparently-To: /i
|| /^Received: /i) {
$killed_last = 1;
next;
}
next if (/^\s+/ && $killed_last);
$killed_last = 0;
print MAIL $_;
}

print MAIL "To: $list\n";

print MAIL "\n" if /\S+$/;

print MAIL $_;

while (<>) { print MAIL $_ ; }

[end]

I also have another setup that gateways a primary mailing list to a
newsgroup for easier reading. The newsgroup is marked as moderated,
and the moderator's address is given as the post-to-the-list address
for the mailing list. This makes it work in reverse of the musicals
list above - the musicals list gets its postings from the group, and
messages from the members are sent to the newsgroup and then back to
the list. The reverse gets all the newsgroup postings from the
mailing list only, and any postings to the newsgroup are sent to the
list and posted from there to the newsgroup as if the moderator had
approved them. In order to do this, the newsgroup posting address
(foobarlist-dist@world.std.com) must be subscribed to the mailing
list.

The /etc/aliases entry (wstd is my local newsgroup hierarchy):

foobarlist-dist: wstd-mail-foobarlist
wstd-mail-foobarlist:
"|/usr/local/lib/news/mail2news wstd.mail.foobarlist wstd"
post-wstd-mail-foobarlist:
"|/usr/local/lib/news/news2mail foobarlist"
foobarlist: foobarlist@real.address.here
foobarlist-request: foobarlist-request@real.address.here

The active file entry:

wstd.mail.foobarlist 0000003259 02963 m

And the program "mail2news":

#!/usr/local/bin/perl

# Gateway a mailing list to a local news group.
# Written by Spike (spike@world.std.com)
# invoked for /etc/aliases with a alias like
# mailing-list-rdist:
# "|/usr/local/lib/news/mail2news local.news.group.name distribution"

$group = shift;
$dist = shift;
if ($group eq "-") {
open(INEWS,"|/bin/cat -u");
} else {
open(INEWS,"|/bin/inews -h");
}

while (<>) {

next if (/^From /);
last unless (/^[^ \t]*:/ || (/^[ \t]/ && $. > 1));
if (/^To: /i || /^Cc: /i || /^Received: /i || /Apparently-To: /i
|| /^Return-Path: /) {
$killed_last = 1;
next;
}
next if (/^\s+/ && $killed_last);
$killed_last = 0;
print INEWS $_;
}

print INEWS "Newsgroups: $group\n";
print INEWS "Distribution: $dist\n";
print INEWS "Approved: usenet@world.std.com\n";

print INEWS "\n" if /\S+$/;

print INEWS $_;

while (<>) { print INEWS $_ ; }

[end]

Modified: Wed Dec 23 18:09:00 1998 GMT
Page accessed 9761 times since Sat Apr 17 21:24:49 1999 GMT