X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXMsg.pm;h=04239f16b6777581ade86c2cb0f036f087d1f42b;hb=66581498212e2d0643c50369b1f39b85d7dc4dce;hp=677888f850948c490c9be43ebbc34abd7e30e49c;hpb=7b1010bb900623f75ee7339ac52faa2a182f2ff1;p=spider.git diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 677888f8..04239f16 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -282,7 +282,7 @@ sub process # does an identical message already exist? my $m; for $m (@msg) { - if ($ref->{subject} eq $m->{subject} && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) { + if (substr($ref->{subject},0,28) eq substr($m->{subject},0,28) && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) { $ref->stop_msg($fromnode); my $msgno = $m->{msgno}; dbg("duplicate message from $ref->{from} -> $ref->{to} to msg: $msgno") if isdbg('msg'); @@ -1325,7 +1325,18 @@ sub import_one } else { push @chunk, $ref; } - + + # does an identical message already exist? + my $m; + for $m (@msg) { + if (substr($subject,0,28) eq substr($m->{subject},0,28) && $from eq $m->{from} && grep $m->{to} eq $_, @to) { + my $msgno = $m->{msgno}; + dbg("duplicate message from $from -> $m->{to} to msg: $msgno") if isdbg('msg'); + Log('msg', "duplicate message from $from -> $m->{to} to msg: $msgno"); + return; + } + } + # write all the messages away my $i; for ( $i = 0; $i < @chunk; $i++) {