🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.free.newsservers
Article #150005

Re: Newsgroup carry request for mixmin

#150005
From: Avatar
Date: Tue, 30 Apr 2013 06:06
317 lines
11713 bytes
Avatar wrote on Tue, 30 Apr 2013 05:52:06 +0000:

> I will write up a log file and append separately, but like all things
> that don't work until finally they work, the log file may be confusing.

Here's the log file of 'my' installation on Centos 6 of Mixmin 
working with Pan to post to alt.test. 

Stunnel is much harder to install than it should be, mostly because 
there are no decent Linux installation instructions extant. So, 
you end up downloading separate init scripts from bug reports; and
you end up guessing what the configuration file should contain.

Anyway, here's my log for setting up Stunnel on Centos for 
Mixmin, & Pan.

Install the Pan newsreader:
$ sudo yum --enablerepo rpmforge install pan -y

Test Pan by adding a newsserver (e.g., aioe):
[Pan]Edit->Edit News Servers->Add->(see below)->OK
     Address: aioe.org
     Port: 119

Test Pan by adding a user (e.g., foo@bar.com):
[Pan]Edit->Edit Posting Profiles->Add->
     Profile Name: New Profile
     Full Name: Foo Bar
     Email Address: foo@bar.com
     Post Articles Via: aioe.org
     OK

Test Pan setup by reading & sending a message to alt.test.
[Pan]Post->Post to Newsgroup->alt.test

That should immediately be successful (and always is).
Now attempt to set up the Mixmin newsserver, which requires stunnel:
     $ sudo yum install stunnel -y
     $ sudo cp /usr/share/doc/stunnel-4.29/stunnel.conf-sample \
       /etc/stunnel/stunnel.conf
     $ sudo vi  /etc/stunnel/stunnel.conf
                [nntp]
                accept = localhost:119
                connect = news.mixmin.net:563
       Note: When I used the following two lines, stunnel failed:
                setuid = nobody
                setgid = nobody
     $ sudo mkdir /var/log/stunnel
     $ sudo touch /var/log/stunnel/stunnel.log

Now comes the tricky part about setting up stunnel services

Download this stunnel daemon init script:
     http://bugzilla.redhat.com/attachment.cgi?id=325164 
Which came from this stunnel bug report (stunnel lacks an init script):
     https://bugzilla.redhat.com/show_bug.cgi?id=455815

I'm guessing at these installation instructions as there are none available:
     $ sudo cp /tmp/stunnel /etc/init.d/stunnel
     $ sudo chown root /etc/init.d/stunnel
     $ sudo chmod 755 /etc/init.d/stunnel

     $ sudo view /etc/init.d/stunnel
       I see that the following were called but none of these exist:
       /var/run/stunnel (directory)
       /var/run/stunnel/stunnel.pid (process-id file)
       /var/lock/subsys/stunnel (file)
       /usr/sbin/stunnel (executable)

So, I will manually create the /var/run/stunnel directory after
looking for expected ownership in the stunnel.conf file:
     $ grep set.id /etc/stunnel/stunnel.conf
     ==> setuid = nobody
     ==> setgid = nobody

I then made the stunnel directory and changed ownership to that owner:
     $ sudo mkdir /var/run/stunnel
     $ sudo chown nobody /var/run/stunnel
     $ ls -ld /var/run/stunnel

And I modified that init.d script to point to the stunnel executable
which was installed ing /usr/bin/stunnel by the yum command:
     $ which stunnel
       ==> /usr/bin/stunnel
     $ sudo vi /etc/init.d/stunnel
       Change the location of the stunnel execution:
FROM:
daemon --check $servicename '/usr/sbin/stunnel /etc/stunnel/stunnel.conf
&>/dev/null'
TO:
daemon --check $servicename '/usr/bin/stunnel /etc/stunnel/stunnel.conf
&>/dev/null'

As a doublecheck, the following directories & files are called out in the
(slightly modified) default configuration:
$ grep stunnel /etc/{stunnel/stunnel.conf,init.d/stunnel}
REPORTED the following files and directories are needed:
- chroot = /var/run/stunnel/
- output = /var/log/stunnel/stunnel.log
- servicename=stunnel
- processname=stunnel
- pidfile=/var/run/stunnel/stunnel.pid
- /usr/bin/stunnel
- /etc/stunnel/stunnel.conf

Since all of those exist at this point, I then re-tried the suggested command
but it failed this time:
$ su root
# cd /
# chkconfig -add stunnel
REPORTED:
-add: unknown option

