cdpxe / WendzelNNTPd

A usable and IPv6-ready Usenet-server (NNTP daemon). It is portable (Linux/*BSD/*nix), supports AUTHINFO authentication, TLS (SNNTP/NNTPS), contains ACL as well as role based ACL and provides "invisible" newsgroups. It can run on MySQL and SQLite backends.
https://cdpxe.github.io/WendzelNNTPd/
Other
58 stars 8 forks source link

Problem with ClawsMail #3

Closed pintman closed 8 years ago

pintman commented 8 years ago

When I try to fetch articles with ClawsMail from the server I get the following error message. Server albasani.net works without any problems. Maybe the Libetpan message gives a hint on the problem. The problem occurs in the Windows and Linux version of claws mail.

Didn't find any bug related to this in the Claws bugtracker. http://www.thewildbeast.co.uk/claws-mail/bugzilla/buglist.cgi?product=Claws%20Mail&component=NNTP&resolution=---

* Konto 'Konto3': Verbinde mit NNTP-Server: news.XXXXX.de:119...
[00:32:13] NNTP< 200 WendzelNNTPd-OSE (Open Source Edition) 2.0.5 'Auckland'  - (Sep 26 2015 06:42:09 #2517) ready (posting ok). 
[00:32:13] NNTP> MODE READER 
[00:32:13] NNTP< 480 authentication required. 
*** Libetpan unterstützt Statusmeldung 480 nicht, also machen wir erstmal weiter
[00:32:13] NNTP< Authentication accepted.
[00:32:13] NNTP> LIST 
[00:32:13] NNTP< [data - 366 bytes]
[00:32:20] NNTP> GROUP de.tbs1.ita15a.Allgemein 
[00:32:20] NNTP< 211 9 1 9 de.tbs1.ita15a.Allgemein group selected 
[00:32:20] NNTP> GROUP de.tbs1.ita15a.Allgemein 
[00:32:20] NNTP< 211 9 1 9 de.tbs1.ita15a.Allgemein group selected 
* Newsübersicht wird geholt: 1 - 9 in de.tbs1.ita15a.Allgemein...
[00:32:20] NNTP> XOVER 1-9 
[00:32:20] NNTP< [data - 1426 bytes]
[00:32:20] NNTP> XHDR newsgroups 1-9 
[00:32:20] NNTP< [data - 275 bytes]
[00:32:20] NNTP> XHDR to 1-9 
[00:32:20] NNTP< 211 Header follows 
[00:32:20] NNTP< . 
** XHDR nicht abrufbar
[00:32:22] NNTP> ARTICLE 1 
[00:32:34] NNTP> DATE 
[00:32:34] NNTP< 111 20151008073236 
cdpxe commented 8 years ago

Do you see any syslog messages from WendzelNNTPd? Try sudo grep -r wendzelnntpd /var/log/*

pintman commented 8 years ago

Just ordinary connection information. I will give the last lines. The X's in the IP addresses are edited by me.

/var/log/syslog.1:Oct  8 02:16:24 cubietruck wendzelnntpd: src/server.c:1517: Closed connection from 37.201.XXX.XXX
/var/log/syslog.1:Oct  8 02:16:24 cubietruck wendzelnntpd: src/server.c:1517: Closed connection from 37.201.XXX.XXX
/var/log/syslog.1:Oct  8 03:30:42 cubietruck wendzelnntpd: src/main.c:173: Accepted connection from 37.201.XXX.XXX
/var/log/syslog.1:Oct  8 03:30:42 cubietruck wendzelnntpd: src/main.c:173: Accepted connection from 37.201.XXX.XXX
/var/log/syslog.1:Oct  8 03:30:42 cubietruck wendzelnntpd: src/server.c:280: Authentication accepted for user ita15a from IP 37.201.XXX.XXX
/var/log/syslog.1:Oct  8 03:30:42 cubietruck wendzelnntpd: src/server.c:280: Authentication accepted for user ita15a from IP 37.201.XXX.XXX
/var/log/syslog.1:Oct  8 03:31:05 cubietruck wendzelnntpd: src/server.c:1517: Closed connection from 37.201.XXX.XXX
/var/log/wendzelnntpd:Sat, 26 Sep 15 06:58:19 src/database.c:106:get_uniqnum: File permissions of /var/spool/news/wendzelnntpd/nextmsgid are insecure and/or file is a symlink!

The last line talks about nextmsgid which has the following attributes:

-rw------- 1 root root       8 Oct  7 14:54 nextmsgid

Seems strange that it should be insecure.

cdpxe commented 8 years ago

Thanks. Do you use the SQLite or MySQL backend? Does the problem also occur if authentication is not activated? I will try to reproduce the problem with claws-mail myself.

pintman commented 8 years ago

Do you use the SQLite or MySQL backend?

sqlite

Does the problem also occur if authentication is not activated?

No without permission control there are no problems. I am using auth and acl. My password uses upper and lowercase letters and is 17 Characters long.

cdpxe commented 8 years ago

So far, with claws-mail I get:

[12:43:58] NNTP> GROUP test.zwei 
[12:43:58] NNTP< 211 3 1 3 test.zwei group selected 
* Newsübersicht wird geholt: 1 - 3 in test.zwei...
[12:43:58] NNTP> XOVER 1-3 
[12:43:58] NNTP< [data - 412 bytes]
[12:43:58] NNTP> XHDR newsgroups 1-3 
[12:43:58] NNTP< 221 Header follows 
[12:43:58] NNTP< 1 test.zwei 
[12:43:58] NNTP< 2 test.zwei 
[12:43:58] NNTP< 3 test.zwei 
[12:43:58] NNTP< . 
[12:43:58] NNTP> XHDR to 1-3 
[12:43:58] NNTP< 211 Header follows 
[12:43:58] NNTP< . 
** XHDR nicht abrufbar
[12:44:00] NNTP> ARTICLE 1 
[12:44:00] NNTP> ARTICLE 2 
[12:44:00] NNTP< [data - 979 bytes]
[12:44:01] NNTP> ARTICLE 3 
[12:44:02] NNTP> ARTICLE 1 
[12:44:02] NNTP< [data - 981 bytes]
[12:44:26] NNTP> DATE 
** NNTP-Verbindung zu 127.0.0.1:119 wurde unterbrochen.

So, claws-mail says that XHDR does not work. I tried to reproduce:

group test.zwei
211 6 1 6 test.zwei group selected
xover 4-6
224 overview information follows
4   posting1    Steffen Wendzel <steffen.wendzel@swendzel-ThinkPad-T440p>   Thu, 08 Oct 15 12:47:26 +0200   <cdp21@localhost>       422 1    
5   posting2    Steffen Wendzel <steffen.wendzel@swendzel-ThinkPad-T440p>   Thu, 08 Oct 15 12:47:30 +0200   <cdp22@localhost>       422 1    
6   posting3    Steffen Wendzel <steffen.wendzel@swendzel-ThinkPad-T440p>   Thu, 08 Oct 15 12:47:34 +0200   <cdp23@localhost>       422 1    
.
xhdr newsgroups 4-6
221 Header follows
4 test.zwei
5 test.zwei
6 test.zwei
.

This means, it works fine if I do this via telnet myself but the problem lies in the `to' field used by claws-mail:

xhdr to 4-6 
211 Header follows
.

I will investigate and let you know...

pintman commented 8 years ago

Thanks for your support. It's strange that the problem disappears when auth is turned off.

cdpxe commented 8 years ago

So far, I can tell that "to" is not implemented by my xhdr function. "To" is also not mentioned as required by RFC 1036. In addition, sylpheed does not use "To" in header fields itself ... IMHO, everything should work without "to".

RFC 2980 says:

Some implementations will return "(none)" followed by a period on a
   line by itself if no headers match in any of the articles searched.
   Others return the 221 response code followed by a period on a line by
   itself.

WendzelNNTPd returns "221 Header follows\r\n.\r\n" but claws-mail cannot handle it.

It works in claws-mail if I click on another message and then again on the message that was shown to cotnain an error. Reason: claws-mail runs ARTICLE n (which works).

I am currently unsure how to proceed here.

cdpxe commented 8 years ago

PS. Problem appears independently of the fact whether the server is configured with or without auth/acl in my case.

cdpxe commented 8 years ago

I spotted the error. Fix will be ready within a few hours.

cdpxe commented 8 years ago

Okay, now it seems to work. I just committed the new version to git. Can you please check whether it work now? The wrong response code (211 instead of 221) was replied!

Here is my claws-mail output now:

[13:12:57] NNTP> XHDR to 12-13 
[13:12:57] NNTP< 221 Header follows 
[13:12:57] NNTP< . 
[13:12:57] NNTP> XHDR cc 12-13 
[13:12:57] NNTP< 221 Header follows 
[13:12:57] NNTP< . 
pintman commented 8 years ago

Works for me. Tried the old version -> didn't work. used 'sudo make upgrade' to upgrade. Now it works with claws-mail. Checked it for Thunderbird as well. With and without auth.

Thanks for your fast support. :)

cdpxe commented 8 years ago

Thanks for confirming!