This document assumes that you have successfully been able to setup your Cyrus IMAP server. If you have not already done so, please refer to the rest of the documentation. This document also assumes that you are familiar with Usenet and shared IMAP mailboxes.
There is a diagram that shows the interactions of the various components of the NNTP support in Cyrus which may be helpful in understanding the "big picture".
You must create a mailbox for each newsgroup that you would like to receive/export before the newsgroups can be used. If some groups are private, be sure to set the ACLs accordingly. The tools/mknewsgroups script can be used to help facilitate mass creation of newsgroup mailboxes. When using this script, be sure to add posting rights for 'anyone' (eg. mknewsgroups -a 'anyone +p' ...) so that articles can be fed/posted.
Whenever nntpd receives an article, it automatically adds a To: header with email addresses corresponding to the newsgroups that the article is destined for (eg, post+comp.mail.imap). The presence of this header makes it easier for email clients to post/reply to the newsgroup. The "pseudo" user that is used when constructing the email address can be specified with the newspostuser option in imapd.conf (default = "post").
As an alternative to fetchnews, you can also use the suck program to pull articles from your peer.
Automatic execution of control messages is only performed if the newsmaster (default = "news") user has the proper access control for the given mailbox. For example, to allow cancel control messages to be performed for "misc.test" articles, give the "news" user the 'd' right on "misc.test". To allow newgroup, rmgroup and mvgroup control messages to be performed on the "misc" hierarchy, give the "news" user the 'c' right on "misc".
NOTE: No sender or PGP verification of control messages is currently implemented.
Newsgroups can also be gatewayed to email by setting /vendor/cmu/cyrus-imapd/news2mail mailbox annotations to the corresponding email addresses.
If you want to allow your news clients to use the NNTP NEWNEWS command, you will have to enable the allownewnews option in imapd.conf.
To help faciliate this, you can set the newspostuser option to a userid which will be used to construct email delivery addresses for each incoming article. These addresses are inserted into a To: in the article. For example, if set to "post", an article posted to comp.mail.imap will have an address of "post+comp.mail.imap" inserted into the To: header. This will allow a user to easily reply to an article via email by using their messaging client's "Reply All" feature. Otherwise, the users will have to learn the correct email address format for posting and replying to articles.
In order for these email messages to be fed into your news server (and subsequently to the outside world) you need to use an email to news gateway, such as lmtp2nntp. You need to configure your MTA (Sendmail, Postfix, etc) so that lmtp2nntp is used as the local mailer whenever it receives a news article. A simple rule for doing this in Sendmail is shown below:
# mail addressed to post+ goes to lmtp2nntp@localhost LOCAL_RULE_0 Rpost + $+ < @ $=w . > $#lmtp2nntp $@ localhost $: $1
For other configurations, consult the lmtp2nntp and documentation and your MTA documentation.
NOTE: If anonymous logins are disabled (default) in imapd.conf, then you should configure lmtp2nntp to use its "feed" operation mode.
Setting the expire time to 0 (zero) for a mailbox will ensure that neither the messages nor the corresponding database entries will ever be expired. This can be useful for shared mailboxes (e.g. mailing list archives) which are being exported via NNTP. Note that this will cause the duplicate delivery database to consistently grow in proportion to the number of messages in such mailboxes.
If a mailbox does not have an expire time set on it, then the messages will never be expunged, but the corresponding database entries WILL be expired after the default number of days (cyr_expire -E option).
Note that the /vendor/cmu/cyrus-imapd/expire mailbox annotation is inherited by child mailboxes, so that you may control expiration on an entire mailbox/newsgroup hierarchy simply by setting the annotation on the root of the hierarchy. For example, if you set the annotation on comp, then ALL of the newsgroups in the comp hierarchy will be expired at the same time. Similarly, if you set the annotation on alt.binaries, all of the binary newsgroups under alt will be expired at the same time (independently from comp).