NewsDeliver is intended for people who need to closely monitor a newsgroup and want to get a notification whenever a new message is posted. NewsDeliver is a simple solution to a simple problem: put NewsDeliver in a cron job that runs every 10 minutes or so and it will email you a copy of any new messages that get posted on the newsgroup.
NewsDeliver isn't meant to be an earth-shaking program; it's just a simple Python script that I wrote so that I wouldn't miss any announcements from professors on my class newsgroups. Other college students will probably find it useful for the same purpose.
Why did I write NewsDeliver in Python? NewsDeliver is a very simple program that probably could have been coded in just about any language in five minutes. I happened to be teaching myself Python at the time and when my Internet searches for a program like NewsDeliver failed, I decided to use that as an excuse to actually write one in Python. I originally wrote NewsDeliver for my own personal use, but a couple of other people have expressed interest in it, so I have decided to release it under the GPL just in case anyone else would find it useful. If you find NewsDeliver useful or feel that I should add any features, please drop me an email and let me know.
Python (1.5 or 2.x) is required by NewsDeliver. NewsDeliver is intended for use on *nix systems. It has not been tested on Windows.
NewsDeliver is available from the SourceForge project page .
NewsDeliver installation is simple. Just copy the 'newsdeliver' script to a directory that is in the path of all users that need to use it (e.g. /usr/local/bin). Multiple users can all use NewsDeliver on the same system; configuration files and "last seen message" lists are kept in each user's home directory to prevent conflicts. If only a single user on a system needs to run NewsDeliver, he can keep the 'newsdeliver' script somewhere under his home directory instead of placing it in a global bin directory.
WARNING: **DO NOT** install NewsDeliver as setuid! The configuration files for NewsDeliver are interpreted directly by the Python interpreter, so NewsDeliver should always run with the privileges of the current user.
In order to start using NewsDeliver, run the command
This will create a new configuration file for you in ~/.newsdeliverrc. Some of the configuration values will be auto-detected for you, but you'll need to edit the file to set some of them (such as the NNTP server that your newsgroups are on).newsdeliver --newconf
Now that your configuration file is set up, you're ready to tell NewsDeliver what groups you're interested in monitoring. For each newsgroup you want to get email copies of, run the command
(Replace "my.newsgroup.name" with the name of the actual newsgroup.) NewsDeliver will assume that you've seen all of the messages already posted to that newsgroup and will start monitoring from this time forward.newsdeliver --addgrp my.newsgroup.name
Finally, you need to add a cron job for NewsDeliver so that it runs periodically. For example, if you wanted NewsDeliver to run every 20 minutes, you could run the following commands to add the necessary cronjob:
If you want NewsDeliver to run more often than every 20 minutes, add other minute numbers to the 0,20,40 list. Also be sure to change the /path/to/newsdeliver to point to the location where you actually installed the newsdeliver script.crontab -l > tempcrontab echo "0,20,40 * * * * /path/to/newsdeliver > /dev/null 2>&1" >> tempcrontab crontab tempcrontab rm tempcrontab
Rather than using the command line switches to alter the list of monitored newsgroups, it is safe (and easy) to modify the newsgroup database directly. The format is very similar to the INI file format. An example group file might look like the following:
<NewsDeliver 1.3> [news.group.name] lastseen=402 firstname.lastname@example.org [another.news.group] lastseen=100 filter=foobar subjprefix=[NEWS: %g]
The important thing to note here is that the first line of the file must start with the string "<NewsDeliver ". After that, information about each newsgroup is listed in a block -- the name of the group appears between brackets and attributes of the group are key/value pairs separated by "=". Every group must have a "lastseen" attribute, but all other attributes are optional. Possible keys that can be set are:
- An alternate email address that messages from this group should be mailed to. Overrides the EMAILTO setting from .newsdeliverrc. This attribute can be set from the command line with the --setaddr switch.
- Only messages whose subjects match the specified filter will be emailed. This attribute can be set from the command line with the --filter switch.
- A string that will be prepended to the subject line of all messages before they are sent; this overrides the global SUBJPREFIX value set in .newsdeliverrc. If the string "%g" is found inside the subject prefix, it will be expanded to the name of the newsgroup. This attribute can be set from the command line with the --subjprefix option.