dotfiles/mutt/killsig
Frank Villaro-Dixon 94acb5229f mutt config files
2013-07-31 16:03:11 +02:00

23 lines
453 B
Perl
Executable file

#!/usr/bin/perl
#
# killsig: delete signature (also "oe-sigs") when quoting emails.
# known patterns: ">-- " , "> -- ", ">--", "> --".
#
# Michael Velten <michael@michnet.de>
open(MAIL, "+<$ARGV[0]") || die "$0: Can't open $ARGV[0]: $!";
while (<MAIL>) {
unless (/^> ?-- ?$/) {
push(@purged, $_);
}
else {
while (<MAIL>) {
push(@purged, $_) unless /^>.+/;
}
}
}
truncate(MAIL, 0);
seek(MAIL,0,0);
print MAIL @purged;
close(MAIL);