In this version of DNews we've attempted to make setting up news to mail and mail to news gateways trivial, with this new system no external processes are needed, you simply add config entries for each gateway.
Two gateways are needed to make a news group and a mailing list 'identical', you must setup both so that a news post gets sent to the mailing list and so a mailing post gets posted to the news group. You can of course just run one gateway if you don't need both lists to be identical.
Sending a NEWS GROUP to a MAIL ADDRESS - tomail.conf
Getting email messages INTO a news group - getmail.conf
Allowing users to request all new messages on a particular thread or group
How to test tomail/getmail if it doesn't work
In the DNews config directory (as defined in dnews.conf) create a file called tomail.conf and add lines of the following format:
group=NEWSGROUP.NAME to=EMAIL.ADDRESS [subject="TEXT TO MATCH"] [thread=<messageid>] [strip=xxx.] [todash] [email@example.com] [firstname.lastname@example.org]
Here is an example
group=comp.lang.c email@example.com subject="code optimization"
Here is an example of sending many groups to many mailing lists, in this example the email address is constructed by remove "rec." from the front and turning dots into dashes and appending the 'to' addres, so "rec.humor.funny' would convert to 'firstname.lastname@example.org'
NOTE: Any rejected message is deleted from the pop server.
groups=rec.* email@example.com strip="rec." todash
There is obviously a performance hit for adding rules with individual users a few dozen won't hurt, but if you want to add thousands of users it's much better to use mailing lists rather than adding individual users to this file.
This config file is 'automatically' reloaded by DNews if it is changed.
The following DNEWS.CONF settings can be added:
The first two are limits for th total bytes/items sent to a specific email address in a day.
tomail_max_size is the largest item DNews will feed thru this gateway
tomail_from is used to replace the From: header of messages, this is often needed to allow mailing list security to work..
tomail_strip_body is useful if you just want notifications of messages rather than content.
Use this command to check all the rules that are in memory: tellnews show_tomail
First, if you put a subject in the tomail.conf rule, that is a filter, not the subject of the message to send, so it will only send messages which contain that subject, not all messages, this is often the problem, try removing the subject setting.
Second, Make sure you have DNews 5.4 or later.
Third, ensure you have an smtp entry in newsfeeds.conf, e.g.
site your.mail.server smtp
Fourth, if you put a getmail_at setting in dnews.conf, ensure it is correct, it should be *5 * with a space between the 5 and the second asterix.
Lastly, test it like this:
tellnews debug tomail:getmail:
tellnews loglvl debug
Then wait 10 minutes and search the log for "tomail" or "getmail", e.g.
find "tomail" dnews.log
To do this first setup a normal email account on your mail server, then subscribe that user to the mailing list that you want to gateway into DNews, check it's working by reading the email from the account directly.
Now create a file called getmail.conf in the DNews config directory, add lines in this format:
get group=GROUP.NAME user=USERNAME pass=PASSWORD pop=POP.SERVER [header="From:"] [prepend="xxx."] [todot] [recipient="firstname.lastname@example.org"]
Here is an example:
get group=local.support user=support-gateway pass=secret pop=your.pop.server
get group=local.humor user=jokes pass=jokespass pop=your.pop.server
In this example you would have created the user 'support-gateway' and subscribed them to your support mailing list, and you would have created a use called 'jokes' and told your work mates to email funny jokes to that email address for archiving into the news group.
The recipient setting matches against the 'To:' and 'Cc:' headers and rejects the message if the string is not found in one of those headers.
To gateway from a single drop box to multiple news groups arrange for a header in the message to have the newsgroup name in, for example the 'From:' header might be the list name, e.g. two messages from different mailing lists might have from headers like this:
Then using a rule like this:
get header="From:" user=gateway pass=xxxx pop=your.pop.server todot prepend=rec.
Then DNews would take email@example.com, it would remove the @list.server.com, and prepend rec. and turn the dash into a dot, and post the first message to rec.humor.funny. The second message would be posetd to rec.humor.misc. In this way a single get rule can cope with any number of mailing lists as long as the names are sensible and the headers are reliable.
The following dnews.conf settings can be used:
getmail_at *5 *
The getmail_from setting is used in the From: header of messages received thru the gateway, the getmail_at setting controls how often the pop account is checked, the default is once every 10 minutes
If you use DNewsWeb you can allow users to subscribe to a news group or thread within a group by simply clicking on a button, to do this add to dnewsweb.ini
And use the DNewsWeb templates that come with dnews5.4
And in dnews.conf add
And insure you have a valid smtp feed in newsfeeds.conf
Please note, it is quite possible to overload your mail server using this mechanism :-)