[exim] Conditionally setting transport_home_directory to som…

Página Inicial
Delete this message
Reply to this message
Autor: Mike Brudenell
Data:  
Para: exim-users
Assunto: [exim] Conditionally setting transport_home_directory to something special/the default
Greetings -

I've been trying to set up a router in the configuration file all
afternoon and I must be overlooking something fundamental... can
anyone help with this please?

I am trying to set up a router that looks to see if the recipient has
set up a .vacation.msg file in their home directory. If they have
then it uses a central filter to generate an automatic response.

All of our users have home directories set in the NIS passwd map,
which check_local_user consults.

However SOME users need to have this overridden if they have a home
directory in a separate directory tree (eg, /mailstore/control/p/pmb1/
home)

I am using "exists" to test if this special home directory exists
and, if it does, use router_home_directory and
transport_home_directory to specify that area instead. This works.

However for the other, 'normal', users I can't work out what to put
in the conditional expression for router_home_directory and
transport_home_directory. I had assumed it would be $home but this
doesn't work, with Exim logging that the home directory "" in the
transport isn't absolute.

# ROUTER

vacation_autoreplies:
   driver = redirect
   no_verify
   domains = +local_domains
   check_local_user
   router_home_directory = ${if exists{/mailstore/control/${length_1: 
$local_part}/$local_part/home} \
        {/mailstore/control/${length_1:$local_part}/$local_part/home} \
        {$home} }
   transport_home_directory = ${if exists{/mailstore/control/$ 
{length_1:$local_part}/$local_part/home} \
         {/mailstore/control/${length_1:$local_part}/$local_part/home} \
         {$home} }
   require_files = $home/.vacation.msg
   allow_filter
   data = # Exim filter\n\
         if personal then\n\
                 vacation\n\
                 log ""\n\
                 subject "Re: Your message"\n\
         endif
   reply_transport = address_reply


# TRANSPORT

address_reply:
driver = autoreply

I have tried changing the $home to ${expand:$home} just in case that
was needed, but that fails in the same way.

If I omit the router_home_directory and transport_home_directory
altogether then things work, with both router and transport picking
up the home directory from NIS ... but that, of course, only works
for the 'normal' users and not the specials.

It's almost as if $home doesn't have a value in the router (except it
does, because it works for the require_files), or gets lost when the
transport starts.

What am I missing?
Is there an easier way to set the home directory in both router and
transport?

With many thanks,
Mike B-)

--
The Computing Service, University of York, Heslington, York Yo10 5DD, UK
Tel:+44-1904-433811 FAX:+44-1904-433740

* Unsolicited commercial e-mail is NOT welcome at this e-mail address. *