RPOST(1)

NAME
rpost - post an article to an NNTP news server

SYNOPSIS
rpost [ hostname ] [ -s|-Sfilename ] [ -e|-Efilename ] [ -b batchfile ] [ -p prefix ] [ -f filter $$o=<outfile> filter_arg1 ... ]

DESCRIPTION
Rpost will post one or more articles, specified by hostname. If hostname is not specified, rpost will use the environment variable NNTPSERVER.

Generic Options
[ -s|-S filename ] These options will send all status messages (normally displayed on stdout), to an alternate file. The lower case version, -s, will send the status messages to the compiled-in default defined in config.h. The default is /dev/null, so no status messages will be displayed. The upper case version, -S, requires the filename parameter. All status messages will then be sent to this file. -e|-E filename ] These options will send all error messages (normally displayed on stderr), to an alternate file. The lower case version, -e, will send the error messages to the compiled-in default defined in config.h. The default is suck.errlog. The upper case version, -E, requires the filename parameter. All error messages will then be sent to this file.

STDIN MODE
rpost rpost hostname rpost reads one article from stdin and sends it to the NNTP server. The article must have a header of at least two lines, namely Newsgroups: and Subject: and a body (the article). Header and body have to be seperated by a newline. Rpost does not change the article in any way. Rpost uses the POST command to post your article, just like any standard newsreader. This is handy when using SLIP and PPP, since most providers do not allow any other method to post articles (such as nntpsend or innxmit).

BATCH MODE
rpost [ hostname ] -b batchfile [ -p prefix ] [ -f filter $$o=<outfile> filter_arg1 ... ] -b batchfile A listing of the articles to be posted. This parameter is REQUIRED. This file contains one article per line, with the line being the path to the file containing the article. For example:
    -b /usr/spool/news/out.going/pixi

-p prefix If the batchfile above, does not contain a full path, but rather a partial path, this paramater must be specified. This is useful when the batch file is generated by another program. For example, Inn lists the path in the out.going file relative to its base directory /usr/spool/news. In that case just use:
     -p /usr/spool/news
-f filter $$o=<outfile> filter_arg1 filter_arg2 ... In many cases, each article must be massaged before the remote NNTP will accept it. This option lets you do that. There are two required parameters with this:
$$o=<outfile>    - <outfile> is the name of the file produced by
your filter that will get uploaded to the remote NNTP server. THIS IS NOT passed to your filter program. This can be specified anywhere on the command line AFTER the -f filter argument. $$i - When rpost calls your filter, it will replace $$i with the file name of the article to be massaged. arg1 - The first argument to your filter program/script. It most likely will be $$i arg2 ... - any additional args needed can be specified.

Let's clarify this a bit with an example. Some NNTP servers don't like to receive articles with the NNTP-Posting-Host filled in. Create a short shell script to delete this from a file: -myscr-------------------------------------------- #!/bin/sh sed -e "/^NNTP-Posting-Host/d" $1 > $2 -end myscr----------------------------------------

Then call rpost like this:
    rpost -b /usr/spool/news/out.going/pixi -f myscr \$\$o=/tmp/FILTERED_MSG \$\$i /tmp/FILTER_MSG
Then, before each article is uploaded, myscr is called like such:
    myscr infilename /tmp/FILTER_MSG
After myscr has finished, rpost uploads the cleaned up article, stored in /tmp/FILTER_MSG, to the remote NNTP server.

NOTE:
The $$o and $$i have to be escaped, using either the backslashes as above, or with single quotes, to prevent the shell from trying to interpret these as variables. Failure to escape them will result in rpost not working!

EXIT VALUES
Rpost returns 0 on success, -1 on failure.

SEE ALSO
suck(1), testhost(1), lpost(1).