Postfix-MysqlI have a problem. Im running a Postfix with lots of forwarded addresses in the aliases file. Recently we decided to move all the entries from the very unhandy static file (which you have to rebuild after every change) to a MySQL-Database. The reason is obvious: Its easier to manage, and one day you can take that Ruby on Rails book thats been rotting in the shelf and write a cool webinterface to manage those forwards.

Everything went well so far (even learned some sed/awk in the process), but i still have a problem. In the original aliases we had groups you could mail to. This means mail_to_file. The record looked a little like this:

foo:  :include:/path/to/file-with-mail-addresses

So every time a mail was sent to foo@ it was automatically mailed to all the recipients defined in the remote file (Postfix did all of this, so we didnt have to use some mailing-list software). Now, i’d like to know how to include these in a mysql database. I _can_ create a mysql record which points to the file, no problem, but then we would have all our forwards in the database and the groups in files flying around. And nobody wants that.

So my question: How would you do it? Is there a solution to maybe reference another mysql table which stores the mail-addresses for the group? Help is appreciated ;)