File: news2mail.1

package info (click to toggle)
newsgate 1.6-10
  • links: PTS
  • area: non-free
  • in suites: slink
  • size: 332 kB
  • ctags: 310
  • sloc: ansic: 2,682; yacc: 499; sh: 278; lex: 183; perl: 151; makefile: 113
file content (158 lines) | stat: -rw-r--r-- 5,000 bytes parent folder | download | duplicates (2)
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
.\" $Header: /nfs/papaya/u2/rsalz/src/newsgate/RCS/news2mail.1,v 1.8 91/04/01 09:43:57 rsalz Exp Locker: rsalz $
.TH NEWS2MAIL 1 LOCAL
.SH NAME
news2mail \- feed a Usenet news article to mail
.SH SYNOPSIS
.B news2mail
[
.BI \-E var=value
] [
.B \-.
]
listname listaddr listadmin host [ article ]
.SH DESCRIPTION
.PP
.I News2mail
reads a news article edits the headers to make it look like an RFC822 mail
message.
It feeds the results to
.IR sendmail (8),
.IR MMDF (8),
or a shell script.
If the ``\-.'' flag is used, then the results are sent to standard output,
for debugging.
.PP
The article is taken from the file specified on the command line, or read
from standard input if not specified.
.PP
The ``\-E'' flag can be used to set environment variables for the delivery
program that is invoked.
They should be of the form ``name=value'' as in
\&``\-E mailer=/usr/lib/pp/cmds/submit''.
.PP
.I News2mail
swallows control messages,
removes all but the last three entries from the ``References'' header,
and merges the ``From'' and ``Path'' headers to build a single
``From'' header for the mail message (see below).
The ``Date,'' ``Subject,'' ``Reply\-To,'' ``Message\-ID,'' and ``Organization''
headers are passed through unchanged.
Any other headers in the original input are removed.
.PP
To ``To,'' and ``Sender'' headers and the SMTP destination envelope are set
according to the parameters specified on the command line.
The ``To'' header is set to be \fIlistname\fP, with \fI@host\fP appended if there
is no atsign in \fIlistname\fP.
This should contain the name of the mailing list.
The mail is actually sent to \fIlistaddr\fP by specifying it as the
recipient in the mailer command line.
(If \fIlistaddr\fP does not have an atsign, then \fIlistaddr@host\fP is used.)
By treating the ``To'' header and the destination envelope separately,
other members of the mailing list can properly reply to the messages that
pass through
.IR news2mail .
In addition, \fIlistaddr\fP can be an address that sends to everyone on
the list except the gateway.
This is an optimization, however, because
.IR inews (8)
will reject any Message-ID that it has already seen.
.PP
The ``Sender'' header is set to be \fIlistadmin\fP, with \fI@host\fP
appended if there is no atsign in \fIlistadmin\fP.
These values should correspond to the maintainer of the mailing list.
Some mailers will also automatically fill in the ``Return-Path'' header
with this value.
.PP
The goal of the header manipulations is to send the news article to all
recipient of the mailing list, but with the headers set so that delivery
errors are sent to the list maintainer for disposition.
.PP
.IR Mail2news
tries to shrink the ``Path'' header by taking note of neighboring
\s-2UUCP\s0 hosts and scanning for other Internet hosts that it can
short\-circuit to.
.IR Uuname (1)
is used to check for \s-2UUCP\s0 neighbors; the file
.I uucp\-2\-inet
is read to map \s-2UUCP\s0 names to Internet domain names.
For efficiency,
.I mail2news
stores
.IR uuname 's
output in a private file, and will only call
.I uuname
if the file is older than the \s-2UUCP\s0
.IR L.sys (5)
file.
.PP
In order to have
.I sendmail
believe that the headers it has created are valid,
.I news2mail
must be able to 
.IR setuid (2)
to one of
.IR sendmail 's
trusted users.
.SH EXAMPLE
.PP
Suppose the following article arrives
.IR comp.sources.unix\| :
.RS
.nf
Path: news.bbn.com!uunet!rsalz
From: rsalz@uunet.UU.NET (Rich Salz)
Newsgroups: comp.sources.unix
Subject: v10INF1:  Introduction to comp.sources.unix
Message\-ID: <830@uunet.UU.NET>
Date: 10 Aug 87 21:57:17 GMT
Expires: 10 Nov 87 22:17:17 GMT
Organization: UUNET Communications Services, Arlington, VA
Lines: 189
Approved: rsalz@uunet.UU.NET

This is the first of two introductory articles about comp.sources.unix.
\&...
.fi
.RE
Also, assume the following line is in your news sys file (see
.IR news (5)):
.RS
.nf
gateway:world,comp.sources.unix::\e
.ti +.5i
news2mail unix\-sources rsalz unix\-sources\-request bbn.com
.fi
.RE
The
.I news2mail
program would generate the following article and feed it to
.IR sendmail :
.RS
.nf
Received: from USENET by bbn.com with netnews
	for rsalz@bbn.com (unix\-sources@bbn.com);
	contact usenet@bbn.com if you have questions.
To: unix\-sources@bbn.com
Date: 10 Aug 87 21:57:17 GMT
From: rsalz@uunet.uu.net (Rich Salz)
Sender: unix\-sources\-request@bbn.com
Subject: v10INF1:  Introduction to comp.sources.unix
Message\-ID: <830@uunet.UU.NET>
Organization: UUNET Communications Services, Arlington, VA

This is the first of two introductory articles about comp.sources.unix.
\&...
.fi
.RE
.SH DIAGNOSTICS
Most return values from I/O routines are checked; if anything goes
wrong, a diagnostic message is sent to standard error.
.SH "SEE ALSO"
gag(1L), mail2news(1L).
.SH AUTHOR
Rich $alz <rsalz@bbn.com>, after a set of scripts and a excellent manpage by
.br
Erik E. Fair <fair@apple.com>.
.br
Piete Brooks <pb@computer-lab.cambridge.ac.uk> helped write the option-handling.