user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: Wang Kang <i@scateu.me>
Cc: meta@public-inbox.org, alpine-info@u.washington.edu,
	Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Subject: [PATCH] nntp: header responses use CRLF consistently
Date: Wed, 16 Jan 2019 04:58:02 +0000	[thread overview]
Message-ID: <20190116045802.ikm67b4cwigso3tc@dcvr> (raw)
In-Reply-To: <alpine.DEB.2.21.99.1901161043430.29788@la.scateu.me>

Thanks, I'm pretty sure the following will fix it.

Not sure why others hadn't noticed since there's a lot of Alpine
users judging from Message-IDs.  Anyways I managed to replicate it
quickly with alpine in Debian ("alpine -url news://...") and
strace quickly showed me the difference.

Deploying to news.public-inbox.org shortly.
Cc-ing Konstantin for kernel.org.

---------------8<-----------------
Subject: [PATCH] nntp: header responses use CRLF consistently

Alpine is apparently stricter than other clients I've tried
w.r.t. using CRLF for headers.  So do the same thing we do for
bodies to ensure we only emit CRLFs and no bare LFs.

Reported-by: Wang Kang <i@scateu.me>
  https://public-inbox.org/meta/alpine.DEB.2.21.99.1901161043430.29788@la.scateu.me/
---
 lib/PublicInbox/NNTP.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index 623ffd3..63d5870 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -515,6 +515,7 @@ sub set_art {
 sub _header ($) {
 	my $hdr = $_[0]->header_obj->as_string;
 	utf8::encode($hdr);
+	$hdr =~ s/(?<!\r)\n/\r\n/sg;
 	$hdr
 }
 
-- 
EW

  reply	other threads:[~2019-01-16  4:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16  2:54 NNTP served by public-inbox stalled in Alpine 2.21.99 Wang Kang
2019-01-16  4:58 ` Eric Wong [this message]
2019-01-18 21:04   ` [PATCH] nntp: header responses use CRLF consistently Konstantin Ryabitsev
2019-01-19  1:14     ` Wang Kang
2019-01-19  4:41       ` Konstantin Ryabitsev
2019-01-19  4:47         ` Wang Kang
2019-01-16  5:25 ` [Alpine-info] NNTP served by public-inbox stalled in Alpine 2.21.99 Wang Kang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190116045802.ikm67b4cwigso3tc@dcvr \
    --to=e@80x24.org \
    --cc=alpine-info@u.washington.edu \
    --cc=i@scateu.me \
    --cc=konstantin@linuxfoundation.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).