MailScanner per user mail size limit

carinus.carelse at carinus.carelse at
Fri Feb 24 09:25:43 GMT 2006

Try some Permutation of the following I think this might work. Not sure 

From: doron at   1024  Yes
FromOrTo:       default                -1  No 


"Doron Shmaryahu" <doron at> 
Sent by: mailscanner-bounces at
2006/02/24 08:05
Please respond to
MailScanner discussion <mailscanner at>

"MailScanner discussion" <mailscanner at>

RE: MailScanner per user mail size limit

thanks for response. I have done as suggested below. I changed the line to 
read:Maximum Attachment Size = 
 I created a  rule file contaiining the following:
From: doron at   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>, 
size=317660. Is there anything else I am missing ?
thanks again


From: mailscanner-bounces at 
[mailto:mailscanner-bounces at] On Behalf Of Brad 
Sent: 24 February 2006 05:14 AM
To: MailScanner discussion
Subject: Re: MailScanner per user mail size limit

>>> Doron Shmaryahu<doron at> 2/23/2006 4:22:49 PM >>>

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

Thanks in advance

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   1024000  # Limit FROM specified user to 1MB
# From: *    10240000 # Limit FROM specified domain to 
# From: 123.234.567.2                  1024000  # Limit FROM IP address to 
# 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                        0         # No Attachments 
allowed TO this user
# To:   *                    1024000   # Limit all TO this 
Domain to 1MB
To: user1 at your.domain       102400   # Limit FROM specified user to 
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 
MailScanner mailing list
mailscanner at

Before posting, read

Support MailScanner development - buy the book off the website! 

This e-mail and its contents are subject to the 
South African Medical Research Council
e-mail legal notice available at

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the MailScanner mailing list