[exim] Exim + MySQL + Aliases

Top Page
Delete this message
Reply to this message
Author: Alvaro Marín
Date:  
To: exim-users
Subject: [exim] Exim + MySQL + Aliases

Hello Exim Users,

I've installed Exim from the Debian package and I'm having some problems
with it's configuration.

My idea is to set up an Exim server with MySQL. It would have 2 tables,
one for domains and other one for aliases. The only function of this
server would be get the email, check if the incoming email's TO has one
record on the aliases table and send this mail to it's value. No local
delivery would be done.

I've tried with some configurations that I've found on Internet, but no
one seems to work...all mails are stored in the queue without any error.

MySQL connection is done fine, as I see in MySQL logs.

The configuration that I've changed is:

domainlist local_domains = \
   ${lookup mysql {SELECT domain FROM domains \
     WHERE type="local" and domain="${domain}" }}
domainlist relay_to_domains = \
   ${lookup mysql {SELECT domain FROM domains \
     WHERE type="relay" }}


And in the domains table from DB I've:

+-----------------+-------+
| domain          | type  |

+-----------------+-------+
| domain1.com     | local |
| domain2.com     | relay |

+-----------------+-------+

In router section, I have this:

mysql_aliases:
   driver = redirect
   allow_fail
   allow_defer
   data = ${lookup mysql{ SELECT dest FROM aliases \
             WHERE email='${local_part}@${domain}'}}


And the aliases table is:

+------------------------+-------------------+
| email                  | dest              |

+------------------------+-------------------+
| user@???       | user@???  |

+------------------------+-------------------+


As I've said, I only want Exim to check if the domain of the incoming
mail is "local" (is in DB), and then use mysql_aliases to redirect it to
other direction.

What I'am missing?

Thanks in advance.

Regards,
Alvaro.