File: README

package info (click to toggle)
newsgate 1.6-22
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 340 kB
  • ctags: 313
  • sloc: ansic: 2,686; yacc: 504; sh: 278; lex: 183; perl: 151; makefile: 111
file content (164 lines) | stat: -rw-r--r-- 8,469 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
INTRODUCTION
------------
This kit provides two programs for "linking" RFC822 Mail messages and
RFC1036 Usenet News articles.  Each half of the conversion is handled by a
different program, mail2news or news2mail.  A few utility programs are
also included.

With these programs and the right set of mail aliases and news sys and
active file entries, it is possible to build any set of moderated,
unmoderated, one-way, or bi-directional gateways between any set of news
and mail groups and lists that your little heart desires.

If you run a small site with a couple of mostly-local mailing lists, you
probably don't want to bother setting this stuff up.  Instead, either
convert everything directly to News, or set up local moderated groups.  On
the other hand, if you provide gateway service to the Internet (e.g., UCB)
or large organization, then this stuff is for you.  News, especially with
the proliferation of NNTP (RFC977) and related clients, is generally more
efficient than mail for disk space, CPU cycles, and network usage.

The programs work with Sendmail or MMDF and News 2.11.8 or later.  I don't
know of anything off-hand that would prevent this from working with C news
(did Erik ever say thank you, Henry?).  It probably works on System V,
although you might want to add libcnews.a into the Makefile to get a
reasonable gethostname() routine if you don't already have one.

Erik Fair <fair@apple.com> wrote the original version of this package a
couple of years ago as "nrecnews" distributed with 2.11 and as "gateway", a
very tricky awk/shell/sed script.  I got copies, and recoded it all in C.
I also completely overhauled nrecnews, changed the names, added some
utility programs, and wrote the documentation.  It seems pretty solid now,
and is processing several hundred messages a week at BBN and elsewhere.

INSTALLATION
------------
Mail2news uses the date parser from the 2.11 netnews distribution; edit
the Makefile to point to where you keep your source.  If you want to use
the better C News date parsing routines, edit the Makefile as directed
therein.  Next, edit gate.h as appropriate for your system.  There are
some fairly detailed comments explaining the meaning of the #define's, but
good luck.  Unfortunately, this is one of those things that you have to
already know a fair bit about before you can use it.  As one way up the
learning curve, play with gag and test-gag -- the hardest part is almost
always getting the right aliases and news entries set up.

The "signoff" code is pulled out into a separate program and is also part
of mail2news.  This is so that a properly paranoid administrator can trap
the exit code, and forward rejected postings to a human to verify.  If
you trust the heuristics in that program, just turn on the -F flag.

It would be great if someone would send me a draft of an installation
document, including a description of how to set up various types of
lists.  Until that happens, the next couple of paragraphs (and the
comments in gate.h) will have to suffice.

News uses the Message-ID header to reject an incoming duplicate.  This
will also prevent it from sending the duplicate back out, obviously.  Be
careful if you feed mail that doesn't have Message-ID's into mail2news.
MMDF doesn't require one, for example.  Under these circumstances you have
to make sure that your sys file doesn't send the message back out the
gateway.  It will have a Message-ID so *you* don't see the loop, but
everyone else on the mailing list will, and they'll yell out you.  One way
to fix this is to have mail2news use the "-x" flag to put some fake site
in the header, then put /fakesite in the sys file entry that calls
news2mail.  Or, compile with FIXED_PATH or GATEWAY_NAME enabled and use
the /GATEWAY_NAME sub-field in your sys file so that the incoming article
doesn't get sent back out.  Another option is careful use of the L flag to
send only local articles back out.

The biggest problem with news2mail gatewaying is that you usually need
a separate entry for every group in your sys file.  One option is to create
a single sys file entry that matches all the groups you want to gateway,
like this:
    mail-gateway:...groups...::/usr/lib/news/mailgate %s
