[Exim] Domain Alias with Exim+MySQL

Top Page
Delete this message
Reply to this message
Author: Marcin Pyla
Date:  
To: exim-users
Subject: [Exim] Domain Alias with Exim+MySQL
Hi,

I'm using exim 4.0 with MySQL. Everything works fine, but now I need
add new option. I have tabel users and domains in MySQL:

users:

+-------------+-----------+------+-----+---------+----------------+
| Field       | Type      | Null | Key | Default | Extra          |

+-------------+-----------+------+-----+---------+----------------+
| id          | char(128) |      | PRI |         |                |
| password    | char(128) | YES  |     | NULL    |                |
| name        | char(128) |      |     |         |                |
| uid         | int(10)   |      | PRI | NULL    | auto_increment |
| gid         | int(10)   |      |     | 1000    |                |
| home        | char(255) |      |     |         |                |

...

domains:

+------------+---------------+------+-----+---------+-------+
| Field      | Type          | Null | Key | Default | Extra |

+------------+---------------+------+-----+---------+-------+
| userid     | varchar(128)  |      | MUL |         |       |
| ToDomain   | varchar(128)  |      |     |         |       |
| DomainDir  | varchar(255)  |      |     |         |       |

...

In table users I have for example:

+------------------+----------+------+------+-----+
| id               | password | name | uid  | gid |

+------------------+----------+------+------+-----+
| test@??? | PASSWORD |      | 1000 | 502 |

+------------------+----------+------+------+-----+
...

So field id is the email adres of the user.

+--------------+-------------+-----------+
| userid       | ToDomain    | DomainDir |

+--------------+-------------+-----------+
| domain1.com  |             | /         |

+--------------+-------------+-----------+
| domain2.com  | domain1.com | /         |

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

And now, what I need. When somebody write to test@??? everything
works fine and user get his mail. But now when somebody write to
test@??? the mail also should go to user test@???. Can I
change some how `local_part` ?



--
                            Marcin Pyla