Forwarding an entire domain to another mail server

Discussion in 'Server Operation' started by beckteck, Jan 12, 2011.

  1. beckteck

    beckteck New Member

    Here is the sit rep:

    I have my main server with Ubuntu 8.04lts and Postfix, mail.server.com

    I just commissioned a new server web1.server.com running ubuntu 10.04lts and postfix.

    My question is how do i make web1.server.com forward all mail for server.com to mail.server.com ?It always wants to try local delivery because of it's host name.

    I don't want it to forward all mail, just mail destined for server.com domain.

    Thanks for reading

    Beck
     
    Last edited: Jan 12, 2011
  2. falko

    falko Super Moderator Howtoforge Staff

    You can do this with Postfix transports.

    On the old server, create a Postfix transport now so that all emails are forwarded to the new server (for the time until the MX records of your domains have switched to the new server):

    Code:
    echo "*  smtp:[<IP address of new server>]" >> /etc/postfix/transport
    postmap /etc/postfix/transport
    /etc/init.d/postfix restart
    On the new server, open /etc/postfix/main.cf and add the hostname of the old server to the mydestination line so that the new server accepts the forwarded mails.
     
  3. beckteck

    beckteck New Member

    Thanks Falko,

    Although that is not exactly what I wanted to do, it did get me on the right track and was ablet to create a transport map for the new server to forward all of a certain domains mail to the old server.

    Code:
    echo "server.com smtp:server.com" >> /etc/postfix/transport
    postmap /etc/postfix/transport
    
    The old server is still up and controls the domain server.com. It will remain running.

    Thanks again.


    Beck
     

Share This Page