How it works

The newsstar perl script performs these functions:

Preparing articles for upload

For each newsrc file, the script looks for a corresponding newsfeeds file (for INN or s-news) or outgoing directory (for sn) in OUTGOING_DIR.

Newsfeeds files are flushed, and the referenced articles copied into the appropriate directory for the newsstar binary, with the upload filter applied. The feed file, usually generated by INN, contains one article reference per line. Newsstar is only interested in the first field in each line, which can either be a partial path to the article, or a storage token. The script automatically distinguishes between partial paths and tokens, taking appropriate action to locate the referenced file.

For sn, the processs is slightly simpler: the files just have to be moved, processed from sn's "wire format" into plain text, and the upload filter applied.

Running the binary, processing downloaded articles, clearing up

Finally, the script runs the binary, posts the downloaded batch (if present) to the local server, mails failed postings back to their sender and deletes them, removes any remaining temporary files etc, and exits.