]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NNTP.pm
watchmaildir: support multiple watchheader values
[public-inbox.git] / lib / PublicInbox / NNTP.pm
index 39e2f88e5135d4e9bb08ed65e1a54b96a722c6f2..c79f198beb186f00c441d31e1ca122cad77a58eb 100644 (file)
@@ -76,7 +76,7 @@ sub args_ok ($$) {
 # returns 1 if we can continue, 0 if not due to buffered writes or disconnect
 sub process_line ($$) {
        my ($self, $l) = @_;
-       my ($req, @args) = split(/[ \t]/, $l);
+       my ($req, @args) = split(/[ \t]+/, $l);
        return 1 unless defined($req); # skip blank line
        $req = $self->can('cmd_'.lc($req));
        return res($self, '500 command not recognized') unless $req;
@@ -506,6 +506,8 @@ sub set_art {
 sub msg_hdr_write ($$$) {
        my ($self, $hdr, $body_follows) = @_;
        $hdr = $hdr->as_string;
+       # fixup old bug from import (pre-a0c07cba0e5d8b6a)
+       $hdr =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
        utf8::encode($hdr);
        $hdr =~ s/(?<!\r)\n/\r\n/sg; # Alpine barfs without this