Handle a few more input line types; quote other From lines.

This commit is contained in:
Bradley M. Kuhn 2013-08-25 12:48:31 -04:00
parent 3ac906d197
commit cb10a4bf39

View file

@ -22,10 +22,13 @@ use strict;
use warnings; use warnings;
while (<>) { while (<>) {
if (/^From\s+(\S+)\s+at\s+(\S+)\s+(.+)$/) { if (/^From\s+(\S+)(?:\s+at\s+|\@)(\S+)\s+(.+)$/) {
print "From ${1}\@${2} ${3}\n"; print "From ${1}\@${2} ${3}\n";
} elsif (/^From\s+=\?ISO\S+\s+(Mon|Tue|Wed|Thu|Fri|Sat|Sun)/) {
print $_;
} elsif (/^From\s+/) { } elsif (/^From\s+/) {
die "invalid from line $_"; warn "just quoting line $_";
print ">$_";
} else { } else {
print $_; print $_;
} }