Björn Puttmann a écrit : > Hello List! > > I have set up some Mailservers using postfix as MTA, procmail for > filtering (Spam, Virus and especially handling of bounced emails from > newsletters send by these mailservers) and cyrus as imap server. > > All in all this stack works brilliant. I'm facing one problem, though. > If a users mailbox is over quota and therefor can not recieve any mails > anymore no notification will be send to the sender of the email. > > In the main.cf mailbox_transport is set to procmail. > procmailrc defines some recipes and finally delivers to local users via > /usr/lib/cyrus-imapd/deliver -f $SENDER -a $USER $USER > > If the target mailbox is over qouta deliver will return an exitcode of 75 > which in turn can be handled by another recipe, creating a notification > mail for the original sender. This approach is not really satisfactory due > to some reasons: > > 1) most importantly this could end up in emails bouncing back and forth > from one mail account to another if both accounts create a bounce message.
That's why the null sender was invented years ago :) when sending bounces, set the envelope sender to: <>. PS. I don't like the X-Loop header hack. the other side can remove it. The null sender is standard and robust. > > 2) the return code of 75 is (as far as i know) not really specific. It > only refers > to a temporary failure while trying to deliver the mail locally. > > The maillog gives the following: > Oct 15 13:06:23 postfix lmtpunix[25617]: lmtp connection preauth'd as > postman > Oct 15 13:06:23 postfix lmtpunix[25617]: verify_user(xxxxxxxx) failed: > Over quota > Oct 15 13:06:23 postfix postfix/pipe[25677]: C8A5C4B42A: to=<[EMAIL > PROTECTED]>, > orig_to=<[EMAIL PROTECTED]>, relay=procmail, delay=3.5, > delays=0.04/0.01/0/3.5, > dsn=2.0.0, status=sent (delivered via procmail service) so your pocmail doesn't pass the error back to postfix. This means mail is lost (unless you implement a queue manager inside procmail, but then you can also implement an smtp server and drop postfix :). > > My question is: > > Is there any way to prevent postfix from calling mailbox_transport > for an account that is over quota and instead produce a bounce message > notifying the sender of the fact that the mail could not be deliverd? > use check_recipient_access with a map that you manage via your procmail or anything else. This way postfix will reject (not bounce. bounces are bad. only bounce if you don't have a choice). > If not, is there way to make sure that procmail will not end up bouncing > messages back and forth if both accounts produce bounces? > > Thanks for any input and take care, > Bjoern