Hmmm... Maybe it's already there?
# chkconfig|grep stunnel
REPORTS:
stunnel 0:off 1:off 2:off 3:on 4:on 5:on 6:off

I'll assume that indicates that this step above is no longer needed.
Moving onward, let's now start the stunnel service:
# service stunnel start
REPORTS:
Starting stunnel services: [ OK ]

$ /sbin/chkconfig --list | awk '{ print $1 }' | sort | grep stunnel
REPORTS (installed services):
stunnel

$ /sbin/chkconfig --list | grep :on | grep stunnel
REPORTS (services configured to run):
stunnel 0:off 1:off 2:off 3:on 4:on 5:on 6:off

$ for S in $(/sbin/chkconfig --list | awk '/:on/ { print $1 }' | sort); do
echo $S; /sbin/service $S status; echo; done | grep stunnel
REPORTS:
stunnel
stunnel (pid 2825) is running...

# service --status-all | grep stunnel
REPORTS:
stunnel (pid 2825) is running...

# netstat -tulpn | grep stunnel
REPORTS:
tcp 0 0 ::1:119 :::* LISTEN 2825/stunnel

# ntsysv
REPORTS: stunnel is automatically started.

$ telnet 127.0.0.1 119
REPORTS: 
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused

Repeat that command as folks have reported the second time works 
(mine didn't work no matter how many times I repeated it):
$ !!
$ !!
$ !!

Looking at my hosts file, I have:
$ head /etc/hosts
127.0.0.1 NAME localhost localhost.localdomain localhost4 localhost4.localdomain4

$ grep -i mixmin /etc/hosts
  REPORTS: nothing

$ netstat -antp | grep 119
REPORTS: 
  netstat -antp | grep 119
  (Not all processes could be identified, non-owned process info
   will not be shown, you would have to be root to see it all.)
  tcp 0 0 ::1:119 :::* LISTEN -                   

$ sudo netstat -antp | grep 119
REPORTS: 
  tcp 0 0 ::1:119 :::* LISTEN 2723/stunnel       

---- skipping over to Pan setup -----

[Pan]Edit->Edit News Servers->Add->(see below)->OK
     Address: news.mixmin.net
     Port: 563

[Pan]Edit->Edit News Servers->Add->(see below)->OK
     Address: localhost
     Port: 119

Then refresh groups:
[Pan]Groups->Refresh Group List

Then try to post to alt.test using the Mixmin news server:
Test Pan setup by reading & sending a message to alt.test.
[Pan]Post->Post to Newsgroup->alt.test

The error will always be:
  There were problems with this post.
  Warning: The posting profile's server doesn't carry newsgroup alt.test.

At this point, I have no error message.
So, seeking an error message, I look at the log file:

$ sudo tail -f /var/log/stunnel/stunnel.log
: Created pid file /stunnel.pid
: nntp accepted FD=13 from ::1:47349
: nntp started
: FD 13 in non-blocking mode
: TCP_NODELAY option set on local socket
: Waiting for a libwrap process
: Acquired libwrap process #0
: Releasing libwrap process #0
: Released libwrap process #0
: nntp permitted by libwrap from ::1:47349
: nntp accepted connection from ::1:47349
: Error resolving 'news.mixmin.net': 
  Neither nodename nor servname known (EAI_NONAME)
: No host resolved
: Connection reset: 0 bytes sent to SSL, 0 bytes sent to socket
: nntp finished (0 left)

The first error says stunnel can't resolve news.mixmin.net.

I test if my DNS server can resolve it, and it can:

$ ping news.mixmin.net
PING news.mixmin.net (188.40.76.149) 56(84) bytes of data.
64 bytes from snorky.mixmin.net (188.40.76.149): icmp_seq=1 ttl=47 time=175 ms
64 bytes from snorky.mixmin.net (188.40.76.149): icmp_seq=2 ttl=47 time=193 ms
64 bytes from snorky.mixmin.net (188.40.76.149): icmp_seq=3 ttl=47 time=184 ms

$ openssl s_client -connect news.mixmin.net:563
  REPORTS: 
   CONNECTED(00000003)
   ... stuff ... 
   200 news.mixmin.net InterNetNews NNRP server INN 2.6.0 (20120622 prerelease)
   ready (posting ok)
post
   340 Ok, recommended message-ID <krr5gb$mbf$1@news.mixmin.net>
From: foo <foo@bar.com>
Newsgroups: alt.test
Subject: test

Test?
..
   240 Article received <krr5gb$mbf$1@news.mixmin.net>
quit
   205 Bye!
closed

At this point I decided to minimize my stunnel.conf file to the following:

$ cat /etc/stunnel/stunnel.conf
REPORTS:
client = yes
[nntp]
accept = localhost:2119
connect = news.mixmin.net:563

To test using Telnet, try this first:
$ telnet news.mixmin.net 119
  Trying 188.40.76.149...
  Connected to news.mixmin.net.
  Escape character is '^]'.
  200 news.mixmin.net InterNetNews NNRP server INN 2.6.0 (20120622 prerelease)
  ready (posting ok)
quit
  205 Bye!
  Connection closed by foreign host.

If that works, try this:
$ telnet localhost 2119 <== use whatever port you used in stunnel.conf
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  200 news.mixmin.net InterNetNews NNRP server INN 2.6.0 (20120622 prerelease)
  ready (posting ok)
quit
  205 Bye!
  Connection closed by foreign host.

If that worked, then you can create an actual post:
$ telnet localhost 2119 
  Trying ::1...
  telnet: connect to address ::1: Connection refused
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  200 news.mixmin.net InterNetNews NNRP server INN 2.6.0 (20120622 prerelease)
  ready (posting ok)
post
  340 Ok, recommended message-ID <knlm4l$e57$1@news.mixmin.net>
From: foo <foo@bar.com>
Newsgroups: alt.test
Subject: This is a test
  
This is a test of stunnel to mixmin.
..
240 Article received <knlm4l$e57$1@news.mixmin.net>
quit
205 Bye!
Connection closed by foreign host.

---- skipping back to Pan setup -----

[Pan]Edit->Edit News Servers->Add->(see below)->OK
     Address: localhost
     Port: 2119

Then refresh groups:
[Pan]Groups->Refresh Group List

Test Pan setup by reading & sending a message to alt.test.
[Pan]Post->Post to Newsgroup->alt.test

This finally worked for me at this point!
Woo hoo!
Technical Details
Message-ID: <klnn1b$ueg$3@news.albasani.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mail
References: <kleu04$heo$1@news.mixmin.net> <slrnknn6d6.1im.steve@snorky.mixmin.net> <klged6$bh$1@news.albasani.net> <slrnkno950.1im.steve@snorky.mixmin.net> <klk32a$3l3$2@news.albasani.net> <klk45b$3l3$4@news.albasani.net> <klkack$dav$2@dont-email.me> <klkpii$eiv$1@news.albasani.net> <klkr5s$c5v$1@dont-email.me> <klksg8$eiv$3@news.albasani.net> <slrnknsfjc.1im.steve@snorky.mixmin.net> <klnm66$ueg$1@news.albasani.net>

Show Full Headers
Complete Article Headers
Message-ID: <klnn1b$ueg$3@news.albasani.net>
Subject: Re: Newsgroup carry request for mixmin
Date: Tue, 30 Apr 2013 06:06:35 +0000
From: Avatar <Avatar@hbgyisasesaew.com>
References: <kleu04$heo$1@news.mixmin.net> <slrnknn6d6.1im.steve@snorky.mixmin.net> <klged6$bh$1@news.albasani.net> <slrnkno950.1im.steve@snorky.mixmin.net> <klk32a$3l3$2@news.albasani.net> <klk45b$3l3$4@news.albasani.net> <klkack$dav$2@dont-email.me> <klkpii$eiv$1@news.albasani.net> <klkr5s$c5v$1@dont-email.me> <klksg8$eiv$3@news.albasani.net> <slrnknsfjc.1im.steve@snorky.mixmin.net> <klnm66$ueg$1@news.albasani.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.albasani.net!.POSTED!not-for-mail
Newsgroups: alt.free.newsservers
Organization: albasani.net
Lines: 317
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.albasani.net
 Z+5TFPrMCT4C6vZIKbjbCdUbV73MoWc/l294xSwY3XrO2A5+wzeq/YlY79fFCCiqHRZORRjSIA7mCN5OoOuki0DHEVrDi0Pfff/RFLCFM8BjihQI4YQ1IZXqUPNkpBzc
NNTP-Posting-Date: Tue, 30 Apr 2013 06:06:35 +0000 (UTC)
Injection-Info: news.albasani.net;
 logging-data="JQX0k9TATwOQ151tKJ5kxEqCeSQHO7O35EKmdJeyOzPGbEu2ixxRwu8wB65bymMrPX6zjS/8DX6ZLxavaKXZvGynm3lV6DaBvAX3oNNaEnyNhtu/IlIfYzU7WlntTqa8";
 mail-complaints-to="abuse@albasani.net"
Cancel-Lock: sha1:aVxT63nFy6t9Eke3zvePwb8OAsg=
X-Original-Bytes: 11443