Link to home
Start Free TrialLog in
Avatar of Ludwig Diehl
Ludwig DiehlFlag for Peru

asked on

I need to set message size limit for outgoing/incoming mail separately

I am trying to set the message size limit for outgoing/incoming mail separately so internal users can only send messages no larger than 2Mb but be able to receive messages up to 10Mb.
Is there any way to do it?.

I am using

postfix as MTA and courierimap
Avatar of Kotteeswaran Rajendran
Kotteeswaran Rajendran
Flag of Malaysia image

Avatar of Ludwig Diehl

ASKER

Thx for the quick response. Indeed I actually read that article before posting my question here. The problem is that my main.conf file has these settings:

mailbox_size_limit = 0
message_size_limit = 2097152

But it limits both, incoming and outgoing messages to 2Mb. I only want to set 2Mb limit for outgoing messages and 10Mb for incoming.
i'm sorry. i could not find on the web. I'm a beginner :(
no prob. Thx for trying anyway ;)
Backup your main.cf file, then edit:

message_size_limit = 10240000

restart postfix
thx for your reply. Unfortunately what I need is to limit the outgoing message size to 2Mb and the incoming message size to 10Mb. So users cannot send messages above 2Mb nor receive messages above 10Mb.
If I try your solution it will limit both incoming/outgoing messages to 9.77Mb.
I'm thinking that message_size_limit is only influencing the max size of messages on your postfix mail server (both in and out). This is what you want to set to 10Mb. Now about sending messages: your remote MTA should be configured not to accept messages larger than 2Mb. So you'd either have to setup a second postfix instance that you send through (configured for a message_limit of 2Mb) or have someone configure the remote MTA for you.
SOLUTION
Avatar of ArneLovius
ArneLovius
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
User generated image
Check this limits

- Rancy
@Rancy, this is on Postfix, not Exchange
Although Postfix does not support per-sender limits, or applying a different limit to certain IPs;

Another option is to configure Postfix to the _highest_ limit you ever use, and implement  a Content filter,  Policy daemon, or before-queue Milter plugin,  
to enforce lower limits when required.

Such as
Milter-Length
http://www.snertsoft.com/sendmail/milter-length/

See here, about Postfix support for Milter plugins:
http://www.postfix.org/MILTER_README.html


It may be more useful to use CBPolicyd
and set an  _aggregate_   number of megabytes transferred per user quota, than a per-message quota.

For example:  "Each user can send up to a rolling average of 20 Megabytes of messages per day"

That could be   up to  10    2 Megabyte messages,
or up to 20  1 Megabyte messages,
up to 40  500 kilobyte messages,

up to 80  250 kilobyte messages,
or up to 160 125 kilobyte messages,
for example.


In other words:  An aggregate quota prevents users from defeating the  1 Megabyte size limit anymore to send  a  2 Gigabyte file,  by   splitting that big file into   2000  separate e-mails, and sending all those e-mails out.


Which (IMO)  is a little bit more useful than simply limiting to 1MB.
Although the 1MB limit will definitely remain useful for low-bandwidth WANs,
as it  provides a limitation of the total SMTP session delay, and therefore,
helps eliminate one situation that can cause very poor mail server performance.