Cami,

> How does amavisd-new handle pre-queue filtering if a message is destined
> to 2 different people with 2 different message size limits?
> ie, user1 = 10M, user2 = 20M and the incoming mail size is 15M.

If Postfix in the SMTP session towards amavisd does provide mail size
in the MAIL FROM command, then:

- if the declared mail size is over the global $smtpd_message_size_limit
  the MAIL FROM is rejected outright:
    552 5.3.4 Declared message size ($val B) exceeds fixed size limit

- otherwise, the protocol proceeds to RCPT TO, and with each recipient
  the declared mail size is compared to the user's individual quota
  and RCPT TO is rejected if the limit is exceeded:
     552 5.3.4 Declared message size ($mail_size B)
                      exceeds recipient's size limit <$addr>
  Transaction proceeds normally with the next RCPT TO
  if there is more than one recipient. If at least one recipient
  received a 2xx response, the DATA step can then proceed normally.

If the declared mail size is NOT provided in the MAIL FROM command,
amavisd has no other choice but to proceed with receiving the message.
At the end of data when the actual size is known, the message is
either rejected outright:
  552 5.3.4 Message size ($size B) exceeds size limit
if it is larger than the minimum limit of all messages' recipients,
otherwise mail is accepted with 2xx, but only forwarded to recipients
where the size is below their quota, and remaining recipients
receive a bounce (NDN) generated by amavisd.

Btw, there is no danger of DoS, as even when an endless mail is
being received, writing to disk stops when the max of all recipient limits
is reached, and futher data is only read from the socket and immediately 
discarded.

Sounds complicated, but it all follows straight from the SMTP protocol
specification and amavisd-new behaves as any conforming MTA would.

How this interacts with pre-queue postfix setup I'm not sure, I never tried 
it. Should be reasonable I hope, although this clearly is not a 'transparent'
SMTP relay, all Postfix caveats for such a setup apply.

  Mark


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to