On Thu, Jun 13, 2013 at 03:40:33PM +0200, Ralf Hildebrandt wrote: > Currently, smtp_fallback_relay is being used after the first failed > delivery. > > http://www.postfix.org/postconf.5.html#smtp_fallback_relay > explicitly mentions: "With bulk email deliveries, it can be beneficial > to run the fallback relay MTA on the same host, so that it can reuse > the sender IP address. This speeds up deliveries that are delayed by > IP-based reputation systems (greylist, etc.)." > > i thought this could be done easier, like: > > Why not have either a smtp_fallback_relay_threshold > parameter, which specifies after how many delivery attempts the mail > will be passed to the smtp_fallback_relay. > > It would have to default to 1 to be backwards compatible.
Postfix does not record the number of delivery attempts in the queue file. Updates of such a record (unless it is a one byte gauge that tops out at 255) cannot be done atomically, it may not accurately reflect the number of delivery attempts, since when a destination is throttled, some recipients are deferred without being tried or re-tried. So at best we could have a one byte count of how many times a message has been deferred. This would need be a new queue-file envelope record, so cleanup would have to write it into new queue files and qmgr would have to update it when deferring a queue file. > Alternative/additional approach: > > smtp_fallback_relay_threshold_time (compare to > smtp_pix_workaround_threshold_time) This can be done without changing the queue file format. > How long a message must be queued before the Postfix SMTP client > passes the mail to the smtp_fallback_relay. Only after first trying the real destination. This may be the first attempt on a sufficiently congested system. > No idea what an appropriate default would be... The default should disable this new feature, some people rely on the fallback relay kicking in right away. Thus the default would be 0. Otherwise, 1-3 hours is about right, the geometric mean of 300s and 5d is 3hours. Use the lower end of the range if maximal_backoff_time is substantially smaller than 1 hour and the higher end if maximal backoff time is at least 1 hour. -- Viktor.