1 | #! /bin/sh
|
---|
2 | #
|
---|
3 | # This is stolen from C News
|
---|
4 | #
|
---|
5 |
|
---|
6 |
|
---|
7 | #
|
---|
8 | # All this does is massage the headers so they look like what news
|
---|
9 | # software expects. To:, Cc: and Resent-*: headers are masked.
|
---|
10 | # Reply-To: is turned into references, which is questionable (could
|
---|
11 | # just as well be dropped.
|
---|
12 | #
|
---|
13 | # The From: line is rewritten to use the "address (comments)" form
|
---|
14 | # instead of "phrase <route>" form our mailer uses. Also, addresses
|
---|
15 | # with no "@domainname" are assumed to originate locally, and so are
|
---|
16 | # given a domain.
|
---|
17 | #
|
---|
18 | # The Sender: field below reflects the address of the person who
|
---|
19 | # maintains our mailing lists. The Approved: field is in a special
|
---|
20 | # form, so that we can do bidirectional gatewaying. Any message
|
---|
21 | # in a newsgroup that bears this stamp will not be fed into the
|
---|
22 | # matching mailing list.
|
---|
23 |
|
---|
24 | sed=${1-sed}
|
---|
25 |
|
---|
26 | $sed -n -e "1{i\\
|
---|
27 | Path: mailnewsgateway
|
---|
28 | }" \
|
---|
29 | -e ":a
|
---|
30 | /^[Rr]eceived:/b r
|
---|
31 | /^[Nn]ewsgroups:/b r
|
---|
32 | /^[Pp]ath:/b r
|
---|
33 | /^[Tt][Oo]:/s/^/Original-/
|
---|
34 | /^[Cc][Cc]:/s/^/Original-/
|
---|
35 | /^[Rr][Ee][Ss][Ee][Nn][Tt]-.*/s/^/Original-/
|
---|
36 | /^[Mm][Ee][Ss][Ss][Aa][Gg][Ee]-[Ii][Dd]:/s/@/.alt.buddha.fat.short.guy@/
|
---|
37 | s/^[Ii]n-[Rr]eply-[Tt]o:/References:/
|
---|
38 | /^From:/{
|
---|
39 | s/<\([^@]*\)>\$/<\1@$thissite>/
|
---|
40 | s/^From:[ ][ ]*\(.*\) *<\(.*\)>\$/From: \2 (\1)/
|
---|
41 | }
|
---|
42 | s/-[Ii]d:/-ID:/
|
---|
43 | s/^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]:[ ]*$/Subject: (none)/
|
---|
44 | s/^\([^:]*:\)[ ]*/\1 /
|
---|
45 | /^\$/{i\\
|
---|
46 | Newsgroups: alt.buddha.short.fat.guy\\
|
---|
47 | Distribution: world\\
|
---|
48 | Sender: news@cygnus.com\\
|
---|
49 | Approved: alt.buddha.short.fat.guy@cygnus.com
|
---|
50 | b e
|
---|
51 | }
|
---|
52 | p
|
---|
53 | n
|
---|
54 | b a
|
---|
55 | :r
|
---|
56 | s/.*//g
|
---|
57 | n
|
---|
58 | /^[ ]/b r
|
---|
59 | b a
|
---|
60 | :e
|
---|
61 | p
|
---|
62 | n
|
---|
63 | b e"
|
---|