postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Re: Mail forwarding possible when mailbox_size_li

Re: Mail forwarding possible when mailbox_size_limit is reached?

From: Axel Freyn <axel-freyn_at_nospam>
Date: Sat Oct 23 2010 - 13:11:48 GMT
To: postfix-users@postfix.org

Hi,
On Sat, Oct 23, 2010 at 08:02:08AM -0400, Wietse Venema wrote:
> > We are using both mail forwarding (with an alias_database and
> > $HOME/.forward - files), and a mailbox_size_limit for the user
> > mailboxes. The local delivery is done by postfix/local.
> >
> > The problem now is: If the mailbox is full, also the forwarding does not work
> > anymore -- postfix/local generates a SOFTBOUNCE before trying to forward the
> > mail:
> >
> > postfix/smtpd[12341]: A9B8515C6F8: client=localhost.localdomain[127.0.0.1]
> > postfix/cleanup[12335]: A9B8515C6F8: message-id=<20101022181430.E253115CE1C@...de>
> > postfix/qmgr[5039]: A9B8515C6F8: from=<root@....de>, size=855, nrcpt=1 (queue active)
> > postfix/local[12342]: A9B8515C6F8: to=<abf@....de>, relay=local, delay=1, delays=0/0.01/0/1, dsn=4.2.0, status=SOFTBOUNCE (can't create user output file. Command output: procmail: Error while writing to "/var/mail/abf" )
> >
>
> I see no Postfix errors here.
>
> PROCMAIL updates the mailbox (and fails because of the limit) before
> PROCMAIL forwards the message.

Thanks for your fast reply!
Probably my mail was not clear: I agree, there is now error due to
Postfix. It probably behaves as it is configured and as it should (but:
not as I would like it to behave in this situation ;-))

Let's assume, I have a $HOME/.forward which forwards mails for "abf" to
the external Mail-adress "axel-freyn@gmx.de", and keeps a local copy in
/var/mail/abf.

Then I would like to have the behaviour:

a) If the mailbox_size_limit for /var/mail/abf is NOT reached:
   - a copy of the mail is stored locally in /var/mail/abf
                (that is done by Procmail, I think?)
   - a copy of the mail is forwarded to axel-freyn@gmx.de (with a new ID
     (here: B4E2015C0FA).
                (that is done by postfix/local?)

b) If the mailbox_size_limit for /var/mail/abf IS reached:
   - local delivery to /var/mail/abf fails, (maybe creating a
     SOFTBOUNCE)
   - nevertheless, a copy of the mail is forwarded to axel-freyn@gmx.de.

However, I did not succeed to obtain the second case. As my Postfix is
configured now, it first tries to do the local delivery using procmail,
and it stops the complete delivery process if procmail fails. So, if the
mailbox_size_limit IS reached, postfix does NOT forward the mail to
axel-freyn@gmx.de.

So maybe my question could be reformulated as:
Can I tell Postfix: "FIRST do all forwarding ($HOME/.forward and
/etc/aliases), and THEN pass the mail to procmail"?

That would result in my desired effect:
 - Mails are ALWAYS forwarded -- even when the local mailbox is full
 - Mails are locally delivered if the local mailbox_limit is not reached
   If the local mailbox is full, this "local copy" of the mail is
   returned with a Softbounce.

Axel