Sieve and bad file extensions?

Need help? Ask here.

Moderator: Moderators

Post Reply
bobpullen
Posts: 20
Joined: Fri Jul 18, 2014 2:10 am

Sieve and bad file extensions?

Post by bobpullen »

Hi,

Does Rollernet's Sieve implementation offer a sensible method of refusing messages with known bad file extensions e.g. Office macros etc?
If not, is there any other sensible way of refusing messages containing certain types of attachment?
bobpullen
Posts: 20
Joined: Fri Jul 18, 2014 2:10 am

Re: Sieve and bad file extensions?

Post by bobpullen »

For the benefit of anybody else that stumbles across this, I don't believe Pigeonhole has many graceful methods of handling file attachments.

It's probably a bit dirty, but I eventually worked around the problem like this:

Code: Select all

if body :raw :regex  ["filename=.*\.docm","filename=.*\.dotm","filename=.*\.xlm","filename=.*\.xlsm","filename=.*\.xltm","filename=.*\.xla","filename=.*\.pptm","filename=.*\.potm","filename=.*\.ppsm","filename=.*\.sldm"]
{
	reject "Attachment contains a banned file extension.";
}
You'll need to require "reject","body" and "regex" when declaring the extensions for your script.
bobpullen
Posts: 20
Joined: Fri Jul 18, 2014 2:10 am

Re: Sieve and bad file extensions?

Post by bobpullen »

Can't edit the above post, but turns out that in some cases my regex was matching strings it shouldn't have. Fixed by adding word boundaries like this:

Code: Select all

if body :raw :regex  ["\bfilename=.*\.docm\b","\bfilename=.*\.dotm\b","\bfilename=.*\.pptm\b","\bfilename=.*\.potm\b","\bfilename=.*\.ppsm\b","\bfilename=.*\.sldm\b","\bfilename=.*\.xlsm\b","\bfilename=.*\.xltm\b","\bfilename=.\*.xla\b","\bfilename=.\*.xlm\b"]
{
         reject "Attachment contains a banned file extension.";
}
Seth
Site Admin
Posts: 309
Joined: Sun Aug 30, 2009 10:44 pm
Location: Nevada
Contact:

Re: Sieve and bad file extensions?

Post by Seth »

We did recently add a feature for this in the account control center with a predefined list:
https://acc.rollernet.us/mail/options.php
Seth Mattinen, Roller Network LLC
Post Reply