Attach filter virus

I need to be able to deploy this mail filter -> https://support.google.com/mail/answer/6590?p=BlockedMessage&visit_id=1-...

Messages with attachments As a precautionary measure against possible virus attacks, Gmail does not allow you to attach these file types:

The file types that are specified below, even if they are compressed (in .GZ or .BZ2 files, for example) or stored inside others (.ZIP or .TGZ, for example). Documents containing malicious macros. Files whose contents are password protected. Files that contain a password-protected file. Note: If you try to attach a document that is too large, the message will not be sent. Learn more about attachments and maximum sizes allowed.

File types that can not be attached to messages .ADE, .ADP, .BAT, .CHM, .CMD, .COM, .CPL, .EXE, .HTA, .INS, .ISP, .JAR, .JSE, .LIB, .LNK, .MDE, .MSC, .MSP, .MST, .PIF, .SCR, .SCT, .SHB, .SYS, .VB, .VBE, .VBS, .VXD, .WSC, .WSF y .WSH

if I do not do my domains and therefore my server with virtualmin will be stopped and migrated to Google or Microsoft,

How can I do it?

Status: 
Active

Comments

Howdy -- Virtualmin doesn't provide any built-in methods for blocking certain file attachments.

However, there are other tools that can help you do that.

For example, you can do that with Postfix using something like what's described here:

https://www.cyberciti.biz/tips/postfix-block-mime-attachment-files.html

Note that we haven't tested the above, and the exact steps for implementing it are a bit beyond the scope of our support here, but we wanted to at least point you in the right direction.

Let us know if that does the trick for you though!

PERFECT !!!!

Thank you, but for 10 in exam :-) i need inform that no file . its admitted, how can i change the error ???

I have this answer when i send *.exe attached -> #5.7.1 smtp;550 5.7.1 message content rejected>

We haven't tried such a setup before, so I don't have too many details for you regarding how to set that all up.

However, Googling "postfix block attachments", I see this link here which appears to have what you're after:

http://davidsj.co.uk/blog/block-attachments-in-postfix/

Will that do what you're after?

Yes andrey i make that and works like a charm and too can i make through virtualmin/webmin in -> postfix server -> header checks i make this regexp too but my last question is ....

How can i change the errors returns postfix to translate or change to more easy read for my users ???

I suppose we could also implement this in Usermin when sending email, if clamd is installed on the system.

That wouldn't cover mail send via other mail clients though.

I view make a file bounce.cf but no change errors 5.7.0 , i suppose i can translate this errors in any file .. no ??

The link I most recently shared has an example in it of how to provide a custom error message for the users.

Is that what you're after, or did I mis-understand?

With the first shared example works but with the second not , the .exe pass and nothing errors

Jamie is going to look into adding that feature into Virtualmin at some point in the future.

In the meantime, I'm unfortunately not sure of the exact syntax you'll need.

I can offer though that according to the link you shared, all you need is Postfix version 2.3, which was released prior to 2008 (I don't know the exact date).

Postfix 2.10, which you have on your CentOS 7 server, is much newer and was released in 2013.

Your Postfix version should work quite well though, there's no need to upgrade or change that.