Redirect Email for a hosted domain

Discussion in 'HOWTO-Related Questions' started by swamprat, Jan 10, 2008.

  1. swamprat

    swamprat New Member

    Hello,

    I'm using Centos5.

    I host a domain but the users of that domain don't want email on my server, they would like to have all email for all their users forwarded to their AOL account such as.

    info@xyz ---> [email protected]
    sales@xyz ---> [email protected]

    I'm using postfix.

    I'm a newbie and would need some step by step help in getting this done.

    Thanks
     
  2. volksman

    volksman New Member

    Depends on how you setup postfix. Can you dump your main.cf and post it here? Or describe your setup a little better...IE did you use a Howto from Howtoforge or did you build it from another document?
     
  3. c0mputernick

    c0mputernick New Member

  4. swamprat

    swamprat New Member

    Thanks all for your replies.

    Below is my main.cf as requested. A few words of clarification first as this might help.

    I'm a newbie. The domains (url's) that I host such as xyz.com don't actually exist on my machine where postfix resides. xyz and several others are MS/Front Page web sites hosted on a server behind my firewall with a internal IP of 192.168.xxx.xx.

    The fellow who set this up created virtual domains for these domains which some how point to the correct web site on the W3K box. Some when some one requests the page for xyz.com with an external IP of 216.254.xxx.xx it is found and the page is served up from the W3K box.

    So the external IP/URL somehow resolves to the proper local address (192...) on the W3K box.

    What the person who owns the xyz.com domain wants is to have all email which is directed to his web site not to reside in mail boxes on my local machine, he wants them forwarded to his AOL account...that's it. I don't have any idea if this can be done but if it can please give me a hand.

    Thanks...main.cf and virtual are listed below. I was trying this out with a few changes but I didn't get it to work.

    This set up is Postfix and Dovecot.

    My entries in these files are attached.
     

    Attached Files:

  5. c0mputernick

    c0mputernick New Member

    I cant really help you with your postfix problems, but i can tell you how your mail/web requests are handled.
    Its all in the router/firewall you have running on your network. When it gets a request for port 80(web traffic) it knows to forward the request to your local ip address for your w2k3 box. When you get email (port 25, 143, 110 etc) it should also know to forward the incoming packets to your mail server.
    it sounds like all that is already setup, you just need to tell postfix to forward some mail to another email address.
    but have a look at this and see if it helps:
    http://www.postfix.org/VIRTUAL_README.html#forwarding
     
  6. falko

    falko Super Moderator Howtoforge Staff

    Please run
    Code:
    postmap /etc/postfix/virtual
    /etc/init.d/postfix restart
     
  7. c0mputernick

    c0mputernick New Member

  8. swamprat

    swamprat New Member

    Hello all,

    I ran falko's commands...nothing happened.

    The real domain being hosted on this box has real mail boxes for real people so this wouldn't work.

    Of interest. Some processes on this machine produce email for a number of reasons...some errors, some information etc. They are all forwarded to root and to my yahoo account and this works but of more interest is Once when I sent a message to [email protected] it found itself in my yahoo mail box.

    Here is a message when trying to send a kmail message from my account to [email protected]

    Sending failed:
    Message sending failed since the following recipients were rejected by the server: [email protected] (The server responded: "5.1.1 : Recipient address rejected: User unknown in local recipient table")
    The message will stay in the 'outbox' folder until you either fix the problem (e.g. a broken address) or remove the message from the 'outbox' folder.
    The following transport protocol was used: rifkinho
    Do you want me to continue sending the remaining messages?
     
  9. rmccain

    rmccain New Member

    Have you looked at the nameserver that resolves these sites?

    I use EditDNS for my nameservers, and it is pretty easy to add entries like:

    userdomain.tld NS ns.newhost.tld so you can switch an entire domain without having to go to a registrar.

    An entry like userdomain.tld MX 5 user.mail.newhost.tld may be able to switch all the mail to a different location than the web sites. (never tried this one but it might work?)

    Otherwise, If you want a specific user to get the mail look at the VirtUserTable in your MTA and add an entry like
    @userdomain.tld [email protected]
     
  10. swamprat

    swamprat New Member

    Nothing in VirtUserTable
     
  11. rmccain

    rmccain New Member

    Does that mean that nothing has been entered in the virtusertable or that you can make no changes there?

    If you don't see anything in virtusertable, what you are looking for may be in the aliases file. Items in aliases are much more likely to be globals. For example: Your mail person might have a local account on the server with a name like firstlast.

    Looking in aliases you may find a line under remote users that reads:
    firstlast [email protected]

    So any usernames (like postmaster, root, etc) or entire domains (like @domain.tld) in the virtusertable that map to firstlast will then be sent to [email protected].
     
  12. volksman

    volksman New Member

    Yep...As per above check /etc/aliases....a good clue will be your yahoo account may be mapped in there....if you change the aliases file then you will need to run 'newaliases' when done (and I think even a postfix restart) for them to take effect.
     

Share This Page