> > --------------030204020505030202030005 > > Content-Type: text/plain; > > name="clamav.pm" > > Content-Transfer-Encoding: 7bit > > Content-Disposition: inline; > > filename="clamav.pm" > > > > package ClamAV; > > use strict; > > use Mail::SpamAssassin; > > use Mail::SpamAssassin::Plugin; > > use File::Scan::ClamAV; > > our @ISA = qw(Mail::SpamAssassin::Plugin); > > > > sub new { > > my ($class, $mailsa) = @_; > > $class = ref($class) || $class; > > my $self = $class->SUPER::new($mailsa); > > bless ($self, $class); > > $self->register_eval_rule ("check_clamav"); > > return $self; > > } > > > > sub check_clamav { > > my ($self, $permsgstatus, $fulltext) = @_; > > my $av = new File::Scan::ClamAV(port => 3310); > > my ($code, $virus) = $av->streamscan(${$fulltext}); > > if(!$code) { > > my $errstr = $av->errstr(); > > Mail::SpamAssassin::Plugin::dbg("ClamAV: Error scanning: $errstr"); > > $permsgstatus->{main}->{conf}->{headers_spam}->{"Virus"} = "Error > > ($errstr)"; > > $permsgstatus->{main}->{conf}->{headers_ham}->{"Virus"} = "Error > > ($errstr)"; > > } elsif($code eq 'OK') { > > Mail::SpamAssassin::Plugin::dbg("ClamAV: No virus detected"); > > $permsgstatus->{main}->{conf}->{headers_spam}->{"Virus"} = "No"; > > $permsgstatus->{main}->{conf}->{headers_ham}->{"Virus"} = "No"; > > } elsif($code eq 'FOUND') { > > Mail::SpamAssassin::Plugin::dbg("ClamAV: Detected virus: $virus"); > > $permsgstatus->{main}->{conf}->{headers_spam}->{"Virus"} = "Yes > > ($virus)"; > > $permsgstatus->{main}->{conf}->{headers_ham}->{"Virus"} = "Yes > > ($virus)"; > > return 1; > > } > > return 0; > > } > > > > 1; > > > > --------------030204020505030202030005--
Could the plugin on the page: http://wiki.apache.org/spamassassin/ClamAVPlugin have some sort of version number/date attached so we could easily know what version we are talking about on the list, and if additions mentioned on the list have been incorporated? Is the plugin mentioned above a direct replacement for clamav.pm from the wiki? Daryl - I think this version of the code is yours if it is a direct replacemtn for the version on the wiki would you like to replace it there? Shall I? I know hardly anything about perl so I don't know the common ways to notate versions or author history in files like this. Cameron .:. -- Cameron Bales .:. www.bales.ca [EMAIL PROTECTED] [EMAIL PROTECTED]