about summary refs log tree commit homepage
path: root/t/nntpd.t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-10 07:05:02 +0000
committerEric Wong <e@yhbt.net>2020-06-13 07:55:45 +0000
commitcd389aac52936c82f3416b3ceefe21e1250b8a3e (patch)
treee68b068c3ec0d7aba3df80304fcb6cb398c1d589 /t/nntpd.t
parentf77b21173e730a3daa8f5eed6d73835a682b3f04 (diff)
downloadpublic-inbox-cd389aac52936c82f3416b3ceefe21e1250b8a3e.tar.gz
NNTP and IMAP both require CRLF conversions on the wire.
They're also the only components which care about
$smsg->{bytes}, so store the CRLF-adjusted value in over.sqlite3
and Xapian DBs..

This will allow us to optimize RFC822.SIZE fetch item in IMAP
without triggering size mismatch errors in some clients' default
configurations (e.g. Mail::IMAPClient), but not most others.

It could also fix hypothetical problems with NNTP clients that
report discrepancies between overview and article data.
Diffstat (limited to 't/nntpd.t')
-rw-r--r--t/nntpd.t5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/nntpd.t b/t/nntpd.t
index eee67ea6..d2f31323 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -73,7 +73,10 @@ EOF
                 my $list_id = $addr;
                 $list_id =~ s/@/./;
                 $mime->header_set('List-Id', "<$list_id>");
-                $len = length($mime->as_string);
+                my $str = $mime->as_string;
+                $str =~ s/(?<!\r)\n/\r\n/sg;
+                $len = length($str);
+                undef $str;
                 $im->add($mime);
                 $im->done;
                 if ($version == 1) {