home *** CD-ROM | disk | FTP | other *** search
- GATE
- ----
- Verion 1.0
-
- Clay Luther, 1990
-
- Synopsis: Transfer mail to a news group, and news from that news group back
- to mail. In effect, become a news/mail gateway.
-
- [ It's a hack, yes, but it's a nice hack. ]
-
- Gate is made up of 2 scripts, and a very slightly hacked version of the C News
- inews.
-
- gatemail: Transfer a mail article (taken from stdin) to a news group via inews.
-
- gatenews: Transfer an article from news to a mailing list.
-
- inews.new: An inews hack that allows the specification of no signature
- inclusion (-z).
-
-
- Assumptions
- -----------
-
- These programs were written with the assumption you are running C News and
- a mailing program that allows mail to be piped to a program via an alias (aka
- sendmail or smail via the aliases file). The C News dependency is only
- reflected in the use of inews.new, which is simply the C News inews script
- with about 4 lines of code added to suppress the inclusion of the executor's
- .signature file.
-
-
- SETUP
- -----
-
- [ The directories and file names given are what gatenews and gatemail expect.
- You may easily edit both scripts to change these values. ]
-
- [ Below, I will assume that mail is coming from some mailing list called
- goof-l@foo.com. ]
-
- Copy gatemail, gatenews, and inews.new to /usr/lib/news. Make sure they are
- +rw to everyone.
-
- Next, create some mailing aliases. You should have an incoming mail alias and
- an outgoing mail alias. They should be set up as:
-
- #incoming alias
- goof:"|/usr/lib/news/gatemail goof-l alt.goof"
- #outgoing alias
- goof-l:goof-l@foo.com
-
- Create a sys entry for the gateway in /usr/lib/news/sys:
-
- goof-l:alt.goof/all:F:/usr/spool/news/gatenews/goof-l
-
- [ gatenews looks in /usr/spool/news/gatenews by default ]
- Next, create a cron entry for gatenews (run by news, preferably):
-
- #run gatenews after sendbatches
- 50 * * * * /usr/lib/news/gatenews goof-l goof-l goof
-
- Subscribe to goof-l@foo.com as goof@your.site.
-
- Finally:
-
- addgroup alt.goof y
-
- Your set.
-
- What's Going On Here?
- ---------------------
-
- Mail from the mailing list arrives at your site and is handed to the gatemail
- program via stdin.
-
- gatemail goof-l alt.goof < mail
-
- The goof-l parameter states the real name of the mailing list. The second
- parameter states what group to post this article to.
-
- Gatemail strips the mail headers off the mail after first grepping out the
- subject, from, and reply-to lines. It then adds a range of news headers:
-
- Newsgroups: [set to alt.goof (aka parameter $2)]
- From: [set to the From: line of the message]
- Subject: [set to the Subject: of the message]
- Reply-To: [set to the From: line of the message]
- Organization: [set to the string "Gated to News by your.site"]
- Path: [set to goof-l (aka the group name aka your alias for the mailing list)]
- Sender: [set to the Reply-To: line of the message]
- Lines: [set to the number of lines in the message]
-
- The Path and Organization headers are especially important. Gatenews (the
- other script) checks the Organization header to determine if the news article
- was gated to news from mail (and therefore should not be sent the other way).
- The Path gives a valid path back through your machine to the mailing list by
- way of your alias for the mailing list.
-
- One last thing, gatenews installs a faux header "X-Gateway:" in articles
- gated to mail. If gatemail detects this X-Gateway: header (and it is from
- this host), then the mail is appropriately ignored.
-
- Here is a sample of how gatemail would work:
-
- A Message comes in from goof-l:
-
- From utacfd.utarl.edu!mdaeng!goof-l@supernet.haus.com Wed Dec 19 13:52:06 1990
- Return-Path: <utacfd.utarl.edu!mdaeng!goof-l@supernet.haus.com>
- Received: from supernet.haus.com by enigma.haus.com (4.1/SMI-4.1)
- id AA00646; Wed, 19 Dec 90 13:52:05 CST
- Received: by supernet.haus.com (/\=-/\ Smail3.1.18.1 #18.16)
- id <m0im9kD-0009NeC@supernet.haus.com>; Wed, 19 Dec 90 13:46 CST
- Received: from mdaeng.UUCP by utacfd.utarl.edu with UUCP (4.0/25-eef)
- id AA14147; Wed, 19 Dec 90 13:26:02 CST
- Received: by mdaeng.mdaeng.com (4.0/25-eef)
- id AA10913; Wed, 19 Dec 90 12:48:50 CST
- Date: Wed, 19 Dec 90 12:48:50 CST
- From: mdaeng!rwn@utacfd.utarl.edu (Ralph Noack)
- Reply-To: mdaeng!goof-l@utacfd.utarl.edu (Goofball Mailing List)
- Message-Id: <9012191848.AA10913@mdaeng.mdaeng.com>
- To: goof@enigma.haus.com
- Subject: Just Testing
-
- This is just a friendly sample thingy.
-
- This gets intercepted by the goof alias and piped to:
-
- gatemail goof-l alt.goof
-
- which produces the article:
-
- Newsgroup: alt.goof
- From: mdaeng!rwn@utacfd.utarl.edu (Ralph Noack)
- Subject: Just Testing
- Reply-To: mdaeng!rwn@utacfd.utarl.edu (Ralph Noack)
- Organization: Gated to News by enigma.haus.com
- Path: goof-l
- Sender: mdaeng!goof-l@utacfd.utarl.edu (Goofball Mailing List)
- Lines: 2
-
- This is just a friendly sample thingy.
-
- This gets piped to inews -z -h. The -z option supresses the .signature
- inclusion. Inews will post the article to alt.goof.
-
-
- On the other side, gatenews is pulling stuff off news and sending it to the
- mailing list.
-
- Every hour (or whenever), sendbatches executes and creates the file
-
- /usr/spool/news/gatenews/goof-l
-
- which contains a list of file names of articles in alt.goof that need to be
- mailed (or might need to be mailed).
-
- After sendbatches is run, gatenews is run
-
- gatenews goof-l goof-l goof
-
- where the first parameter is the address/alias to mail the articles to, the
- second parameter is the name of the spool file in /usr/spool/news/gatenews,
- and goof is the local alias of the mailing list (need to set the From: line of
- the article viz mail).
-
- Gatenews processes the articles in the spool file one by one. First, it checks
- the message id's of the article against a log file; if the message id is in the
- log file, then the article is not mailed. Next, the Organization: line is
- checked. If it is equal to "Gated to News by <this.site>", then the article
- is not mailed.
-
- If the article gets past those tests, then it is assumed to be OK for mailing.
- The From: and Subject: lines are grepped out of the article and the rest of the
- headers are trashed. The mailer program is then called, setting the appropriate
- fields and piping the rest of the article to it.
-
- In the original gatenews, fastmail is used. Fastmail is part of the Elm
- package. Sendmail could be used instead, but you will have to hack the line
- that performs the mailing in gatenews.
-
- Gatenews logs the message in its log file and cleans up.
-
-
- Other Files
- -----------
-
- /usr/lib/news/gatemail.log
- /usr/lib/news/gatenews.log
-
-
- If you have any questions or ESPECIALLY enhancements or suggestions, please
- mail me at
-
-
- cluther@supernet.haus.com
- uunet!supernet!cluther
-
- Clay Luther
-
-