[Mimedefang] Block specified mime type

Myth Guy mythhtpc at gmail.com
Fri Dec 14 10:47:26 EST 2012


Zoltan, look at the suggested-minimum-filter-for-windows-clients
sample filter.  To detect the MIME type of the file you can look at
File::MMagic.  Something like (not tested):

sub detect_filetype ($)
{
  my $mm = File::MMagic->new('path_to_magic_file');
  $res = $mm->checktype_filename($_);
  return($res);
}


On Fri, Dec 14, 2012 at 4:04 PM, Zoltán Gyula Beck <beckzg at gmail.com> wrote:
> Dear list members,
>
>   I apologize in advance as I am a mimdefang newbie, I tried to search
> in archive but I didn't found the right answer for me. What I need is
> a very minimal mimedefang config file (no spamassassin check), to
> block/remove (remove the attachement but the mail is passed with a
> notification, that the <file.ext> was removed and contanct the sender
> if you really need that file) some type of attachements, .exe, .bat,
> etc ... I tried with $bad_exts but if I rename an .exe to .pdf then
> mimedefang passes. Is there a way to check the file type and not only
> the extension?
>
>   Best Regards,
> bzg
> _______________________________________________
> NOTE: If there is a disclaimer or other legal boilerplate in the above
> message, it is NULL AND VOID.  You may ignore it.
>
> Visit http://www.mimedefang.org and http://www.roaringpenguin.com
> MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang



More information about the MIMEDefang mailing list