Open filieski opened 6 years ago
@filieski Thanks for reporting! Could you provide what Ruby and Discourse versions you’re running?
Discourse: v2.2.0.beta3 +4
Ruby: $ ruby -v ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
Cyrus NNTPd: 2.5.10-3
Thank you! Just dug through the Cyrus source and NNTP RFC.
The “Bad date/time” error is coming as a response from the Cyrus server, due to this plugin sending an unknown value for the time zone (000000
instead of GMT
or no value at all) to the NEWNEWS command.
Could you try changing this line in server.rb?
nntp.newnews(wildmat, '19700101', '000000')[1].uniq.map{ |message_id| message_id[1..-2] }
To
nntp.newnews(wildmat, '19700101', 'GMT')[1].uniq.map{ |message_id| message_id[1..-2] }
(If that doesn’t work, try the empty string, or omit the third argument to nntp.newnews
)
Reference: https://github.com/cyrusimap/cyrus-imapd/blob/master/imap/nntpd.c https://tools.ietf.org/html/rfc3977#section-7.3
Actually according to the RFC and the Cyrus code, I should replace it to
nntp.newnews(wildmat, '19700101', '000000 GMT')[1].uniq.map{ |message_id| message_id[1..-2] }
Now it seems like it's working but I still don't get messages. I dumped the network traffic on port 119 and I get the following:
NEWNEWS shared.zTest.uncateg 19700101 000000 GMT
230 List of new articles follows:
.
Which might be an issue on my end. I haven't tested enough. Thanks for proposed fix. I am still testing and I will let you know soon.
@filieski Did you end up with a fix here?
I am not able to get this plugin to work with Cyrus. First, I had an issue where the 'rake discourse_nntp_bridge:assign_newsgroups' would not recognize newsgroups (cyrus shared folders). I figured that it's because Cyrus is case sensitive so I had to remove the .downcase off of this line
The next error I get is "Job exception: Bad date/time". I found no discrepancy between the date and time of the Cyrus and Discourse servers. Here's the full backtrace from Discourses /logs
Did anyone get this plugin working with Cyrus?