]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NNTP.pm
nntp: ensure body lines end with CRLF
[public-inbox.git] / lib / PublicInbox / NNTP.pm
index bc8d6eda63b972b781ce2e05b897e4c38be294a8..71b774d224bc03396e2ec582448fb6cddac36e76 100644 (file)
@@ -393,7 +393,9 @@ sub simple_body_write ($$) {
        my $body = $s->body;
        $s->body_set('');
        $body =~ s/^\./../smg;
+       $body =~ s/(?<!\r)\n/\r\n/sg;
        do_more($self, $body);
+       do_more($self, "\r\n") unless $body =~ /\r\n\z/s;
        '.'
 }