Q0631

Nigel Metheringham edited this page Nov 30, 2012 · 3 revisions
Clone this wiki locally

Q0631

Question

I would like to choose a retry rule based on on the sender rather than the recipient address. Is this possible?

Answer

Yes. In release 4.43 and later releases, you can do this directly by adding a third item to a retry rule of the form "senders=<address list>". The retry timings themselves then become the fourth item. For example:

*   *   senders=:   F,1h,30m

would match all bounce messages. If the address list contains white space, it must be enclosed in quotes. For example:

a.domain  timeout  senders="x@b.dom : y@c.dom"  G,8h,10m,1.5

If you are using an earlier release of Exim, you can still achieve the effect, but in a more complicated way. The address part of a retry rule is matched as a single-item address list. Such lists are always expanded, so you can use something like this:

"${if eq{$sender_address}{xxx}{*@*}{no@no}}" quota F,1h,10m; ...

If the sender address is xxx , the pattern expands to @ , which matches all recipient addresses; if you want to, you can make this a more restrictive pattern. If the sender address is not xxx , the pattern expands to no@no , which is assumed to be a recipient address that can never match, so the retry rule is skipped.