[Dovecot] Filtering attachements ?
Hello again
Is there a way to filter some attachments with dovecot ?
I don't want my users to keep video files in the IMAP folders anymore ( disk is almost full ) .
Thank you.
Timo Sirainen put forth on 3/12/2011 7:13 AM:
On Tue, 2011-03-08 at 17:42 +0100, Frank Bonnet wrote:
Is there a way to filter some attachments with dovecot ?
I think there are some generic IMAP tools for that..
What kind of attachments? Viruses or just annoying things like .vbs, .bat, stuff that a/v programs don't reject? Do you want to reject the emails or strip the attachment off and delivery the email? You can reject emails that contain arbitrary attachments easily with standard Postfix, for example:
/etc/postfix/main.cf ... mime_header_checks = pcre:/etc/postfix/mime_header_checks ...
/etc/postfix/mime_header_checks # Reject email containing unwanted attachments
/name=\"(.*)\.(386|bat|chm|cpl|cmd|com|do|exe|hta|jse|lnk|msi|ole)\"$/ REJECT Unwanted attachment $1.$2 /name=\"(.*)\.(pif|reg|rm|scr|shb|shm|shs|sys|vbe|vbs|vxd|xl|xsl)\"$/ REJECT Unwanted attachment $1.$2
You may also use any access table action instead of REJECT, such as DISCARD, WARN, etc. You could even pipe an offending message to an external content filter when one of these attachments is found, using the FILTER action and have the external daemon strip the attachment.
-- Stan
On Tue, 08 Mar 2011 17:42:32 +0100, Frank Bonnet <f.bonnet@esiee.fr> wrote:
Is there a way to filter some attachments with dovecot ?
These are generic:
altermime (very easy to setup, low resource usage, may be used as a pipe filter: /usr/bin/altermime --removeall /path/to/email/10, poorly documented: but 'man altermime' will be most of what you need)
mimedefang (more complex setup, resources hungry: cpu and memory intensive, more powerful at manipulating the extracted attachments)
M.
participants (4)
-
Frank Bonnet
-
Mark Alan
-
Stan Hoeppner
-
Timo Sirainen