diff options
author | Eric Wong <e@80x24.org> | 2015-09-22 10:09:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-09-22 22:12:17 +0000 |
commit | 10d537f2e8eac6b25b45f1cbf4e6f85786356b32 (patch) | |
tree | 24c9bbbd3967a08e37fc0833b8fe885201804520 /lib/PublicInbox/NNTP.pm | |
parent | 01af7ca10ae9a33248f18be92e3251d08b94d7fb (diff) | |
download | public-inbox-10d537f2e8eac6b25b45f1cbf4e6f85786356b32.tar.gz |
It's common for mail bodies to end with LF-only, so end them with CRLF to avoid triggering errors in clients.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index bc8d6eda..71b774d2 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -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; '.' } |