Re: [Exim] Change in $home handling after 4.10?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Kirill Miazine
Fecha:  
A: Jason L Tibbitts III
Cc: exim-users
Asunto: Re: [Exim] Change in $home handling after 4.10?
Jason L Tibbitts III wrote:
> I've recently upgraded from Exim 4.10 to 4.20 and have run into a
> minor issue. When we terminate an account, we keep a record around in
> the password file for a bit but archive and delete the home directory.
> This lets us present useful information when a terminated user tries
> to log in. The home directory for the user is then set to
> /dead/yyyy.mm.dd.
>
> In my RCPT ACL, I have the following:
>
> deny    message       = This account has been terminated.\nContact postmaster@??? or 713-743-3486 for more information.
>           condition     = ${if match {$home}{^/dead/}{yes}{no}}

>
> Under 4.10 this worked; mail to terminated users was bounced
> properly. Under 4.20 the mail is accepted and the mail sticks in the
> queue with an error like the following:
>
> R=localuser T=local_delivery defer (2): No such file or directory: failed to chdir to /dead/2003.06.18
>
> which makes sense given the home directory doesn't exist. A '-bs -d5'
> run gives the following for a user whose home directory is
> /dead/2003.06.18:
>
> processing "deny"
> check condition = ${if match {$home}{^/dead/}{yes}{no}}
>                 = no
> deny: condition test failed

>
> I went through the ChangeLog and don't see any changes that seem
> related. I stuck '\N's around the pattern but it didn't seem to make
> a difference; I also took out the '^' and '/' characters to no avail.
>
> Any ideas as to what I'm doing wrong? Thanks,


Are you positive that $home is set when ACLs are processed? It should
not be.

Try running exim with "-d+expand".

You can use ${lookup passwd{<username>}} and ${extract} home directory
from there and check the resulted value with ${match}.

Anyway, a simple router would to the trick just fine (provided that you
have a condition somewhere in your RCPT ACL that verifies local
recipients, "verify = recipient" that is). This router should be put
before the router that handles messages for alive users.

dead_user:
    driver = redirect
    check_local_user
    condition = ${if match {$home}{^/dead/}{yes}{no}}
    allow_fail
    data = :fail: Sorry, this user is dead.


--
Kirill Miazine
mailto:km@krot.org
http://km.krot.org/