NEWSD(8) Simple NNTP News Server NEWSD(8) NAME newsd - erco's simple NNTP News server SYNOPSIS newsd [-p port#] [-t secs] [-c maxchild] [-d] [-mailgateway ] newsd -newgroup DESCRIPTION newsd is an NNTP news server than manages articles and accepts article postings. It was written as an alternative to innd for doing simple local news serving. Each client connection forks a child, and the child remains running until the connection is closed, which is usually when the user closes their news reader. Which can mean a *long time*. Options supported by newsd: -p port Listen for queries on port 'port'. If unspecified, the default is port 119. -t secs Timeout after 'secs' of inactivity. If unspecified, the default is 43200 (12 hours). If set to zero, no timeout will be enforced. -c #maxchild Sets the maximum number of child processes created by the newsd. Default is 15. If set to zero, no maximum is enforced. -mailgateway Used in /etc/aliases to gateway emails to a newsgroup. See 'CONFIGURING A MAIL GATEWAY' below. -d Enable debugging messages to stderr. Not recommended. -newgroup Interactively prompts for the creation of a new newsgroup. Administrators should use this to create a new newsgroup. See ADMINSTRATION for an example session. This daemon should run as the user 'news', group 'news'. DIAGNOSTIC OUTPUT Currently all diagnostic output is sent to stdout/stderr, and should therefore be redirected to a log file, or piped through logger(8). ADMINISTRATION The most common thing to administer are the creation and removal of newsgroups. 1. Creating New Groups ---------------------- New newsgroups can be created on the fly while the newsd(8) daemon is running. Using su(1), become the user 'news', then invoke the following commands: newsd -newgroup You will be prompted for the new group's information. Here's an example interactive session; '-->' indicates administrator's keyboard input: --> # /usr/local/sbin/newsd -newgroup Enter the new group's name (eg. 'electronics.ttl'): --> erco.fovicks Is posting to this group allowed? (Y/n): --> y Maximum #lines for postings, '0' if no maximum (default=1000): --> 1000 Description of newsgroup in one short line, '-' if none --> Discussion of all things FOVICKS. Administrator's email address for group, '-' if none (default='-'): --> erco@3dsite.com CC all postings to this email address, '-' if none (default='-') --> erco@3dsite.com *** New group erco.fovicks was created. *** Use your news reader to post some test messages. *** You can edit /var/spool/news/erco/fovicks/.config later to make changes. # 2. Removing Groups ------------------ To remove a newsgroup, simply run 'rm -rf' on that group's spooler directory. newsd(8) will detect this automatically. FILES /var/spool/news This directory contains all the newsgroups and articles; one file per article, one directory per newsgroup. The directory hierarchy dictates the available news groups, e.g. /var/spool/news/rush/general is the directory for the 'rush.general' news group, and in that directory will be one file per news article, each filename being the article's number, eg: /var/spool/news/rush/general/1 /var/spool/news/rush/general/2 /var/spool/news/rush/general/3 ..would be the pathnames for the three news articles whose article numbers are 1, 2 and 3. Each article contains the complete ascii text of the article, including the article's header and message body, as per RFC 1036. The directory perms should be: chown -R news.news /var/spool/news find /var/spool/news -type d -exec chmod 755 {} \; find /var/spool/news -type f -exec chmod 644 {} \; CONFIG FILES Each active newsgroup's directory should have its own .config file. The newsgroup 'rush.general' would have, for instance a .config file called: /var/spool/news/rush/general/.config ..which might look like: description Rush render queue discussion group creator news@news.3dsite.com postok 1 postlimit 1000 ccpost erco@3dsite.com replyto - Any newsgroup directory that does /not/ have a .config file will not show up in user's news readers. Manual modification of these files should be done carefully if the newsd(8) daemon is running. To prevent having newsd(8) load a file while it's being edited: 1) Make a copy of the file called ".config.new". 2) Modify the copy. 3) Rename the copy to ".config" to make it take effect. The .config file's format: description The one line description of this group, which shows up when people first subscribe to the newsgroup. creator The email address of the owner of this group. Where mail should be sent regarding questions about the maintenance and administration of the group. Also used as the Errors-To: address for all email messages sent by newsd. postok <0|1> Controls if articles can be posted to this group. '0' indicates posting is not allowed (read only group). '1' indicates anyone can post to this group. postlimit <#lines> The maximum number of lines an article can be. Posted articles will be rejected if they exceed this value. Set this value to zero to disable. ccpost ccpost - Sets the list of email addresses to be cc'ed whenever a posting is made to the group. If set to '-', no email is sent. A single line of addresses may not exceed 255 characters; to make longer lists of addresses, use separate lines, eg: ccpost a@foo.com,b@foo.com,c@foo.com ccpost d@foo.com Or to make things more readable, use one address per line: ccpost a@foo.com ccpost b@foo.com ccpost c@foo.com replyto An email address to force the Reply-To SMTP field to be, so that if someone replies to the message, it gets sent to the specified , typically a mail gateway back to the newsgroup. (see 'newsd -mailgateway' above). If set to '-', no Reply-To field will be set. CONFIGURING A MAIL GATEWAY To correctly configure a mail gateway to the group: 1) Add a 'replyto' line in the newsgroup's .config file, e.g. /usr/spool/news/rush/general/.config: replyto rush.general@yourdomain.com 2) Create an entry in /etc/aliases, e.g.: rush.general: "|/usr/local/sbin/newsd -mailgateway rush.general" ..being sure to invoke newaliases(1) to make the change take effect. 3) Make sure /usr/local/sbin/newsd is setuid 'root', eg: # ls -la /usr/local/sbin/newsd -rwsr-xr-x 1 root root 470437 Jan 8 02:31 /usr/local/sbin/newsd ^ ^^^^ ^^^^ | | | Setuid Own Group Use 'chown 0.0 newsd' and 'chmod 4755 newsd' to enforce these permissions. Send a test email to rush.general@yourdomain.com, to see if the message gets added to the group. If it doesn't, check for a bounce. INFO FILES newsd(8) will automatically create and maintain little ".info" files in each active group's directory. Each file maintains runtime information about that group's news articles. Normally these files are automatically created and maintained, and should not be administered by hand unless manually fixing a problem, in which case the daemon should not be running. SEE ALSO RFC 977 -- NNTP Protocol RFC 2890 -- NNTP extensions RFC 1036 -- Usenet news messages format LIMITATIONS By design, newsd does NOT manage usenet news feeds. Acts as a private news server only. Remote readers and posters can be anywhere on the internet. But feeding news to, or pulling news from other servers is neither implemented nor planned. Authentication is not currently implemented, but should be. Some NNTP commands are not supported, including searching by message id. Grep the code for 'TODO' to see what needs to be added. BUGS Report bugs to erco@3dsite.com. There is currently no way to constrain posting or readership to particular IP addresses or domains. There are probably ways to cause denial of service. SUPPORTED NEWS READERS Tested with Netscape, Mozilla, Microsoft Outlook and the tin(1) threaded news readers only. AUTHOR Greg Ercolano, Topanga CA, erco@3dsite.com 01/01/2002.