[Mimedefang] action_drop_with_warning called outside of filter context

saqariden saad.aqariden at ac-montpellier.fr
Wed Feb 21 10:13:02 EST 2018


Hello,

We are running mimedefang with Spamassassin and Clamav to secure our
mailling server.
but actually, i have a probleme with mimedefang-filter. the following
error appear when a virus is detected:

mimedefang.pl[10245]: w1K87JOB027594: Detected virus
PUA.Win.Trojan.EmbeddedPDF-1
mimedefang.pl[10245]: w1K87JOB027594: action_drop_with_warning called
outside of filter context

then the attachment was not dropped.
here is my filter:

sub filter_begin {
     my($entity) = @_;
     if ($SuspiciousCharsInHeaders) {
         md_graphdefang_log('suspicious_chars');
         return action_discard();
     }
     md_copy_orig_msg_to_work_dir_as_mbox_file();

     # Scan for viruses if any virus-scanners are installed
     my($code, $category, $action) = message_contains_virus();

     # Lower level of paranoia - only looks for actual viruses
     $FoundVirus = ($category eq "virus");

     # Higher level of paranoia - takes care of "suspicious" objects
     # $FoundVirus = ($action eq "quarantine");

     if ($FoundVirus) {
         md_graphdefang_log('virus', $VirusName, $RelayAddr);

         md_syslog('warning', "Detected virus $VirusName");
         return action_drop_with_warning("An attachment of type $type,
named $fname was removed from this document as it\nconstituted$
     }

the action discard work correctly but it's not what i'm looking for, i
want to drop just the infected file and make a warning on the email,
Please, how can i correct this? thank you.




More information about the MIMEDefang mailing list