[exim] Best approach for simple MySQL & 'Virtual' Domain/Use…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Ron White
Date:  
À: exim-users
Sujet: [exim] Best approach for simple MySQL & 'Virtual' Domain/Users?
I'm looking to deploy a simple Exim instance which does nothing more
than accept inbound email based upon a simple MySQL query.

The word 'Virtual' domains and users can be a little muddy at times, but
by it I mean the server will take mail for various domains and
recipients - rather than users of the operating system itself.

The file structure the transport will append to
is /var/mail/<DOMIAN>/<RECIPIENT>

And the SQL to check the domain and recipient are valid is:

SELECT mailbox FROM mailusers WHERE domain='${quote_mysql:$domain}' AND
username='${quote_mysql:$local_part}' AND remote=0;

For the life of me I can't remember how to set this up! I can't figure
which ROUTER to set up to do this.

I have a feeling I'll need an ACL on that query which I then pick out
with a router - but before I go barking up the wrong tree, is there a
simple way of having the router jump to a transport if the query
matches, whilst expanding 'domain' and 'local_part' along the way?

The transport, I guess, will be something like this:
local_mysql_delivery:
        driver  = appendfile
        directory = /var/mail/${domain}/${local_part}/
        maildir_format
        delivery_date_add
        envelope_to_add
        return_path_add


It's just the routing that is making me struggle a little. It's probably
really obvious, but I'm not the smartest guy in the world.

Any pointers or help appreciated.

Ron