INN - mail gateway
The goal is to have a mailing-list mirrored on a newsgroup.
Posts have to be sent from the list to the group and from the group to the list as needed.
From list to news (Mailman)
(untested in 2022)
Pretty simple, in Mailman Web interface:
Mail gateway (Sympa)
Receiving the list
For all examples, we use a mailing list "firstname.lastname@example.org" and a NNTP server "dodin.fr.nf". "dodin.fr.nf" MUST accept email (obviously), postfix (or equivalent) have to be configured and smtp (port 25) open in the Firewall if any.
From list to newsgroup
Group side as root
For a newsgroup, eg "test". Use the mailpost program (shipped with inn) to established the gateway. Create an alias in the MTA of dodin.fr.nf :
test: "|/usr/lib/news/bin/mailpost -b /var/spool/mailpost -t /var/tmp -d local culte.test"
# ll /var/spool/mailpost/
To see if mailpost writes there
# ls -l /var/spool/mailpost/ total 20 -rw-rw-r-- 1 nobody nobody 16 5 févr. 12:22 mailpost-msgid.dir -rw-rw-r-- 1 nobody nobody 16384 5 févr. 16:10 mailpost-msgid.pag
mailpost-msgid.pag changes (date, taille), not mailpost-msgid.dir
then send messages from root to test, then email@example.com. If they go through, good. Always add the post date in the text or the subject for reference
Then try from the list server. The "Sympa" one allows admin to send post directly from the admin web interface.
cat /var/log/mail* | grep "whatever"
Check that aliases works (see postfix configure here).
When a mail is sent to the list, firstname.lastname@example.org will receive it. And with mailpost, it will be posted on the newsgroup.
As "news", create the group:
/usr/lib/news/bin/ctlinnd newgroup culte.test
inncheck -a -v -f --pedantic --perm
Add a new subscriber to the mailing list. Its mail address must be handled by dodin.fr.nf.
You can use "email@example.com".
It's a good idea to set the user as "don't receive my own mails", the only case when this user send a message is when this message is posted via newsgroup and it's already on the group.
September 11, 2022: when sending an article through newsgroup, I keep receiving warning because the list send the message back. May be (not yet tested) it's better have an user to send article to and an other to receive, or change something in sympa. (do not send me back my own articles?)
From group to mailing list
sympa method (can't make it work: moderation is refused (not allowed to post))
It's quite simple : mark the group as moderated. This is done while the server is running with: ctlinnd changegroup test m For group "test" and letter m, for "moderated". On my server the group is "culte.test" to separate the groups of my Linux User Group (http://culte.org) from more general ones. And set the moderation address to the mailing list address (firstname.lastname@example.org). In the file "~news/moderators" add culte.test:email@example.com Change the mailpost alias using the -a flag of mailpost (the -a flag marks the message as accepted by a moderator): test: "| /path/to/mailpost -a culte.test" Then, when a message is sent to the list, it is approved by the moderator and then posted. When a message is directly posted, it's sent to the moderator (which is the whole mailing list). As other messages on the list, it's approved and posted. This last method can be usefull to create a complete message system : mail, news and web interfaces can be used to read and send messages.
Mailman method (should work also for Sympa)
As "news" edit "newsfeeds"
The line following is commented out by default, uncomment it.
Is to take as it is, only "<pathbin>" is for us /usr/lib/news/bin/
then, for a "test" list and culte.test group:
The first field (test) is only a random name, it only have to be the same as in the other file. "culte.org" is the list server domain name. Warning: no blank space at the end of the line!
There is no need to have the list name here, so you have to read "test/culte.org", not "firstname.lastname@example.org"...
As "news" edit news2mail.cf
test email@example.com firstname.lastname@example.org
First field (test) is the same than in the other file. The second field is the target list and the last is the "sender" name for the header. If the list is only for subscribers, use the mail of a legitimate list user.
Syntax is important and not always easy to understand. You can use very often "inncheck -a", and even
inncheck -a -v -f --pedantic --perm
That should see even excess spaces at the end of a line