Skip to content

Quick start

go-while edited this page Nov 11, 2026 · 1 revision

Quick start

This page feeds one mbox file to a server. You need:

  • mbox2nntp (see Installation);
  • an NNTP server, such as INN2, that takes IHAVE from the machine you run on. Setting up the server is not covered here;
  • an mbox, here 0.akita-inu.20140617.mbox.gz from the archive.org item usenet-0.akita-inu.

1. Dry run

mbox2nntp -dry-run 0.akita-inu.20140617.mbox.gz

A dry run parses and rewrites the articles, but connects to no server and sends nothing. The input is never marked done. The end of the log looks like this (timestamps and paths cut):

[iterateMbox] Done read mbox file='.../0.akita-inu.20140617.mbox' msgNumber=1528 skipped=0 no-msgid=4 empty=57 binary=0 too-big=0 near-misses=0 stopped-early=false last-err=<nil>
Done sending. 1465/1467 dup=0 e437=2 err=0 filter=0 dropped=61 binary=0
dry run: '0.akita-inu.20140617.mbox.gz' not marked done

The file holds 1528 messages. 61 were dropped (4 without a Message-ID, 57 without a body), which leaves 1467 to offer. 2 of those would be skipped as 437 by mbox2nntp itself, so a real run would send 1465.

Check three things:

  • stopped-early=false. If it is true, the parser lost its place, and a real run would not mark the file done.
  • near-misses. Up to five are logged with line numbers. Prose such as From Table 1 ... is normal. Lines that look like separators (From user@host Thu Dec 8 12:55 2016) mean the file uses a separator shape the parser does not know, and articles were merged. Do not import it yet; see Troubleshooting.
  • In Done sending, the first number is what would be offered, out of the total.

Reading the log explains every field.

2. Feed it

mbox2nntp -server localhost:119 0.akita-inu.20140617.mbox.gz

Useful flags (all of them: mbox2nntp -h):

flag default
-workers N 1 parallel connections to the server
-tmpdir DIR . where .gz, .zip and .7z inputs are unpacked, in a new .mbox2nntp-* directory per run. It must exist, and needs room for the unpacked mbox
-timeout D 2m limit on each read or write on a connection
-max-tries N 10 tries per article after a 436 or a lost connection
-keep-binary off send yEnc articles instead of dropping them

For example:

mkdir -p /var/tmp/m2n
mbox2nntp -server localhost:119 -workers 4 -tmpdir /var/tmp/m2n 0.akita-inu.20140617.mbox.gz

On Windows:

mbox2nntp.exe -server news.example:119 -tmpdir D:\tmp C:\archives\clari.world.top.mbox.zip

3. Check the result

Read the Done sending line. If every article was answered and none failed, the file is now 0.akita-inu.20140617.mbox.gz.done.

The log has an ERROR head=N body=0 msgid=... line for each message without a body. Those are the empty messages of the Done read line, mostly cancel control messages. They are not sent, and they do not keep the file from being marked done.

If it was not renamed, look for the other ERROR lines and see Troubleshooting. Then run the same command again. Articles the server already has come back as 435 and cost little.

The exit code does not tell you whether the file was done: mbox2nntp exits 0 whenever it finishes a run. The .done rename is the signal.

Next

  • A directory of article files works the same way: mbox2nntp -server localhost:119 /srv/oldspool/comp/lang/. A directory is never renamed .done.
  • To feed many files, or the archive.org collections, see Importing the collections.

Clone this wiki locally