NetUseMod is a program to moderate Usenet posts via web interface. Copyright (C) 2024 Salahuddin This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . INSTALL -------- 1. copy NetUseMod to your $HOME. 2. Install rnews (part of inn2-inews package) Debian: # apt-get install inn2-inews 3. setup rnews username, password in /etc/news/passwd.nntp edit /etc/news/inn.conf host, port, etc. 4. You need to ask your USENET_SERVER_HOST provider to allow you to post with "Approved:" header for the newsgroup you are moderating. You also might need to set reverse DNS for your domain. 5. After you configured incoming mail for your user account. $ cp NetUseMod/procmailfilter/procmailrc $HOME/.procmailrc adjust your "process_incoming.pl" location in .procmailrc after testing you may change the values to no in .procmailrc LOGABSTRACT=yes VERBOSE=yes 4. edit and adjust the following files as needed. "NetUseMod/scripts/mail_format.sh" - adjust email, domain, etc. "NetUseMod/scripts/process_incoming.pl" --------------------------------------- my $message_dir = 'YOUR_HOME_DIR/incoming_news/'; my $noreply_mail = 'no-reply@YOUR_DOMAIN'; 5. create necessary directories $ cd $HOME $ mkdir incoming_news processed_news rejected_news 6. Web interface setup. Install https://metacpan.org/pod/Dancer2 or in Debian based distro # apt-get install libdancer2-perl 7. edit NetUseMod/web/NetUseAdminWeb/lib/NetUseAdminWeb.pm adjust the following variables. my $usenet_host = 'YOUR_USENET_PROVIDER'; my $usenet_port = '119'; # production 536 ssl my $rnews_location = '/usr/bin/rnews'; my $noreply_mail = 'no-reply@YOUR_DOMAIN'; my $mail_format = 'YOUR_HOME_DIR/NetUseMod/script/mail_format.sh'; my $admin_user = 'XXXXXXXX'; my $admin_pass = 'XXXXXXXX'; my $dir_base = 'YOUR_HOME_DIR'; my $dir_incoming = 'incoming_news'; my $dir_processed = 'processed_news'; my $dir_rejected = 'rejected_news'; also make sure these directories have proper permissions. 8. Test server. note: rnews might need root priviledges by default. # plackup NetUseMod/web/NetUseAdminWeb/bin/app.psgi You try to browse: http://HOST_OR_IP:5000/ You can login using your $admin_user and $admin_pass. 9. If you want to use apache Install apache perl module # apt-get install libapache2-mod-perl2 enable rewrite module # /usr/sbin/a2enmod rewrite move NetUseAdminWeb/ to /opt/ # chown -R www-data:www-data /opt/NetUseAdminWeb/ create entry in apache configruation example: /etc/apache2/sites-enabled/default-ssl.conf SetHandler perl-script PerlResponseHandler Plack::Handler::Apache2 SetEnv DANCER_ENVIRONMENT "production" PerlSetVar psgi_app /opt/NetUseAdminWeb/bin/app.psgi RewriteEngine On RewriteBase / restart apache # systemctl restart apache2 10. make sure "/usr/bin/rnews" can be executed from perl web framework. (www-data user in case of apache2) If needed add user to proper group. Another option, run plackup as super user, listen in localhost, and use apache2 proxy to allow access form outside with ssl. 11. Test - You may send test message with usenet header (using -a) to test your system. please edit NetUseMod/web/NetUseAdminWeb/lib/NetUseAdminWeb.pm to avoid posting in usenet server. my $post_to_usenet = 0; $ echo "Test message." | mail -s "Test" -r SENDER_USER@EMAILHOST 'USENETMOD ' -a 'Newsgroups: YOUR_NEWSGROUP'