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

Re: Managing Mail between two domains

Expand Messages
  • mouss
    ... create table mailbox (user ..., domain, ....) ... create table alias_domain (alias ..., target ....) .... ... insert into mailbox values ( wjames ,
    Message 1 of 2 , Jan 30, 2007
    View Source
    • 0 Attachment
      Wire James wrote:
      > Hi All
      >
      > I have situation where a client has a current domain dxx.co.ug and
      > would like to change to dxx.go.ug. I set up their mail server with
      > Postfix+Mysql and all users are in a database. However I dont want to
      > create two independent user databases for the different domains.
      >
      > What I want is automatic transfer of mail if it comes to say
      > admin@... to go to admin@... and the same should happen to
      > all the other users. Any pointer on a resource that can be helpful in
      > achieving this? Remember I am using postfix integrated with Mysql.
      >


      create table mailbox (user ..., domain, ....) ...
      create table alias_domain (alias ..., target ....) ....
      ...
      insert into mailbox values ('wjames', 'dxx.go.ug');
      insert into alias_domain values ('dxx.co.ug', 'dxx.go.ug');
      ...



      virtual_alias_maps = ..... mysql:/etc/postfix/per-domain-alias.cf ...

      in the latter,

      query = select concat(user, '@', domain) from alias_domain, mailbox
      where %d = alias and domain = target

      The idea is to only return a result if the "target" address exists
      (otherwise, you break recipient validation).

      then check with 'postmap -q':

      # postmap -q wjames@... mysql:/etc/postfix/mailbox.cf
      ...
      # postmap -q wjames@... mysql:/etc/postfix/per-domain-alias.cf
      ...
    Your message has been successfully submitted and would be delivered to recipients shortly.