mailgate strips the newsgroup name out and looks it up in a file.  If
there is cross-posting you might have to be much more clever, but this
works for simple cases:
	#! /bin/sh
	# Turn /var/spool/news/foo/bar/123 into foo.bar
	NG=`echo $1 | sed -e s@/var/spool/news/@@ -e 's@/[0-9]*$@@' -e y@/@.@`
	# There is a space and a tab inside the []
	LINE=`grep "^${NG}" </usr/lib/news/gateways | sed -e "s/^${NG}[ 	]//"`
	# No quotes around $LINE -- we want multiple args
	eval /usr/bin/news2mail $LINE $1
The /usr/lib/news/gateways file looks like this:
	# news/mail gateway lines.
	#newsgroup	the other four params
	rec.music.cd	cd-lovers-list usenet cd-lovers-list-request host-name

Another way to do large gatewaying is to create a fake host and send all
mail for that host to a special mailer.  The mailer can then examine its
argument list, build a suitable argument list for mail2news and then exec
it.  At least in theory, this allows a mail message with several news
recipient addresses to be cross-posted to several newsgroups.  The mailer
uses a database to determine what distribution to use and whether to add
an Approved header.

It can be a good idea to put the mailing list address on the Organization
header.  If the mailing list is moderated, make the newsgroup moderated so
that postings get mailed back to the person preparing the digest.  You can
also merge related lists into a single newsgroup, use the "n" flag in the
active file, and force people to send mail using the address found in the
Organization header.

If you run C News, you want to pipe into relaynews rather than inews
for three reasons:
    1.  A mailing to a moderated newsgroup will be rejected, rather than
	mailed to the moderator, if no Approved header is present.
    2.  Mailings are possible to newsgroups with the "n" flag in the active
	file entry, while inews will reject them.
    3.  Henry and Geoff say that's what you should do.
Do this by using the -= flag so that mail2news won't add the -h flag.

If you run sendmail, another method is to define a class for all top-level
groups (this often changes much less frequently then the list of groups to
gateway), and define a "news" mailer to receive mail sent to such
addresses.  If the following class is defined:
    CNcomp misc news rec sci soc talk alt CNunix-pc ddn gnu u3b pubnet
then these lines can be added to the "mailer resolver" part of ruleset zero:
    R$=N.$*   $#news$:$1.$2   Posting to news
with the following mailer defined:
    Mnews,  P=/usr/bin/mail2news,
	    F=DFMls, M=131071, A=mail2news -n $u

(Thanks to Karl Kleinpaste and Neil Rickert for many of the good ideas
in this section.)

PROBLEM AREAS AND THINGS STILL TO BE DONE
-----------------------------------------
If you run mail2news as root the C News inews can leave temporary
files around named /tmp/inNNNNN{body,cens,hdr,in,ngs}.  This is a bug
in the C News cleanup actions.

Cross-posting and multiple mail recipients are not handled very well.
Cross-post means each mailing list gets a separate message.  Can this be
worked-around with B news's multi-cast?

Someone sending mail to lista and listb means the message only goes into
news.list.a, or news.list.b, depending on which gateway alias gets it
first, which isn't great.  One hack, to avoid losing messages, is to munge
the message-id to put the newsgroup name in there.

How do you bypass the "more included than new text" check in inews?

A news2mail option that specifies an Errors-To header.

A mail2news option that specifies where errors get mailed to.

A news2mail option that specifies a Sender header.

It would be nice to automatically generate (or update) References lines.
This could be done by parsing In-Reply-To lines (which aren't
standardized, but have a few formats).  Also, keep a database of Subject
lines and Message-ID's and use that to track down "Re:" messages.

If mail2news gets a message without a Message-ID, generate one.  Use a CRC
on the first ten lines of message body counting only alphanumeric
characters.  In news2mail recompute the Message-ID and send out a cancel
for it.  This would help break loops involving mailers that strip out
Message-ID headers.  (From Neil Rickert.)

Rich $alz
rsalz@osf.org
rsalz@uunet.uu.net