|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Juan Miscara (pmatulis
sympatico.ca)
Date: Wed Jun 06 2007 - 18:35:05 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Le Vendredi 1 Juin 2007 12:57, mouss a écrit :
> Juan Miscaro wrote:
> > --- mouss <mlist.only
free.fr> wrote:
> >> Juan Miscaro wrote:
> >>> I'm using an SQL backend where I have a table for system users such
> >>
> >> as
> >>
> >>> postmaster and root that point to remote addresses and a table for
> >>
> >> my
> >>
> >>> Maildir users. I'm sorry I don't have the proper table terminology
> >>> (I'm temporarily locked out of my system) but the way I read your
> >>> comment my additions should be made to the same table and that
> >>
> >> doesn't
> >>
> >>> seem possible with my setup.
> >>
> >> multiple tables can be joined to form a single table in multiple
> >> ways.
> >> for example:
> >>
> >> query = select target from db1.table1, db2.table2, .... where ....
> >>
> >> you can also use CASE WHEN... and other statements if you only want
> >> to
> >> do some queries in some cases.
> >
> > You went a bit over my head mouss. This is what I have:
> >
> > virtual_mailbox_domains =
> > mysql:/etc/postfix/sql/virtual_mailbox_domains.cf
> > virtual_uid_maps = mysql:/etc/postfix/sql/virtual_uid_maps.cf
> > virtual_gid_maps = mysql:/etc/postfix/sql/virtual_gid_maps.cf
> > virtual_mailbox_maps =
> > mysql:/etc/postfix/sql/virtual_mailbox_recipients.cf
> > virtual_alias_maps = mysql:/etc/postfix/sql/virtual_alias_maps.cf
> > virtual_transport = maildrop
> >
> > $ cat virtual_mailbox_recipients.cf
> >
> > user = postfix
> > password = password
> > dbname = mail
> > table = virtual_users
> > select_field = virtual_mailbox
> > where_field = email
> > additional_conditions = and active = '1'
> > hosts = robby.example.com
> >
> >
> > $ cat virtual_alias_maps.cf
> >
> > user = postfix
> > password = password
> > dbname = mail
> > table = virtual_aliases
> > select_field = virtual_user_email
> > where_field = alias
> > hosts = robby.example.com
> >
> >
> > Where do I construct the query you speak of?
>
> but you can put multiple tables in the table field. for example:
>
> table = table1, table2
> or
> table = db1.table1, db.2table2
>
> of course, you can put explicit JOIN statements.
>
>
> If you have recent postfix, I prefer the new way: you can replace your
> last map with this
>
> hosts = robby.example.com
> user = postfix
> password = password
> dbname = mail
> query = select virtual_user_email from virtual_aliases where alias = '%s'
>
> now you see how to play with sql...
mouss,
Thank you for showing me the new way but I fail to see how changing to a new
syntax will help me. From what I see it is a precedence issue. Postfix uses
the virtual_alias_maps table and stops. It ignores the virtual_mailbox_maps
table. Can you be more explicit on how I can have an incoming message sent
to both to a remote address as well as a local one?
Thanks in advance.
Juan
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]