MailScanner per user mail size limit
Doron Shmaryahu
doron at crc.co.za
Fri Feb 24 08:11:26 GMT 2006
>>>>Brad Beckenhauer 24 February 2006 05:14 AM>>>>
This shoudl work for you.
Create this file "MaximumAttachmentSize.rules" in your "rules"
directory and modify your MailScanner.conf as noted.
#
# File Location/Name:
# %rules-dir%/MaximumAttachmentSize.rules
#
# This is where you can build a ruleslist
# that allows you to specify attachment size limits in bytes
#
# In MailScanner.conf change:
# "Maximum Attachment Size = -1"
# to
# "Maximum Attachment Size = %rules-dir%/MaximumAttachmentSize.rules"
#
# Example values, adjust as needed
# 1k = 1024 bytes
# 10k = 10240 bytes
# 100K = 102400 bytes
# 1MB = 1024000 bytes
# 10MB = 10240000 bytes
# 100MB = 102400000 bytes
# 250MB = 256000000 bytes
# 500MB = 512000000 bytes
# 1GB = 1024000000 bytes
#
# Size limits and Default should be smaller than the partition
# where they are temporarily stored. ;-)
#
# Set addresses/domains to be limited as follows:
# Direction Pattern Size Limit
# From: user at good.domain.com 1024000 # Limit FROM specified user to
1MB
# From: *@friendly.domain.com 10240000 # Limit FROM specified domain
to 10MB
# From: 123.234.567.2 1024000 # Limit FROM IP address
to 1MB
# From: 123.234. 1024000 # Limit FROM IP range
to 1MB
# From: /^192\.168\.13[4567]\./ 1024000 # Limit FROM IP range to 1MB
# To: abc at xyz.com 0 # No Attachments
allowed TO this user
# To: *@yahoo.com 1024000 # Limit all TO this
Domain to 1MB
#
To: user1 at your.domain 102400 # Limit FROM specified user to
10Kbytes
To: user2 at your.domain 1024000 # Limit FROM specified user to 1MB
To: user3 at your.domain 10240000 # Limit FROM specified user to 10MB
FromOrTo: default -1 # Default, No attachment
Size Checking
-------------------
Hi All,
I have done some more testing. I have set: Maximum Attachment Size = 0
to stop all attachments from being delivered this has no impact at all.
I have tested this configuration on two different mailscanner
installations and both do the same. Obviously there must be something
wrong with my config somewhere as it is not reading the Maximum
Attachment Size = 0 directive. The attachments pass through with no
problem. I would assume it is not taking the configuration, or I have
not set something else. Would there be anything else I would have to set
in the MailScanner.conf file besides Maximum Attachment Size = 0 ?
thanks again for all the help
Doron
________________________________
From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Doron
Shmaryahu
Sent: Friday, February 24, 2006 8:06 AM
To: MailScanner discussion
Subject: RE: MailScanner per user mail size limit
Hi,
thanks for response. I have done as suggested below. I changed the line
to read:Maximum Attachment Size =
/usr/local/etc/MailScanner/rules/MaximumAttachmentSize.rules
I created a rule file contaiining the following:
From: doron at crc.co.za 1024
FromOrTo: default -1
so in theory that should block anything from me bigger than 1k. I have
also restarted MailScanner but it does not block it nothing. I have sent
a couple of attachments above 200k but still nothing. I turned Debug =
yes so i could check for errors and nothing.
I see the correct size reporting from sendmal from=<doron at crc.co.za>,
size=317660. Is there anything else I am missing ?
thanks again
Doron
________________________________
From: mailscanner-bounces at lists.mailscanner.info
[mailto:mailscanner-bounces at lists.mailscanner.info] On Behalf Of Brad
Beckenhauer
Sent: 24 February 2006 05:14 AM
To: MailScanner discussion
Subject: Re: MailScanner per user mail size limit
>>> Doron Shmaryahu<doron at crc.co.za> 2/23/2006 4:22:49 PM >>>
Hi,
I have MailScanner 4.50.15 running on a FreeBSD 4.11 machine. All is
working perfectly. I have read through the docs on creating per user
mail limits but until now I have still not been able to make it work. I
would like the rule file to control mail size limits for each user.
Are there any problems with this ?
Could someone provide me a example rule file or any hints/docs would be
appreciated.
Thanks in advance
Doron
--
This shoudl work for you.
Create this file "MaximumAttachmentSize.rules" in your "rules"
directory and modify your MailScanner.conf as noted.
#
# File Location/Name:
# %rules-dir%/MaximumAttachmentSize.rules
#
# This is where you can build a ruleslist
# that allows you to specify attachment size limits in bytes
#
# In MailScanner.conf change:
# "Maximum Attachment Size = -1"
# to
# "Maximum Attachment Size = %rules-dir%/MaximumAttachmentSize.rules"
#
# Example values, adjust as needed
# 1k = 1024 bytes
# 10k = 10240 bytes
# 100K = 102400 bytes
# 1MB = 1024000 bytes
# 10MB = 10240000 bytes
# 100MB = 102400000 bytes
# 250MB = 256000000 bytes
# 500MB = 512000000 bytes
# 1GB = 1024000000 bytes
#
# Size limits and Default should be smaller than the partition
# where they are temporarily stored. ;-)
#
# Set addresses/domains to be limited as follows:
# Direction Pattern Size Limit
# From: user at good.domain.com 1024000 # Limit FROM specified user to
1MB
# From: *@friendly.domain.com 10240000 # Limit FROM specified domain
to 10MB
# From: 123.234.567.2 1024000 # Limit FROM IP address
to 1MB
# From: 123.234. 1024000 # Limit FROM IP range
to 1MB
# From: /^192\.168\.13[4567]\./ 1024000 # Limit FROM IP range to 1MB
# To: abc at xyz.com 0 # No Attachments
allowed TO this user
# To: *@yahoo.com 1024000 # Limit all TO this
Domain to 1MB
#
To: user1 at your.domain 102400 # Limit FROM specified user to
10Kbytes
To: user2 at your.domain 1024000 # Limit FROM specified user to 1MB
To: user3 at your.domain 10240000 # Limit FROM specified user to 10MB
FromOrTo: default -1 # Default, No attachment
Size Checking.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20060224/c2a3bdcd/attachment.html
More information about the MailScanner
mailing list