RPOST(1)
π¦ rpost β post an article to an NNTP news server
straight outta the General Commands Manual, section 1 β aka RPOST(1) π
π NAME
rpost β post an article to an NNTP news server π«Ά
π SYNOPSIS
rpost [ hostname ] [ @filename ] [ -s | -S filename ] [ -e | -E filename
] [ -b batchfile ] [ -r rnews_file rnews_path ] [ -p prefix ] [ -Q ] [
-d ] [ -U userid ] [ -P password ] [ -M ] [ -N port_number ] [ -l
phrase_file ] [ -D ] [ -T timeout ] [ -u ] [ -n ]
[ -F perl_file ] [ -i ] [ -z ] [ -f filter $$o=<outfile> filter_arg1 ...
]
π« DESCRIPTION
okay so rpost will post one or more articles, specified by hostname. If you don't give it a hostname, rpost will just use the environment variable NNTPSERVER instead. The hostname may optionally include the port number, in the form Host:Port. If you use that form, then any port number you specified via the -N option gets ignored β no cap. π
πΈ Generic Options
@filenameβ this one tells rpost to read other options from a file, on top of whatever you already threw at it on the command line. β¨-Dβ tells rpost to log various debugging messages to"debug.suck", primarily for use by the developer. (iykyk π)-e|-E filenameβ these send all error messages (which normally show up on stderr) to an alternate file instead. The lowercase version,-e, sends the error messages to the compiled-in default defined insuck_config.hβ that default issuck.errlog. The uppercase version,-E, requires the filename parameter, and all error messages will then be sent to that file. π-iβ tells rpost to ignore the 201 (no posting allowed) from the welcoming message and to try and post anyway. Some news servers (inn-2.3.1) send 201 no posting allowed when they are using the AUTHINFO commands to verify permission to post. (not me ignoring the bouncer π)-l phrase_fileβ tells rpost to load in an alternate phrase file, instead of using the built-in messages. This lets you have rpost print phrases in another language, or lets you customize the messages without re-building. See the "FOREIGN LANGUAGE PHRASES" insuck.1for more details. π-Mβ tells rpost to send the"mode reader"command to the remote server. If you get an invalid command message from rpost immediately after the welcome announcement, then try this option. π-nβ tells rpost to show the name of the file as it is being uploaded. π-N port_numberβ tells rpost to use an alternate NNRP port number when connecting to the host, instead of the default port number,119. π-s|-S filenameβ these send all status messages (normally displayed on stdout) to an alternate file. The lowercase version,-s, sends the status messages to the compiled-in default defined insuck_config.h. That default is/dev/null, so no status messages will be displayed. The uppercase version,-S, requires the filename parameter, and all status messages will then be sent to this file. π€«-Tβ overrides the compiled-in TIMEOUT value. This is how long rpost waits for data from the remote host before timing out and aborting. β³-uβ tells rpost to send the AUTHINFO USER command immediately upon connect to the remote server, rather than wait for a request for authorization. You must supply the-Uand-Poptions when you use this option. π-U userid -P passwordβ these two options let you specify a userid and password, if your NNTP server requires them. ποΈ-Qβ lets you specify the userid and password via the environment variables"NNTP_USER"and"NNTP_PASS"instead of on the command line. This prevents a potential security issue where someone doing apscommand can see your login and password. protect urself bestie π‘οΈ-zβ tells rpost to use SSL to communicate with the remote hosts, if SSL was compiled into rpost. π
π₯ 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 separated 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 -d
This batch mode lets you give rpost a list of articles and have them all posted. bulk posting era fr fr π₯
-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
IF there are any problems uploading a specific article, a "failed" file will be created. It will be called "batchfile".fail, and contain the line from this batchfile for the article(s) that did not successfully upload. This file can be used to re-run the failed messages through rpost. NOTE: duplicate articles are NOT considered an error for the fail file.
-dβ if the upload of articles is successful, this option will cause rpost to delete the batchfile named in the-boption. ποΈ-p prefixβ if the batchfile does not contain a full path, but rather a partial path, this parameter must be specified. This is useful when the batch file is generated by another program. For example, Inn lists the path in theout.goingfile relative to its base directory/usr/spool/news. In that case just use:
-p /usr/spool/news
π° RNEWS MODE
rpost hostname -r rnews_file rnews_path
This option allows you to use rnews generated file(s) to post. It requires two parameters. π«Ά
rnews_fileβ this is the base name for the rnews files. If you have your rnews file(s) calledbatch1,batch2, etc., then this argument would be"batch".rnews_pathβ this is the path to the location of the rnews files.
-r batch /usr/tmp/rnews
-dβ if the upload of all the articles from any of the rnews files is successful, then this option will cause rpost to delete that particular rnews file. π
π§Ό FILTER MODES
-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, and the embedded perl filter option below, lets you do that. These filters do not work in STDIN mode, but in the batch and rnews modes from above. Note that the -f .... option must be the LAST option, as everything that follows it is passed to the filter, except as noted below. There are three 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 filterargument, either before the filter name, or after it.filterβ name of the program to call. Whatever followsfilter, EXCEPT for the$$o, are arguments passed to the filter.arg1β the first argument to your filter program/script. It most likely will be$$i, which rpost fills in with the name of the article that needs to be cleaned up. π§½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 localhost -b /usr/spool/news/out.going/pixi -f myscr
\$\$o=/tmp/FILTERED_MSG \$\$i /tmp/FILTERED_MSG
Then, before each article is uploaded, myscr is called like such:
myscr infilename /tmp/FILTERED_MSG
After myscr has finished, rpost uploads the cleaned up article, stored in /tmp/FILTERED_MSG, to the remote NNTP server. iconic tbh π
βΌοΈ 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! π
-F perlfilterβ this option allows you to use an embedded perl filter to filter your articles. In order to use this, you must edit theMakefile, and define the variousPERL_options. It has a couple of advantages over the-foption above. Because it is embedded perl, there are no forks andexecls()done, so it should be faster. Also, you don't need to worry about the arguments to the program and escaping$$, etc as above. β‘
Rpost will, when it starts up, load in the perlfilter file designated and parse it for syntax errors. Then, for each article to be uploaded, rpost will call the subroutine "perl_rpost", contained in the perlfilter file. See sample/put.news.pl for a complete working example. There are three key points you need to be aware of when creating your filter:
- The perlfilter file must contain the line
"package Embed::Persistant;", so that variables in the perlfilter file don't clash with rpost variables, and the subroutine must be called"perl_rpost". This can be changed by editting thePERL_RPOST_SUBdefine insuck_config.h. - The
perl_rpostsubroutine receives the input file name as its sole argument, and must return the full path to the location of the filtered article as a single scalar string (return $outfile). - The subroutine must explicitly close the output file (containing the filtered argument) before it returns. This is because perl will only do an automatic close upon program completion (in our case when rpost exits), or when the file handle is reused (the next time the subroutine is called). If the close is not done, then more than likely, a 0 byte file will exist when rpost tries to post the article, and errors will result. π
β οΈ WARNING:
Be very careful with what the filter program deletes from the article. Deleting the wrong line can have bad effects later on. For example, do not delete the MSG-ID line, as this could cause a single message to be posted many times, depending on the configuration of both the local and remote newserver. π
π RPOST ARGUMENT FILE π
Okay bestie, so you can also do the whole @filename thing on the command line. When you do, rpost reads from filename and parses it for any args you wanna send to rpost. It's giving β¨argument file, but make it cuteβ¨. You put the exact same arguments in this file that you'd put on the command line. They can all chill on one line, or be spread out over more than one line β no stress π«Ά.
You can also use comments. Comments start with # and go all the way to the end of the line. And all command line arguments override arguments in the file. Periodt π
.
One major slay of using the file instead of the command line? You don't have to escape any special characters, like $. Iconic π.
Here's the sample argument file from the original, exactly as it appears:
# Sample Argument file
-b batch # batch file option
-M # use mode reader option
π EXIT VALUES π
Rpost returns these exit values, no cap:
0 = success
1 = error posting an article
2 = unable to do NNTP authorization with the remote server.
3 = unexpected answer to command when doing NNTP authorization.
-1 = other fatal error.
π¦ SEE ALSO π¦
Go read these, bestie: suck(1), testhost(1), lpost(1).
That's the whole page, bestie. The footer just says RPOST(1), and the date isn't in the footer, so we're not making one up. Bye π
β¨
π¦ where this page comes from
- debian bookworm: suck 4.3.4-1+b3 Β· Public Domain
- debian trixie: suck 4.3.5-5 Β· LicenseRef-public-domain
- ubuntu jammy: suck 4.3.4-1build1 Β· Public Domain
- ubuntu noble: suck 4.3.4-1build3 Β· Public Domain
- ubuntu questing: suck 4.3.5-5
- ubuntu resolute: suck 4.3.5-5build1 Β· LicenseRef-public-domain
- ubuntu stonking: suck 4.3.5-8build1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms