cPanel & WHM Version 94 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Email Filtering -ADD Rule -Attachment +Size +Kind

horustwohawks shared this idea 7 years ago
Needs Feedback

It seems it would be small potatoes to add the ability to filter email based on attachment size or kind.


Ideally I would like to be able to make a rule similar to, for instance...

If mail if from "x@y.com" and attachment is greater than 10MB, then bounce it back with a message I designate.


...kind of thing. This is a galling limitation in hosting "out there" that seems could so easily be solved in host manager tools, such as cPanel's Email filtering.


Please vote this up ;^)

- twohawks -


PS: huge thanks to the developers at cPanel who work so hard to provide such kick-a$$ tools.

Best Answer
photo

There isn't a way through Exim filtering to determine solely the "attachment size" of a message. However, it can filter based on "message size" (the overall entire size of the message, body + attachments).


This is per the the available expansion variables for filters designated by Exim.

(For reference, message overall size is what most mechanisms "block" on -- such as Spam Assassin)


The variable appears to be: $message_body_size


Therefore your request would seemingly be to add UI elements and logic recognition to support working with filters that utilize this variable.


Does this sound acceptable? (The use of message overall size vs. attachment size)

Comments (6)

photo
1

There isn't a way through Exim filtering to determine solely the "attachment size" of a message. However, it can filter based on "message size" (the overall entire size of the message, body + attachments).


This is per the the available expansion variables for filters designated by Exim.

(For reference, message overall size is what most mechanisms "block" on -- such as Spam Assassin)


The variable appears to be: $message_body_size


Therefore your request would seemingly be to add UI elements and logic recognition to support working with filters that utilize this variable.


Does this sound acceptable? (The use of message overall size vs. attachment size)

photo
1

Thanks for your reply, Brian (I am assuming that's your name ;^),


The answer is a resounding YES!.... of course IF $message_body_size indeed includes attachment size detection with the body - which I agree it seems it should.


Just for the sake of being better detailed while we're musing...

In my mail client program I have the following types of filtering available...

Size

- is,

- is not

- is greater than,

- is less than,


Attachment Name(s)

- contains

- contains whole word

- does not contain

- is

- is not

- starts with

- ends with

- matches regexp (case insensitive)

- matches regexp (case sensitive)


Attachment Count

- is

- is not

- is greater than

- is less than


....and there is no filter for Attachment Size, just the message size, which jibes with what you indicated in your reply.


I think it would be a huge move forward to include ability to filter on size. I hate it when people presume to send me these huge emails. I would love to be able to "Fail with a Message"...

1 - for the purposes of leveraging associates to get with a more responsible program of how we share data (attachment resources), and

2 - for the purposes of simply adding some handling ability in cases of general email-size abuse.


Ok. A bit lengthy there, but hopefully for the good.

Thanks again for your attention here.

photo
2

This would be a very helpful filter, especially the combination of email size and attachment type.

photo
2

Even if the feature were dialed back a bit and we could JUST filter based on attachment type or file extension, it would be a big help.


It seems like the only viruses getting through to my users lately are all .zip and we have almost no legitimate files of that type coming through. Has anyone else experienced this problem with small .zip files lately?

photo
1

+1 vote for me, zip file attachments are a huge problem our end, we need to filter depending on size for example under 30kb

photo
1

This is a must for people that don't have access to exim files.

Leave a Comment
 
Attach a file