Re: [exim] mysql config

Top Page
Delete this message
Reply to this message
Author: Niels Dettenbach
Date:  
To: exim-users
Subject: Re: [exim] mysql config
Am Mittwoch, 12. August 2020, 18:33:52 CEST schrieb Dan Egli via Exim-users:
> I'm trying to setup exim to read a mysql database to identify users and
> their maildirs. I used an example from the internet but apparently it's for
> too old a version of exim or something because it says the router should
> use the aliasfile driver,but exim says it can't find an aliasfile driver.


I use such routers (with redirect - just a simple example):

        mysql_aliases:
                driver          = redirect
                allow_fail
                allow_defer
                data            = ${lookup mysql {MYSQL_LOCAL_DEST}{$value}}
                user            = mail
                file_transport  = address_file
                pipe_transport  = address_pipe




somewhere top in global config:

# MySQL connection
## MySQL defines
MYSQL_SERVER=localhost
MYSQL_USER=maildb
MYSQL_PASSWORD=**********
MYSQL_DB=maildb
hide mysql_servers = "MYSQL_SERVER/MYSQL_DB/MYSQL_USER/MYSQL_PASSWORD"

MYSQL_DOMAIN=SELECT DISTINCT domain_name FROM domaindb WHERE domain_name='$domain'
MYSQL_LOCAL_DEST=SELECT dest FROM aliasesdb WHERE alias='$local_part@$domain' OR alias='$local_part'

# you should adapt the SQL to your database structure / layout.

You may use

exim -bt -d test@???

to debug the address resolution / routing etc. from console.

Not sure if this is conform to the new de-taint mech in exim 9.94, but it still seems to work.


hth,


niels.

--
---
Niels Dettenbach
Syndicat IT & Internet
http://www.syndicat.com
PGP: https://syndicat.com/pub_key.asc
---