Re: [Exim] Parent addresses

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Chris Keane
CC: exim-users
Subject: Re: [Exim] Parent addresses
On Fri, 28 Jul 2000, Chris Keane wrote:

> Is there any way I can get at the list of all parent addresses during
> processing of a director?


No, I'm afraid not.

> (Just in case anyone wants more info: as per Philip's suggestion recently,
> my first director is:
>
>   # First check whether this is an error/warning, and if so deliver it to
>   # postmaster on the local machine.
>   checkerr:
>     driver = smartuser
>     condition = ${if eq {$sender_address}{} {yes}{no}}
>     new_address = postmaster

>
> However, this breaks because postmaster is an alias, and the newly-
> generated address after aliasing gets passed to the checkerr director
> again, which means it just gets turned straight back into postmaster.


You could change the condition to test (in addition) for
$original_local_part being equal to $local_part; if not, skip the
director. Would that do it? Hmm, no, it wouldn't work when the error
message was addressed to the local part that postmaster is aliased to.

Or, maybe you could look up postmaster in /etc/aliases and check the
result. Messy.

  condition = ${if and {
              {eq {$sender_address}{}}
              {
              ! match 
              {${lookup{postmaster}lsearch{/etc/aliases}{$value}}}
              {${rxquote:$local_part}} 
              }
              }{yes}{no}}


Wait. A better idea: assuming that that director is the first, stick

new_director = the_name_of_the_next_director

on your director, AND on your aliasing and forwarding directors. Then
everything they generate will bypass your special director. Phew. I
thought there should be a relatively easy way to do it.

> Ideally I'd like a condition on checkerr which says "if any of the parent
> addresses are equal to postmaster, don't run this director".)


An easier option to contemplate is "If this director has been used
before in generating the current address, skip it."


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.