My current version has:
while ( $line = $txn->body_getline ) {
chomp($line);
if ( $line =~ /(.*)=$/ ) {
push @qp_continuations, $1;
next;
} elsif ( @qp_continuations ) {
$line = join '', @qp_continuations, $line;
@qp_continuations = ();
}
$self->find_uris($line);
}
So as if the if statement is not met, all previous lines are concatenated
with the current line to make the line that should have been there all
along.
So I think we are on the same page with that one - to be honest my perl is
so-so.. I write mostly in PHP and bash.
--
Ed McLain
Director of Data Center Operations
TekLinks Managed Services Group
p. 205.314.6646
e. [email protected]
Please direct all support questions to our customer support team
available at 205.314.6634 or [email protected]
-----Original Message-----
From: Jared Johnson <[email protected]>
Date: Mon, 24 Jan 2011 15:31:39 -0600
To: Edward McLain <[email protected]>
Cc: qpsmtpd <[email protected]>
Subject: Re: lastest uribl plugin
>Specifically regarding the quoted-printable stuff.. my diff must have been
>off an older version. This is probably a better representation of your
>changes:
>
>@@ -574,15 +574,22 @@
> my $line;
> my @qp_continuations;
> while ( $line = $txn->body_getline ) {
>+ chomp $line;
> if ( $line =~ /(.*)=$/ ) {
> push @qp_continuations, $1;
> next;
> } elsif ( @qp_continuations ) {
>- $line = join '', @qp_continuations, $line;
>+ $line = join '', @qp_continuations, $1;
> @qp_continuations = ();
> }
> $self->find_uris($line);
> }
>+ if ( @qp_continuations ) {
>+ $self->log(LOGINFO, "uribl: WARNING: scan_body exiting with line
>continuations left. Bad Email?");
>+ $line = join('', @qp_continuations, $line);
>+ @qp_continuations = ();
>+ $self->find_uris($line);
>+ }
> }
>
>The first and last change should certainly go in, but what about this:
>
>
> if ( $line =~ /(.*)=$/ ) {
> push @qp_continuations, $1;
> next;
> } elsif ( @qp_continuations ) {
>- $line = join '', @qp_continuations, $line;
>+ $line = join '', @qp_continuations, $1;
> @qp_continuations = ();
> }
>
>Won't $1 only be defined when the condition in the 'if' is met, thus
>making your change equivalent to:
>
>$line = join '', $qp_continuations;
>
>I'm not sure but it seems like that change doesn't belong..
>
>-Jared
>