X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?a=blobdiff_plain;f=stump%2Fbin%2Fsubmission.pl;h=c5d00686c5d4d1b1bff6559e7199bfb10bcc2c01;hb=93903c0563cc38afba5a9930ef634e5d4499b6d6;hp=fa98e930f7b3abc5978bf787126b72686b438585;hpb=d947dfebe7c73756167b34ba79938db860680bec;p=modbot-ulm.git diff --git a/stump/bin/submission.pl b/stump/bin/submission.pl index fa98e93..c5d0068 100755 --- a/stump/bin/submission.pl +++ b/stump/bin/submission.pl @@ -345,9 +345,11 @@ sub readMessage { if (!m/^(?:References):/i) { push @unfolded, (m/^[^:]+:/ ? $& : '????') if s/\n(?=.)//g; - if (length $_ > 505) { #wtf - $_ = substr($_, 0, 500); - $_ =~ s/\n?$/\n/; + my $maxlen = 510; + if (length $_ > $maxlen+1) { # $maxlen plus one \n + chomp; + $_ = substr($_, 0, $maxlen); + $_ .= "\n"; $readahead = $_; m/^[0-9a-z-]+/i; $_ = $warning->("Next header ($&) truncated!");