Operating System - Linux
1835484 Members
3007 Online
110078 Solutions
New Discussion

Re: limiting attachment size

 
Jano_1
Advisor

limiting attachment size

Hi,

How do I limit the attachment size for e-mails?

eg. user1 - can send 1MB attachments
user2 - can send 200kb attachments

I am running sendmail with the MailScanner/SpamAssassin packages.

Regards.
Jano


4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: limiting attachment size

A good front end mail tool is squirrelmail. I know in the general config file you can limit attachment size for all users. But by user, not so sure.

sendmail does not have this functionality built in native, but it probably can be done with sendmail.mc macros, but on a server basis, not user by user.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jano_1
Advisor

Re: limiting attachment size

Hi Steven,

As you say I am looking for a solution to implement on the server side.

Are there any comercial packages available?

Regards.
Jano
John Pretti
Advisor

Re: limiting attachment size

This is a fairly simple process and can be accomplished by sendmail. Please note that it is a server-wide setting and cannot be configured on a per-user basis. Simply do the following:

1. Locate your sendmail.cf
2. Edit your sendmail.cf and search for the following line:

# maximum message size
#O MaxMessageSize=1000000

3. Simply uncomment the line begining with #0 to look as follows:

O MaxMessageSize=1000000
4. You may then set the mail size limit to whatever you want from there.
5. Save your sendmail.cf and restart sendmail.

Hope this helps, should take less than 2 minutes to implement.

Cheers,
John
Jano_1
Advisor

Re: limiting attachment size

Hi,

I solved the problem by updating MailScanner, and using the "Maximum Attachment Size" field with a ruleset to specify the attachment size per user.

(I wish I could award myself points. :) )

Regards.
Jano