[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Maildir quotas



martin f krafft wrote:
also sprach Shane Chrisp <shane@2000cn.com.au> [2005.08.27.1214 +0200]:

During the smtp conversation servers can use the SIZE= command.


At this point in time, you don't even know who the recipient is. How
will you calculate the quota? And even if you could, who guarantees
that the client respects it?

One could conceive the client sending a SIZE parameter as well, but
who guarantees that it is accurate?

The only place where you can do quota rejects is when you know the
recipient and the entire message size. And the best way to do it is
try storing it and rejecting the mail if that failed. Otherwise you
may end up in the following situation:

  - user has 100 kb free
  - message arrives of size 80 kb and is accepted
  - meanwhile, user moves a message of size 30 kb into the inbox via
    IMAP
  - now the MTA passes to the MDA to store the message.
  - over quote, unexpected message drop. boom.
  - you get fired.


That clears things up a lot as to how Postfix handles the message
delivery. Thanks, I learnt something today.


I've dealt with a bunch of MTAs and postfix is the one that does
most things "righter" than others. It's also an MTA where others try
to be everything. And it's damn good about *not* losing mail to the
point that it will *not* communicate to the peer that a mail has
been received until the MDA gave a successful return code. Then, it
closes the SMTP conversation accordingly.

Though I have not tried Tim's system yet, I plan on giving it a whirl in the future. I agree that if possible, a message should be rejected during SMTP time rather than risk generating a bounce. In today's world of spam, reducing collateral spam as much as possible is a major goal.

Tim's suggestion works by first running a script periodically that looks for users who are already at or over their quota. Then during the SMTP phase of an incoming message, exim will consult the output of this script (a file) and if there is a match, reject the message. No need to get the size of the incoming message.

Exim is also setup to allow a user to go over his quota at delivery time using the quota_is_inclusive feature in the transport. This allows a message that will put a user over his quota to be delivered. But then the script mentioned above will detect the user is over quota and not allow any additional messages to be delivered.

Though not perfect, I think it's a decent system; at least in theory. I have zero experience with postfix so I cannot make any direct comparison. But if your goal is to do as many rejections as possible during SMTP, I suggest checking out that page.

thanks,
mikeS

--
Michael Sprague  | mfs@saneinc.net
System and Network Engineering (SaNE), Inc
use STD::disclaimer;


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.16/83 - Release Date: 8/26/2005



Reply to: