NNML::Server - a minimal NNTP server |
NNML::Server - a minimal NNTP server
perl -MNNML::Server -e server perl -MNNML::Server -e unspool
NNML::Server server implements a minimal NNTP server. It is (hope-)
fully conformant to rfc977. In addition the commands XOVER
and
AUTHINFO
are implemented.
Supported commands:
ARTICLE, AUTHINFO, BODY, GROUP, HEAD, HELP, IHAVE, LAST, LIST, MODE, NEWGROUPS, NEWNEWS, NEXT, POST, QUIT, SLAVE, STAT
XOVER, XHDR, LIST NEWSGROUPS ng-spec
The main reason for writing this was to synchronize my mail directories across different hosts. The Mail directories are MH-Style with a F<.overview> file in each folder and an F<active> file in the base directory. These are maintained by the B<Emacs> B<Gnus> backend B<NNML>. To get started, you can generate/update this files using the B<overview> program. Upon C<POST> and C<IHAVE> commands this files will also be updated.
To start from scratch use:
touch /tmp/active; perl -MNNML::Server -e 'server(base => "/tmp", port => 3000)'
To export your mh-Mail use:
perl overview -base ~/Mail perl -MNNML::Server -e 'server(base => "$ENV{HOME}/Mail", port => 3000)'
The command POST and IHAVE honour the Newsgroups
header if
not overwritten by the X-Nnml-Groups
header. Articles will contain
an appropriate X-Nnml-Groups
header when retrieved by message-id.
When the client submits the SLAVE
command, all forther post
requests are spooled in $Config-
spool> (usually
~/Mail/NNML.spool) for performance reasons. You can process the
spooled articles by submitting the XUNSPOOL
command or by calling
perl -MNNML::Server -e unspool
Rejected articles will be saven in $Config-
bad> (usually
~/Mail/NNML.bad)
To enable access restrictions use:
perl -MNNML::Auth -e "NNML::Auth::add_user($ENV{LOGANME}, 'passwd', \ 'read', 'write', 'admin')"
If base/passwd exists, three levels of authorization are recognized:
SHUT
.
Also these users may create new groups simply by posting to them.
Permission admin is also required for the XUNSPOOL
command.
Version 1.06 implements the MODE GZIP
command. After submiting this
commands, all articles, heads and bodies will be piped through gzip
-cf | mimencode
. The server will recognize post requeste using the
same pipe automatically. This will speed up nnmirror if the line is
sufficiant slow.
The server handles multiple connections in a single thread. So a hung
POST
or IHAVE
would block all connections. Therfore a post
request is interrupted if the server could not read any bytes for 30
seconds. The Client is notified by message 441. If the client
continues to send the article, it is interpreted by the command loop.
The overview(1) and nnmirror(1) manpages.
Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>
NNML::Server - a minimal NNTP server |