X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~webstump/git?a=blobdiff_plain;f=stump%2Fbin%2Fsubmission.pl;fp=stump%2Fbin%2Fsubmission.pl;h=cb12a290cdcad7ce92c1b0838dabb8e3be1a0675;hb=28a70b472bb9756bdae63782ffc12fc610dd4094;hp=e1ca10453f51086bfa6110c787f2da878ec66e66;hpb=e19ce96dd7720dcf2b56f069eb0f4ef6b1b19d69;p=modbot-urcm.git diff --git a/stump/bin/submission.pl b/stump/bin/submission.pl index e1ca104..cb12a29 100755 --- a/stump/bin/submission.pl +++ b/stump/bin/submission.pl @@ -351,9 +351,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!");