DESCRIPTIONuqwk is a program which collects all a user's unread news and/or mail, and formats it into a packet for offline reading, saving telephone and connect charges. Simple Offline Usenet Packet (SOUP), ZipNews, and the deprecated QWK packet formats are supported. Mail can be read from classic Unix mbox format mail files, MMDF mail files, or maildir mailboxes. News is either read directly from a locally available file system, or obtained using NNTP.
uqwk also accepts reply packets, so replies can be mailed or posted, depending whether the message is marked private (email) or public (news).
uqwk also supports a small offline command language, so the contents of the user's .newsrc file can be viewed and manipulated offline.
GENERAL OPTIONSNote that many varieties of uqwk can be built: not all options are applicable to (and available) in every one. Specifically, the NNTP-related options are only available in uqwk builds using NNTP, the options related to reading news directly from disk only to non-NNTP builds. Furthermore, the options concerning scoring and NNTP authentication are only present if support for scoring, resp. NNTP authentication, was compiled in.
- Print options. uqwk will show its version number and the options that were compiled in, will examine all appropriate environment variables and command line options, print the values of all run-time options, then exit. This is useful to see what uqwk thinks it is going to do before you actually run it (and what setup it is offering).
- identical to "-p".
- same as "-v".
- Read only. Normally, uqwk will empty the user's mail spool file and update the user's .newsrc file to reflect the fact that mail and news have been read. If this switch is specified, uqwk will not touch these files. This is useful for testing.
- Do not execute in read-only mode. This is the default.
- Do mail. uqwk will process all mail in the user's mail spool file and convert it into an offline packet.
- Don't do mail. This is the default.
- Do news. Using the user's .newsrc file and the news system's active file, uqwk will collect all unread news articles in all subscribed newsgroups into the packet. This can generate a large number of messages and large packet files.
- Don't do news. This is the default.
- Operate in SOUP (also known as HDPF or SLNP) mode. The files comprising a Simple Offline Usenet Packet (SOUP), specifically, AREAS and *.MSG, will be created instead of a QWK packet. The reply file, if any, will be interpreted as an SOUP "replies" file instead of a QWK reply packet. This is the default.
- Do not operate in SOUP mode. If (and only if) neither SOUP nor ZipNews mode is selected, uqwk will operate in QWK mode.
- Operate in ZipNews mode. The files comprising a ZipNews news packet, specifically, "user.JN", "user.NWS", and "user.IDX", will be created instead of a QWK packet.
- Do not operate in ZipNews mode. If (and only if) neither SOUP nor ZipNews mode is selected, uqwk will operate in QWK mode. This is the default.
- Specifies the program used when posting messages (usually /usr/lib/news/inews). uqwk adds a `-h' flag when calling it, except in plain (non-expert) QWK mode.
The value of n determines whether articles are validated before
posting, whether this checking is verbose, and whether the result
is respected or ignored:
+V Equivalent to `+V3' (default)
+V0 No article validation
+V1 Verbose article validation, ignoring the outcome
+V2 Silent article validation, failing articles are
+V3 Verbose article validation, articles containing
fatal errors are not posted
Whenever checking is performed, bad articles are appended to the file `dead.articles' in the uqwk home directory. This option is only available when uqwk was compiled with the `GNKSA' option, in which case the default value is `3'.
- Equivalent to `+V0', as defined above.
- Honor Xref header lines in news articles. When this switch is in effect, uqwk will only pack a crossposted article in the first newsgroup in which it is encountered. This can reduce the size of the packet but may introduce unexpected behaviour on the part of the offline reader. This is the default.
- Do not honor Xref lines.
- Ignore error on nonexisting news messages; proceed instead of aborting. This is the default.
- Signal an error and abort on missing news messages.
- Look in the directory fImailspool for the mailbox file (or maildir mailbox). The default is /var/spool/mail.
- Look for mail in the file mailfile. The default is a file (or maildir mailbox) with the same name as the user's login name in fImailspool; however, the MAIL environment variable is used when set. This switch overrides the -M switch.
- Use activefile for the list of all available newsgroups and article numbers. The default is /usr/local/news/lib/active. This option is not available if uqwk obtains articles from a news server using NNTP.
- Look for news articles in the directory newsdir. The default is /var/spool/news. This option is not available if uqwk obtains articles from a news server using NNTP.
- Use newsrcfile for the list of all newsgroups to which the user is subscribed and the list of article numbers which have been read. The default is $HOME/.newsrc.
- By default uqwk uses the getpwuid() system call to determine the proper user name to use. This switch overrides the results of that call.
- By default, uqwk uses the getpwuid() system call to determine the user's home directory. The home directory is where the files comprising the offline packet will be created. It is also where uqwk looks for the .newsrc file. This switch may be used to override the results of the getpwuid() call.
- Stop processing news articles if the size of the offline packet exceeds maxblocks 128-byte blocks. This is useful since large amounts of unread news can create large packets. Use a maxblocks value of zero to suppress this check. The default is 4096 blocks (half a megabyte).
- Process newsgroups in the order specified in ngfile. ngfile is expected to contain one newsgroup name per line.
- Operate in "summary" mode. Instead of packing articles, uqwk creates a summary file, sumfile, which consists of the newsgroup name, article number, and subject line of each unread article. All summarized articles are marked as read.
- Operate in "selection" mode. Instead of using the .newsrc file to determine which articles to pack, uqwk reads selfile, a file in the same format as the summary file. (The actual subjects are optional in selfile.) The idea is that a summary may be created by using -U, downloaded, edited or processed by additional software to select desired articles, uploaded, and fed to the -E switch for offline article selection.
- Process replyfile as a reply packet. Messages and articles created by the offline reader must be uploaded as a reply packet and then processed by this switch to be mailed or posted. If operating in SOUP mode, this file should be the REPLIES file. uqwk will remove replyfile when it has been processed unless it is running in read-only mode. If operating in ZipNews mode, this switch should specify the directory in which the ZipNews reply files reside. No default reply file is set.
- Use the specified hostname when processing ZipNews reply packets. This should be the fully-qualified domain name of the Unix host. The default is "nowhere".
QWK MODE OPTIONS
- Include headers. Since the QWK specification places limits on the sizes of certain header fields such as To:, From:, and Subject:, uqwk can include all message and article headers in the body of the message so all fields are visible. This is the default. (This switch only applies to the QWK packet format.)
- Do not include headers in messages. (QWK only.)
- Truncate the names of newsgroups to len characters. Some offline readers cannot handle long newsgroup names. Newsgroup names are truncated after having been translated. The default is 15 characters. Specify a value of zero for unlimited newsgroup name lengths. (QWK only.)
- Include an entry for every subscribed newsgroup in the CONTROL.DAT file. (QWK only).
- Do not include an entry in CONTROL.DAT for empty newsgroups. This is the default. (QWK only.)
- Activate the Blue Wave kludge. The Blue Wave QWK reader does not like the personal.ndx file that uqwk creates by default. If this switch is specified uqwk will create a regular ???.ndx file that Blue Wave likes. (QWK only.)
- Do not activate the Blue Wave kludge. This is the default.
- Operate in expert QWK mode. The QWK header is ignored and all header lines are taken from the body of the message. In the hands of an expert, this permits the creation of RFC822 compliant mail messages and RFC1036 compliant news articles using QWK readers, which is difficult or impossible otherwise in many cases. This is intended for people who really know what they're doing. (QWK only.)
- Do not operate in expert QWK mode. This is the default.
- Translate newsgroup names as specified in tablefile. Each line in tablefile is expected to have two fields separated by white space: The old name of the newsgroup and the name to which it will be translated. (QWK only.)
- Specify the BBS Name to be entered into the QWK packet. The default is "unknown BBS". (QWK only.)
- Specify the BBS City to be entered into the QWK packet. The default is "Anytown, USA". (QWK only.)
- Specify the BBS Phone Number to be entered into the QWK packet. The default is "555-1212". (QWK only.)
- Specify the BBS Sysop Name to be entered into the QWK packet. The default is "Joe Sysop". (QWK only.)
- Specify the BBS ID to be entered into the QWK packet. The BBS ID is important since it will be checked against the BBS ID string in any incoming reply packets. If the two do not match, the reply packet will not be processed. The BBS ID consists of an integer, a comma, and a string of less than nine characters, with no spaces. The default is "0,SOMEBBS". (QWK only.)
- Perform kill/score processing. The global score file will be read (if it exists), as well as the score file for the current group, and each article will becored'. See the "USING SCORE FILES" section below. This is the default.
- Do not perform kill/score processing.
- Set global threshold to signed integer n. The default is 0.
- Look for score files in killdir. The default is $HOME/.uqwk.
NNTP AUTHENTICATION OPTIONS
- Perform NNTP authentication, specifying the username and password to use for that purpose. (NNTP only)
- Don't do NNTP authentication. This is the default. (NNTP only)
ENVIRONMENTMost of the run-time options can also be controlled by environment variables. If an option is specified by both an environment variable and a command-line option, the command-line option is honored.
Note that, as with options, not all variables are meaningful in al possible incarnations of the program.
- Determines whether or not to process mail. Should be set to `1' (do mail) or `0' (don't do mail).
- Determines whether or not to process news. Should be set to `1' (do news) or `0' (don't do news).
- Determines whether or not to include headers in messages. Should be set to `1' (include headers) or `0' (don't include headers).
- Determines whether or not to include an entry in CONTROL.DAT for empty newsgroups. Should be set to `1' (include empty groups) or `0' (don't include empty groups).
- Determines whether or not to just print the values of run-time options and stop. Should be set to `1' (print options) or `0' (don't print options).
- Determines whether or not to run in read-only mode. Should be set to `1' (read-only) or `0' (not read-only).
- Determines whether the .newsrc file should be interpreted as a Waffle "join" file. Should be set to `0' (normal) or `1' (Waffle mode).
- Determines whether or not to run in SOUP mode. Should be set to `0' (don't run in SOUP mode) or `1' (run in SOUP mode).
- Determines whether or not to run in ZipNews mode. Should be set to `0' (don't run in ZipNews mode) or `1' (run in ZipNews mode).
- Specifies the posting agent (usually inews) to be used. uqwk calls it with a `-h' command line switch, except in non-expert QWK mode.
- Determines the level of message validation. Applicable only with GNKSA support compiled in. See the `+V' switch for details.
- Determines whether or not to honor Xref lines. Should be set to `0' (do not honor Xref lines) or `1' (honor Xref lines). UQ_IGNORE0FD Determines whether or not to ignore nonexisting news messages; `0' to abort, `1' to ignore.
- Determines whether or not to activate the Blue Wave kludge. Should be set to `0' (do not activate the Blue Wave kludge) or `1' (activate the Blue Wave kludge).
- Determines whether or not to operate in QWK expert mode. Should be set to `0' (do not run in expert mode) or `1' (run in expert mode).
- Specifies the directory where the mailbox file (or maildir type mailbox) resides.
- Specifies the mailbox file (or maildir mailbox).
- Specifies the name of the news system's active file.
- Specifies the directory where the news spool resides. UQ_USER_NAME Specifies the username of the person running uqwk.
- Specifies the home directory, where the packet files will be created, and where uqwk expects to find the .newsrc file.
- Specifies the BBS name to be entered into the QWK packet.
- Specifies the BBS city to be entered into the QWK packet.
- Specifies the BBS phone number to be entered into the QWK packet.
- Specifies the BBS sysop name to be entered into the QWK packet.
- Specifies the BBS ID to be entered into the QWK packet.
- Specifies the name of the user's .newsrc file.
- Specifies the name of the desired newsgroups file.
- Specifies the maximum size of the offline packet in 128-byte blocks.
- Specifies the name of the newsgroup name translation table.
- Specifies the maximum length of newsgroup names.
- Specifies the name of the reply packet, if any.
- Specifies the host name for ZipNews replies.
- Specifies the name of the summary file, if any. Also causes uqwk to execute in summary mode.
- Specifies the name of the selection file, if any. Also causes uqwk to execute in selection mode.
- Determines whether or not to perform kill/score processing. Should be set to `1' (do scoring) or `0' (don't do scoring).
- Specifies the global threshold. Should be set to a signed integer.
- Specifies the directory where the score files are.
- Specifies the username to use for NNTP authentication. If, and only if, both a username and a password are set, NNTP authentication will be attempted.
- Specifies the password to use for NNTP authentication. If, and only if, both a username and a password are set, NNTP authentication will be attempted.
USING SCORE FILESIf support for scoring was compiled in, uqwk can "score articles" while collecting news, so that articles whose "score" is below a certain threshold can be excluded from the packet. The rules according to which articles are scored are specified by the user in so-called score files.
The format of these score files is based on the score files used by some offline readers (notably YARN). Each newsgroup can have a score file; its name is the name of the group. There is also a global score file, that applies to all groups, which is called "global".
If you find some class of articles you wish to exclude from a particular newsgroup, use any text editor to create a file named after it. Each line of such a file contains a score, a place to look for a keyword or regular expression, and the keyword.
For example, to exclude all crossposted articles from talk.bizarre, create a file called "talk.bizarre" in the directory $HOME/.uqwk, with the following line in it:
-10 Newsgroups: ,
The effect of this line in this file would be that all articles in talk.bizarre which' "Newsgroups: " header contains a `,' would get -10 added to their initial score of 0. With a threshold of 0, that means that unless other lines add enought to compensate, these articles will not be included.
Score file format
Each score file carries the name of the group it applies to, and consists of a series of score lines. Blank lines and lines beginning with `#' are ignored. Lines can have any of the following formats:
- killthreshold n
- specifies an integer score n that articles must meet or exceed in order to be included in the packet. This line is optional, if not present the global kill threshold is used. (which defaults to 0 if not set).
- score header pattern
- constitutes an actual scoring line; score is added to an article's score if the remainder of the line matches. To match, the specified pattern must match with the articles's indicated header. The specified pattern is always interpreted as a regular expression; for reasons of compatibility patterns can be preceded with the word "pattern".
The global score file is processed first. Its patterns are applied to all articles. Score lines are processed in sequence. An article that scores below the kill threshold will not be included.
Example alt.usenet.offline-reader score file
# only include articles explicitly selected
# select messages about FurriNews
+2 Subject: FurriNews
# select messages about uqwk
+2 Subject: uqwk
# eliminate messages about crapware
-666 Subject: microsoft
-666 Subject: netscape
Limitations, additional notes
It should be noted that only headers are scanned for computing scores. Furthermore, all scanning is done using POSIX regex functions -- even when a simple substring search could have sufficed.
COMMAND LANGUAGEIf, while processing a reply packet, uqwk encounters a message to the username "UQWK", the body of the message will be interpreted as a small command language, used to display newsgroup names and subscribe or unsubscribe to newsgroups. The results of the execution of the commands will be mailed back to the originating user.
This is what the command language looks like:
- List all the available commands.
- SUBSCRIBE newsgroup
- Subscribe to the named newsgroup.
- UNSUBSCRIBE newsgroup
- Unsubscribe from the named newsgroup. UNSUBSCRIBE ALL may be used to unsubscribe from all newsgroups. UNSUBSCRIBE ALL is also the only way to create a new .newsrc if it does not already exist.
- CATCHUP newsgroup
- Mark all articles in the named newsgroup as read.
- List all newsgroups to which the user is currently subscribed.
- List all the available newsgroups and the number of articles in each one.
- SHELL command
- Execute the specified shell command. Anything written to standard output will be mailed back to the originating user.
NOTESIn QWK mode, it is possible to send mail to long email addresses by including, as the first thing in the body of the message, a line of the form:
(The space after the colon is important.)
The handling of MMDF mail files is kludgy and should be fixed.
In QWK mode, if the .newsrc file is modified significantly between the time a packet is created and the time replies to that packet are processed, it is possible that articles may be posted to the wrong newsgroup. If you use uqwk along with a conventional online newsreader, it may be wise to maintain a separate .newsrc file strictly for uqwk.
uqwk does not do mail locking. New mail messages that arrive while packing mail can therefore be lost. If this worries you (it should), there are a few ways of preventing message loss. One approach (see the `getsoup' script, listed below, for an example) is to move your messages to a temporary file, and let uqwk collect the messages from that file instead of directly from the system mailbox. Since messages might get appended at any time, locking must be applied even while the mailbox is being moved. Another approach is to explicitly lock the mailbox before, and unlock it after, running uqwk -- i.e. like this:
lockfile -l666 -ml; trap "lockfile -mu" 1 2 3 13 15
lockfile -mu; trap "" 1 2 3 13 15
A third approach to run uqwk in read-only mode and clean up your mailbox afterwards; in which case one can but hope one really knows what one's doing.
uqwk does not support the ZipNews offline commands. To perform offline configuration using uqwk, send mail to the username "UQWK" in the format described in the COMMAND LANGUAGE section above.
SAMPLE SCRIPTSIt may be convenient for users to employ simple shell scripts for preparing packets using uqwk, and for handling reply packets. A few examples might prove instructive.
getsoup - collect mail and news into a SOUP packet
UQWKARGS="-B0 -m +L"
# What to do? Set variables to enable.
export UQ_DO_MAIL UQ_DO_NEWS
# NNTPAUTH="yes please!"
# When reading mail from the system mailbox, locking
# will have to be done somehow. If your Unix system
# does not have lockfile, but does have /usr/ucb/mail,
# use UQ_LOCKING="ucbmail". See below.
# No user servicable parts below (I hope)
if [ -z "$UQ_DO_MAIL" -a -z "$UQ_DO_NEWS" ]
echo "$prg: nothing to do" >&2
export UQ_HOME_DIR UQ_NRC_FILE
# Do things in a nice, cozy subdirectory
if [ ! -d $UQ_HOME_DIR ]
echo "$prg: $UQ_HOME_DIR does not exist, creating it"
mkdir -p $UQ_HOME_DIR
if [ ! -d $UQ_HOME_DIR ]
echo "$prg: failed to create $UQ_HOME_DIR" >&2
echo "$prg: bailing out" >&2
if [ -f $soupfile ] ; then
echo "Hmmm, $soupfile already exists."
rm -i $soupfile
if [ -f $soupfile ] ; then
if [ -n "$UQ_DO_NEWS" ]
# Get auth stuff (nntp auth mode only)
if [ -n "$NNTPAUTH" ]
while [ -z "$UQ_AUTH_PASS" ]
echo "Authentication for server $NNTPSERVER;"
echo "Username: $USER, password: \c"
read UQ_AUTH_PASS; echo
# Pass these through environment
UQ_AUTH_USER=$USER; export UQ_AUTH_USER UQ_AUTH_PASS
if [ -n "$UQ_DO_MAIL" ]
# Read mail from the system mail box?
if [ -z "$UQ_MAIL_FILE" ]
# uqwk does not do mailbox locking. Locking options:
# - procmail's nifty "lockfile" utility
# - /usr/ucb/mail ("ucbmail")
case $UQ_LOCKING in
lockfile -l666 -ml; trap "lockfile -mu" 1 2 3 13 15
mv $MAIL $UQ_MAIL_FILE
lockfile -mu; trap "" 1 2 3 13 15
( echo 's1-$' $UQ_MAIL_FILE ; echo q ) |
echo "$prg: no, or unknown, locking method" >&2
echo "$prg: bailing out" >&2
# Now we know how to call uqwk, proper args 'n' all
uqwk $UQWKARGS; err=$?
if [ $err -ne 0 ]
echo "$prg: fatal error in uqwk" >&2
echo "$prg: proceed with caution" >&2
# Create the SOUP packet
if [ "`echo *.MSG`" = "*.MSG" ]
echo "Sorry, nothing to get."
rm -f AREAS
zip -m $soupfile AREAS *.MSG
mv $soupfile $HOME
echo "Done, you can upload
putsoup - process a SOUP reply packet
rf=reply.zip; cd $UQ_HOME_DIR
if [ ! -f $rf ]; then
echo "$prg: no reply packet found" >&2
unzip -ju $rf 2>/dev/null
if uqwk -m -n +L -RREPLIES
echo "$prg: fatal uqwk error, proceed with caution" >&2
echo "Done. If all went well, $rf can safely be deleted."
rm -i $rf
uqwk was inspired by a conversation with Harry Lockwood <[email protected]>.
Many thanks to Ken Whedbee <[email protected]> for the NNTP modifications.
Many other people, too numerous to list here, contributed bug fixes and suggestions for improvement.
AUTHORSteve Belczyk, [email protected], [email protected]
Copyright (C) 1993-1994 by steve belczyk. Permission to use, copy, modify and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without expressed or implied warranty.