From: Noah Sheppard on
Postfix users,

I am attempting to set up postfix such that using filesystem quotas on
users' mail spaces (a directory whose subdirectories are maildirs).
After RTF{manual, google, list archives}, I haven't been able to find
any good way to do this.

A problematic requirement is that we can't let the user go over their
soft quota, because if they do and their grace runs out, they will be
unable to free up space via IMAP, since common IMAP clients try to copy
messages to Trash as part of the deletion process.

I've thought through the following possibilities, with the given
problems:

1-mailbox_size_limit: ineffective; I'm using maildir, and that's not
filesystem-based anyway.

1-A milter/access policy which checks per recipient to make sure this
message will not put them over quota: fail, we don't know the size of
the message at the point in the SMTP exchange where we can reject
individual users.

2-Same as (1) but assume that the message is message_size_limit large:
annoying because it essentially makes an amount of the users's space
unusable

2-A milter/access policy which checks after end of data to make sure
this message won't put users over quota: fails because this would mean
rejecting the message for all local recipients just because one was over
quota.

3-Just setting quotas and letting procmail fail to deliver the message
and generate a bounce message: fails because postfix keeps trying to
deliver the message for a long time; we would like a relatively quick
fail and notification.

4-Another item in our mailbox_command pipeline which checks the users'
quota and rejects if the message would put them over it: kind of works,
but there is no return code for the command to use to tell procmail that
the delivery failed due to quota issues, causing a proper DSN 5.2.2 to
be returned. Also, the bounce message this generates is a type of
backscatter, though it may be unavoidable because of how the SMTP
protocol works (recipients before message size).

(4) seems to me to be the most promising, if there were a way to have my
quota-checking script tell Postfix to send a 5.2.2 DSN.

Has anybody else dealt with this and prevailed?

Thanks much,
--
Noah Sheppard
Assistant Computer Resource Manager
Taylor University CSE Department
nsheppar(a)cse.taylor.edu

From: Wietse Venema on
Noah Sheppard:
> 3-Just setting quotas and letting procmail fail to deliver the message
> and generate a bounce message: fails because postfix keeps trying to
> deliver the message for a long time; we would like a relatively quick
> fail and notification.

procmail returns a TEMPORARY error condition to Postfix.
Don't blame Postfix for procmail brain damage.

Wietse

From: Noah Sheppard on
On Thu, Dec 17, 2009 at 05:53:13PM -0500, Wietse Venema wrote:
> Noah Sheppard:
> > [..] postfix keeps trying to deliver the message for a long time
>
> procmail returns a TEMPORARY error condition to Postfix.
> Don't blame Postfix for procmail brain damage.
>

Understood. Actually, this was our fault as we have the '-t' switch on
our procmail command, so procmail exits with EX_TEMPFAIL rather than
EX_CANTCREAT.

As there is no exit code to tell postfix that delivery failed due to
quota issues, is there any other way to insert a hook which checks and
rejects on a per-user basis after we know the size of the message, and
can tell postfix to return a 5.2.2 DSN?

Thanks,
--
Noah Sheppard
Assistant Computer Resource Manager
Taylor University CSE Department
nsheppar(a)cse.taylor.edu

From: Wietse Venema on
Noah Sheppard:
> On Thu, Dec 17, 2009 at 05:53:13PM -0500, Wietse Venema wrote:
> > Noah Sheppard:
> > > [..] postfix keeps trying to deliver the message for a long time
> >
> > procmail returns a TEMPORARY error condition to Postfix.
> > Don't blame Postfix for procmail brain damage.
> >
>
> Understood. Actually, this was our fault as we have the '-t' switch on
> our procmail command, so procmail exits with EX_TEMPFAIL rather than
> EX_CANTCREAT.
>
> As there is no exit code to tell postfix that delivery failed due to
> quota issues, is there any other way to insert a hook which checks and
> rejects on a per-user basis after we know the size of the message, and
> can tell postfix to return a 5.2.2 DSN?

With the pipe-to-command/exit-status protocol, the only way to
flag an hard error is by exiting with a status that reports a
hard error, or by sending something to stdout that begins with
a 5.2.2 status code.

man 8 pipe

Wietse

From: Michal Kurka on
Dne 18.12.2009 v 10:46 Wietse Venema napsal(a):

> > As there is no exit code to tell postfix that delivery failed due to
> > quota issues, is there any other way to insert a hook which checks and
> > rejects on a per-user basis after we know the size of the message, and
> > can tell postfix to return a 5.2.2 DSN?
>
> With the pipe-to-command/exit-status protocol, the only way to
> flag an hard error is by exiting with a status that reports a
> hard error, or by sending something to stdout that begins with
> a 5.2.2 status code.

I think, if command from 'pipe' exit with error, then a mail remains in
mail queue on local MTA. So there is no chance send 4xx or 5xx SMTP-code
to sender MTA, because SMTP-communication with him is closed already.

--
Michal Kurka - Mysak
sluzby spojene s operacnim systemem Linux

 |  Next  |  Last
Pages: 1 2
Prev: RETR ERROR
Next: Force Delivery Failure