1RPOST(1) General Commands Manual RPOST(1)
2
3
4
6 rpost - post an article to an NNTP news server
7
9 rpost [ hostname ] [ @filename ] [ -s | -S filename ] [ -e | -E file‐
10 name ] [ -b batchfile ] [ -r rnews_file rnews_path ] [ -p prefix ] [ -Q
11 ] [ -d ] [ -U userid ] [ -P password ] [ -M ] [ -N port_number ] [ -l
12 phrase_file ] [ -D ] [ -T timeout ] [ -u ] [ -n ]
13
14 [ -F perl_file ] [ -i ] [ -z ] [ -f filter $$o=<outfile> filter_arg1
15 ... ]
16
18 Rpost will post one or more articles, specified by hostname. If host‐
19 name is not specified, rpost will use the environment variable
20 NNTPSERVER. The hostname may optionally include the port number, in
21 the form Host:Port will be ignored.
22
24 @filename
25
26 This option tells rpost to read other options from a file in addition
27 to the command line.
28
29 -D This option tells rpost to log various debugging messages to
30 "debug.suck", primarily for use by the developer.
31
32 -e|-E filename
33
34 These options will send all error messages (normally displayed on
35 stderr), to an alternate file. The lower case version, -e, will send
36 the error messages to the compiled-in default defined in suck_config.h.
37 The default is suck.errlog. The upper case version, -E, requires the
38 filename parameter. All error messages will then be sent to this file.
39
40 -i
41
42 This option tells rpost to ignore the 201 (no posting allowed) from the
43 welcoming message and to try and post anyway. Some news servers
44 (inn-2.3.1) send 201 no posting allowed when they are using the
45 AUTHINFO commands to verify permission to post.
46
47 -l phrase_file
48
49 This option tells rpost to load in an alternate phrase file, instead of
50 using the built-in messages. This allows you to have rpost print
51 phrases in another language, or to allow you to customize the messages
52 without re-building. See the "FOREIGN LANGUAGE PHRASES" in suck.1 for
53 more details.
54
55 -M
56
57 This option tells rpost to send the "mode reader" command to the remote
58 server. If you get an invalid command message from rpost immediately
59 after the welcome announcement, then try this option.
60
61 -n
62
63 This option tells rpost to show the name of the file as it is being
64 uploaded.
65
66 -N port_number
67
68 This option tells rpost to use an alternate NNRP port number when con‐
69 necting to the host, instead of the default port number, 119.
70
71 -s|-S filename
72
73 These options will send all status messages (normally displayed on std‐
74 out), to an alternate file. The lower case version, -s, will send the
75 status messages to the compiled-in default defined in suck_config.h.
76 The default is /dev/null, so no status messages will be displayed. The
77 upper case version, -S, requires the filename parameter. All status
78 messages will then be sent to this file.
79
80 -T This option overrides the compiled-in TIMEOUT value. This is how
81 long rpost waits for data from the remote host before timing out and
82 aborting.
83
84 -u This option tells rpost to send the AUTHINFO USER command immedi‐
85 ately upon connect to the remote server, rather than wait for a request
86 for authorization. You must supply the -U and -P options when you use
87 this option.
88
89 -U userid -P password
90
91 These two options let you specify a userid and password, if your NNTP
92 server requires them.
93
94 -Q
95
96 This option allows you to specify the userid and password via the envi‐
97 ronment variables "NNTP_USER" and "NNTP_PASS" instead of on the command
98 line. This prevents a potential security issue where someone doing a
99 ps command can see your login and password.
100
101 -z This option tells rpost to use SSL to communicate with the remote
102 hosts, if SSL was compiled into rpost.
103
104
106 rpost
107
108 rpost hostname
109
110 rpost reads one article from stdin and sends it to the NNTP server. The
111 article must have a header of at least two lines, namely Newsgroups:
112 and Subject: and a body (the article). Header and body have to be sepa‐
113 rated by a newline. Rpost does not change the article in any way.
114
115 Rpost uses the POST command to post your article, just like any stan‐
116 dard newsreader. This is handy when using SLIP and PPP, since most
117 providers do not allow any other method to post articles (such as
118 nntpsend or innxmit).
119
121 rpost hostname -b batchfile -p prefix -d
122
123 This batch mode allows you to give rpost a list of articles, and have
124 them all posted.
125
126 -b batchfile
127
128 A listing of the articles to be posted. This parameter is REQUIRED.
129 This file contains one article per line, with the line being the path
130 to the file containing the article. For example:
131
132 -b /usr/spool/news/out.going/pixi
133
134 IF there are any problems uploading a specific article, a "failed" file
135 will be created. It will be called "batchfile".fail, and contain the
136 line from this batchfile for the article(s) that did not successfully
137 upload. This file can be used to re-run the failed messages through
138 rpost. NOTE: duplicate articles are NOT considered an error for the
139 fail file.
140
141 -d
142
143 If the upload of articles is successful, this option will cause rpost
144 to
145 delete the batchfile named in the -b option.
146
147 -p prefix
148
149 If the batchfile does not contain a full path, but rather a partial
150 path, this parameter must be specified. This is useful when the batch
151 file is generated by another program. For example, Inn lists the path
152 in the out.going file relative to its base directory /usr/spool/news.
153 In that case just use:
154
155 -p /usr/spool/news
156
157
159 rpost hostname -r rnews_file rnews_path
160
161 This option allows you to use rnews generated file(s) to post. It
162 requires two parameters.
163
164 rnews_file - this is the base name for the rnews files. If you have
165 your rnews file(s) called batch1, batch2, etc., then this argument
166 would be "batch".
167
168 rnews_path - this is the path to the location of the rnews files.
169 -r batch /usr/tmp/rnews
170
171 -d
172
173 If the upload of all the articles from any of the rnews files is suc‐
174 cessful, then this option will cause rpost to delete that particular
175 rnews file.
176
177
179 -f filter $$o=<outfile> filter_arg1 filter_arg2 ...
180
181 In many cases, each article must be massaged before the remote NNTP
182 will accept it. This option, and the embedded perl filter option
183 below, lets you do that. These filters do not work in STDIN mode, but
184 in the batch and rnews modes from above. Note that the -f .... option
185 must be the LAST option, as everything that follows it is passed to the
186 filter, except as noted below. There are three required parameters
187 with this:
188
189 $$o=<outfile> - <outfile> is the name of the file produced by your
190 filter that will get uploaded to the remote NNTP server. THIS IS NOT
191 passed to your filter program. This can be specified anywhere on the
192 command line AFTER the -f filter argument, either before the filter
193 name, or after it.
194
195 filter - name of the program to call. Whatever follows filter, EXCEPT
196 for the $$o, are arguments passed to the filter.
197
198 arg1 - The first argument to your filter program/script. It most
199 likely will be $$i, which rpost fills in with the name of the article
200 that needs to be cleaned up.
201
202 arg2 ... - any additional args needed can be specified.
203
204
205 Let's clarify this a bit with an example. Some NNTP servers don't like
206 to receive articles with the NNTP-Posting-Host filled in. Create a
207 short shell script to delete this from a file:
208
209 -myscr--------------------------------------------
210
211 #!/bin/sh
212
213 sed -e "/^NNTP-Posting-Host/d" $1 > $2
214
215 -end myscr----------------------------------------
216
217 Then call rpost like this:
218 rpost localhost -b /usr/spool/news/out.going/pixi -f myscr
219 \$\$o=/tmp/FILTERED_MSG \$\$i /tmp/FILTERED_MSG
220
221 Then, before each article is uploaded, myscr is called like such:
222 myscr infilename /tmp/FILTERED_MSG
223
224 After myscr has finished, rpost uploads the cleaned up article, stored
225 in /tmp/FILTERED_MSG, to the remote NNTP server.
226
228 The $$o and $$i have to be escaped, using either the backslashes as
229 above, or with single quotes, to prevent the shell from trying to
230 interpret these as variables. Failure to escape them will result in
231 rpost not working!
232
233 -F perlfilter
234
235 This option allows you to use an embedded perl filter to filter your
236 articles. In order to use this, you must edit the Makefile, and define
237 the various PERL_ options. It has a couple of advantages over the -f
238 option above. Because it is embedded perl, there are no forks and exe‐
239 cls() done, so it should be faster. Also, you don't need to worry
240 about the arguments to the program and escaping $$, etc as above.
241
242 Rpost will, when it starts up, load in the perlfilter file designated
243 and parse it for syntax errors. Then, for each article to be uploaded,
244 rpost will call the subroutine "perl_rpost", contained in the perlfil‐
245 ter file. See sample/put.news.pl for a complete working example.
246 There are three key points you need to be aware of when creating your
247 filter.
248
249 1. The perlfilter file must contain the line "package
250 Embed::Persistant;", so that variables in the perlfilter file
251 don't clash with rpost variables, and the subroutine must be
252 called "perl_rpost". This can be changed by editting the
253 PERL_RPOST_SUB define in suck_config.h.
254
255 2. The perl_rpost subroutine receives the input file name as its
256 sole argument, and must return the full path to the location of
257 the filtered article as a single scalar string (return $out‐
258 file).
259
260 3. The subroutine must explicitly close the output file (con‐
261 taining the filtered argument) before it returns. This is
262 because perl will only do an automatic close upon program com‐
263 pletion (in our case when rpost exits), or when the file handle
264 is reused (the next time the subroutine is called). If the
265 close is not done, then more than likely, a 0 byte file will
266 exist when rpost tries to post the article, and errors will
267 result.
268
269
271 Be very careful with what the filter program deletes from the article.
272 Deleting the wrong line can have bad effects later on. For example, do
273 not delete the MSG-ID line, as this could cause a single message to be
274 posted many times, depending on the configuration of both the local and
275 remote newserver.
276
277
279 If you specify @filename on the command line, rpost will read from
280 filename and parse it for any arguments that you wish to pass to rpost.
281 You specify the same arguments in this file as you do on the command
282 line. The arguments can be on one line, or spread out among more than
283 one line. You may also use comments. Comments begin with '#' and go
284 to the end of a line. All command line arguments override arguments in
285 the file. One advantage to using the file instead of the command line,
286 is that you don't have to escape any special characters, such as $.
287
288 # Sample Argument file
289 -b batch # batch file option
290 -M # use mode reader option
291
292
294 Rpost returns the following exit values:
295
296 0 = success
297 1 = error posting an article
298 2 = unable to do NNTP authorization with the remote server.
299 3 = unexpected answer to command when doing NNTP authorization.
300 -1 = other fatal error.
301
302
304 suck(1), testhost(1), lpost(1).
305
306
307
308 RPOST(1)