Re: multi profile config

"Peter Bowyer" <[email protected]> Mon, 30 Aug 2004 14:15:47 +0100
Newsgroups gmane.mail.exim.exiscan.user
Message-ID <019201c48e93$77a56040$0a46a8c0@pbdesktop>
andy <[email protected]> wrote:
> Hi, does anyone have a working multi profile config that they would
> be happy to show me,
> the docs on doing it are a little vague but then its monday morning,
> it could just be my brain.

Lets try that again: this is high up in the RCPT acl:


I'm using $acl_m0 to carry the scan profile ID of the first recipient. So
when a new recipient arrives, we defer it if $acl_m0 is non-blank and does
not equal the scan profile of the new recipient.

defer   message       = try this address in the next batch
              condition     = ${if \
                                          or {\
                                                 {!def:acl_m0} \
                                                 {eq { ${acl_m0} } \
                                                     { LOOKUP_SCAN_PROFILE }
\
                                                } \
                                } {0}{1} \
                                }

LOOKUP_SCAN_PROFILE is a MySQL lookup which returns the scan profile ID (an
integer) of the recipient domain.

So now we've accepted the recipient, we make sure we set $acl_m0 at the end
of the acl so that it's ready to test the next recipient (OK, we only really
need do this if it's blank, but it doesn't hurt). The MySQL query result
should be cached so there's no penalty here.

accept  domains       = +relay_to_domains
          endpass
          verify        = recipient/callout=10s,defer_ok
          set   acl_m0 = LOOKUP_SCAN_PROFILE

Having explained it here I note it could be tidier.. but it works nicely.

HTH

Peter