[exim] convert to pgsql - aliases with :fail:

Etusivu
Poista viesti
Vastaa
Lähettäjä: Gary Stainburn
Päiväys:  
Vastaanottaja: exim-users
Aihe: [exim] convert to pgsql - aliases with :fail:
Sorry if I'm flooding the list but I'm trying lots of new things and I'm
struggling. I think a big part of the problem is I'm thinking like a normal
liniar model bussiness system developer rather than an EXIM admin.

Anyway, on to my next question, relating to my move towards using Postgresql
more. At the moment I'm using /etc/aliases pretty much as expected. I want
to move some of this to the database.

In the file I have the follwing:

<all one line>
alias1:    :fail: This user is no longer available. For assistance please contact 
alias2@???


which then denies the email if sent to alias1


I'm looking to create an aliases table something along the lines of

localuser        varchar(80)
alias            varchar(80)
internalonly    boolean
allowfrom    boolean
allowto        boolean
redirectto        varchar(80)
failto        varchar(80)


I want to then replicate the currect action if a row exists with alias1 =
alias and failto is not null.

I'm guessing I need to do this as a router and here is the pseudo code I'm
thinking (taken from the localuser systemalias). Am I right, and what would
the correct syntax be?

failuser:
    deriver = redirect
    condition = ${lookup pgsql{select failto from aliases \
                where alias = '${quote_pgsql:$local_part}' \
                and failto is not null}}
   data = :fail: This user is no longer available. For assistance please \ 
            contact  <value returned from lookup