Re: [Exim] Ok, I'm losing it....(exim 4.22/exiscan-acl-4.22-…

Top Page
Delete this message
Reply to this message
Author: Rossz Vamos-Wentworth
Date:  
To: exim-users
Subject: Re: [Exim] Ok, I'm losing it....(exim 4.22/exiscan-acl-4.22-12).
> domains = pgsql;select domain from virtdomains where
domain='$domain';

This makes no sense. It looks like you are retrieving the domain
name (actually, multiple copies) if the domain name matches. If you
only want a single copy, include "DISTINCT" after the SELECT (well,
in mysql that's what you do). However, unless I'm mistaken, this
whole query can be skipped.

If you are trying to make sure it's a domain you handle mail for, you
should be putting your domains in 'domainlist'. I retrieve my list
from the database with this:

VIRTUAL_DOMAINS = SELECT DISTINCT concat(domain, ' : ') \
    from users where domain != 'admin';
domainlist local_domains = localhost : \
    ${lookup mysql{VIRTUAL_DOMAINS}}


(the admin domain is used to hold adminstrator information so is
ignored here).

>   data = ${lookup pgsql \
>          {select rhs from virtusers where \
>                  lhs='${quote_pgsql:$local_part@$domain}'}\
>          {$value}{${lookup pgsql {select rhs from virtusers where \
>                     lhs='${quote_pgsql:@$domain}'}}}}



The query I use (with mysql) is:

data = ${lookup mysql{select pophome from users where username =
'${local_part}@${domain}'} }

Where pophome is the path to the mailbox and username contains the
entire email address (e.g. user@???). You could just as
easily concat the data (untested):

data = ${lookup mysql{select pophome from users where concat(name,
'@', domain) = '${local_part}@${domain}'}}

Adjust as needed for pgsql.

Rossz

P.S. We're in the process of writing VExim 2.0 with postgresql
support. Unfortunately, it will probably be a while before it is
completed. I'll bet it wouldn't be too hard to modify vexim 1.4 to
support postgresql, though. http://silverwraith.com/vexim/


--
Fogalmam sincs, mi van ide írva.