Loading ...
Sorry, an error occurred while loading the content.

204567Re: Forwards with MySQL

Expand Messages
  • Kai Fürstenberg
    Sep 1, 2006
    • 0 Attachment
      Alvaro Marín wrote:
      > Hi,
      >
      Hello,

      > I've configured Postfix to use MySQL tables with alias or forwardings:
      >
      > virtual_alias_domains=mysql:/etc/postfix/mysql-virtual_domains.cf
      > virtual_alias_maps=mysql:/etc/postfix/mysql-virtual_aliases.cf
      >
      > where alias_domains table has for example:
      >
      > "domain.com"
      >
      > and the alias_maps table:
      >
      > "oneuser","domain.com","otheruser@..."
      >
      > This example runs fine, but if for example I add "otherdomain.com" to
      > alias_domains table, it search for the user "otheruser" in MySQL table
      > (logically) instead of send the mail to the MX.
      >
      > Is there any way to send directly the message to the "otherdomain.com"'s
      > MX without searching on the table again?
      >
      You can use transport_maps. Forward otheruser@... via smtp
      to the other MX. Anyhow you should/must add this user to the table:
      "otheruser","otherdomain.com","otheruser@...". Postfix
      always looks in the table but the alias mapping is the same. It then can
      take the transport_maps to forward the message to a different server.

      > Other thing that I want to ask is that if the alias_maps table has only
      > 2 fields (alias and destination) I can use for example:
      >
      > @... -> ouser@...
      >
      > to forward all the accounts from @domain to other account, but if I
      > create that table with 3 fields (alias_user, alias_domain and
      > destination) this doesn't work...any idea?
      >
      This should have something to do with how you specify the MySQL-query
      and how you created the table. For MySQL it is a difference if you have
      an empty string for alias_user or if you have NULL.

      --
      Greetings
      Kai
    • Show all 11 messages in this topic