#! /usr/bin/perl
#================================================
# 2004 © Jeroen C. van Nieuwenhuizen
# $Revision: 1.1 $
# $Date: 2004/03/30 19:13:12 $
# $Author: jnieuwen $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the license, or 
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#================================================


use strict ;
use warnings ;

my $quotewrong = 0 ;
my $encountered = 0 ;
my $headers = 1;

while (my $line = <STDIN>) {
	$headers = 0 if ($line =~ /^$/) ;
	$quotewrong = 1 if ($headers && ($line =~ /^Subject:.*[Rr][Ee]:/)) ;
	$encountered = 1 if ((not $headers) && ($line =~ /^>/)) ;
	$quotewrong = 0 if ((not $headers) && $encountered && ($line =~ /^[ \w]+/));
}

exit(1) if ($quotewrong) ;
exit(0) unless ($quotewrong);

=head1 AUTHOR

Written by Jeroen van Nieuwenhuizen.

=head1 VERSION

$Revision: 1.1 $ $Date: 2004/03/30 19:13:12 $

$Source: /home/jnieuwen/cvsrepos/wrongquote/filter.pl,v $

=head1 REPORTING BUGS

Report bugs to <bugs@jeroen.se>

=head1 COPYRIGHT

Copyright (C) 2003 by Jeroen van Nieuwenhuizen. Distributed
under the GNU GPL. See the file "F<LICENSE>", supplied with the distribution
for additional information.

=cut

