/dev/rob0: > On Tue, Mar 27, 2012 at 04:10:59PM -0500, I wrote: > > On Tue, Mar 27, 2012 at 10:21:14PM +0200, Sebastian Wiesinger wrote: > > > I have a setup with handles a few virtual domains. For one domain > > > only I want mails not to be rejected with an 5xx error code but be > > > deferred with a 4xx error code. Is that possible? > > > > main.cf : > > smtpd_client_restrictions = check_recipient_access > > hash:/etc/postfix/deferred_recipient[, ... ] > > > > deferred_recipient : > > > > example.com defer_if_reject > > [ ... ] > > That of course turns any rejection which comes after this restriction > into a deferral, and that's not quite what you said you want. There > are ways to apply it only to unknown recipients. I would move any > spam-blocking restriction to smtpd_client_restrictions, after any > necessary permit_* restrictions and before check_recipient_access. > Then the unknown recipient rejection, which happens in > smtpd_recipient_restrictions, will be subject to defer_if_reject.
You will need to specify an explicit "reject_unknown_recipient" at the end of smtpd_recipient_restrictions. The implicit "unknown recipient" test at the end is not part of smtpd_recipient_restrictions, and this implicit test currently does not play along with any defer_if features requested from within smtpd_recipient_restrictions. I suppose this could (should) be changed without breaking things, but making this 100% safe will take half a day and I don't have that time at the moment. Wietse