Michael: > On Fri, 08 Jan 2010 00:50:49 Wietse Venema wrote: > > Michael: > > > I want to deploy a system whereby it will do an SQL lookup and depending > > > on the result will either continue processing the message as per usual or > > > issue a 'temporary' reject (Ie: Over quota message). > > > > > > This is on a relaying/gateway machine so it does not have direct access > > > to the mail queue to do it's own calculation so would need to work it out > > > based on information available from an SQL table. > > Is the following: > access_map_defer_code = > > set to the same number as in the result message, minus the dots? > > ie: Do I set this to: > access_map_defer_code = 422 > for overquota user mailboxes?
You can use the access map lookup result to specify the RFC 5321 SMTP reply code (and the RFC 3463 enhanced status code). Wietse man 5 access ... REJECT ACTIONS Postfix version 2.3 and later support enhanced status codes as defined in RFC 3463. When no code is specified at the beginning of the text below, Postfix inserts a default enhanced status code of "5.7.1" in the case of reject actions, and "4.7.1" in the case of defer actions. See "ENHANCED STATUS CODES" below. 4NN text 5NN text Reject the address etc. that matches the pattern, and respond with the numerical three-digit code and text. 4NN means "try again later", while 5NN means "do not try again". The reply code "421" causes Postfix to disconnect immediately (Postfix version 2.3 and later).