FAQ News2Mail and Mail2News Gateway

Version: 2001-06-27-01

Q:

I'm trying to setup a Mail2News gateway and I can't get the new2mail and mailpost scripts -- which are part of the inn distribution -- to work. I have setup new2mail as a newsfeed as described, but unfortunately it sends out every article posted in every newsgroup. Clearly I don't want that. How do I configure inn to only send out articles posted to newsgroups which are handled by news2mail?
 

A:

You should have the following in your config files:
 
newsfeeds:
ME:!*::
#  ^^ the exclamation mark is absolutely important, because without it everything will be send out to all feeds,
#     also to the mailing lists (again: EVERYTHING)
n2m!:!*:Tc,Ac,Wn*:/usr/lib/news/bin/news2mail
#^^^ this entry only once
#
#the following entry only once per newsgroup, which should be send out via news2mail
news-internal.list.linux.kernel@example.com/mailpost:internal.list.linux.kernel:Tm,Ac:n2m!
#^^sender email addresse for outgoing mails     ^        ^^the newsgroup              ^^ flags
#                                               | this is the filter key; every articel which has
#                                               | this key in his Path: header will not be mailed;
#                                               | all news articles that will enter via mailpost
#                                               | will have this key in the Path: header -> no loop!
 
news2mail.cf:
#one entry per newsgroup:
news-internal.list.linux.kernel@example.com          linux-kernel@vger.kernel.org
#^^ sender address                                      ^^ recipient addresse
# it is important that the first field of both files is identical (sender)

We also altered the news2mail script to change some headers: The sender will be altered to the one specified in news2mail.cf and the original sender (user) will be changed into a Reply-To: header. Some news headers will be preceeded with a X- to not disturb other news2mail gateways.
Also the mailpost script was altered: It now changes the message ID of the mail that will be send back to the mailing list. For this reason. all articles that are locally generated (posted via a news client) will appear twice in the newsgroup: once as the original news posting and once more as the posting returning from the mailing list. We did this to monitor whether the mail really made it to the mailing list and back. Here are to diffs against news2mail and mailpost. As these where done with INN 2.2.1 (I think) you may have to tweak it a little bit (should be obvious - it's perl ;-)
mailpost.diff and news2mail.diff

The arriving mails are piped through formail to get rid of disturbing headers:
| "/usr/bin/formail -f -c -z -U Content-Transfer-Encoding: -I X-Trace: -I X-Complaints-To: | /usr/lib/news/bin/mailpost internal.list.linux.kernel"