The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Forwarding mail from one domain to another

Discussion in 'E-mail Discussions' started by TechGuy, Oct 21, 2003.

  1. TechGuy

    TechGuy Well-Known Member

    Joined:
    Nov 29, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    How can I easily have all mail sent to @domain2.com to automatically be redirected to @domain1.com... (without setting up a forward for each individual user)

    Both domains run on cPanel, so I don't think MX will be the solution.

    Thanks!
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Just set the default address. It can be set to go to any address you want.
     
  3. TechGuy

    TechGuy Well-Known Member

    Joined:
    Nov 29, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    So I can have domain2.com : domain1.com ?
     
  4. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    I think (I'm not sure though) the file /etc/valiases/oldmail.com would be this-

    *: @newmail.com



    That would forward mail originally to mike@oldmail.com to mike@oldmail.com

    I've never actually tried this, so no gaurantees
     
  5. TechGuy

    TechGuy Well-Known Member

    Joined:
    Nov 29, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    I'm pretty new to cPanel.

    Assuming that works (I haven't tried it yet) -- is it safe to change such files? (Will cPanel undo those changes during upgrades, domain changes, etc?)
     
  6. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Yes it is safe. Cpanel's settings are decentralized - they're stored in files like this. cPanel will read them in to display them in the gui.

    You might also be able to make this chane in cPanel, without editing this file. Just enter @newemail.com in the default address in cPanel.
     
  7. TechGuy

    TechGuy Well-Known Member

    Joined:
    Nov 29, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    Tried your (in-cPanel) suggestion, elleryjk, but no dice. cPanel actually responds with an error indicating that @domain1.com isn't a valid email address. I'm going to try editing the files now, although it's kind of a shame that cPanel doesn't offer this in the front-end yet.
     
  8. TechGuy

    TechGuy Well-Known Member

    Joined:
    Nov 29, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    I just tried editing the file, but that doesn't seem to work either... what's weird, though, is that the mail didn't bounce... it just doesn't show up at the other end. There has to be a way of doing this, though! It was so easy in sendmail... :)
     
  9. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Do you mean you want:
    sample1@oldmail.com --> sample1@newmail.com
    sample2@oldmail.com --> sample2@newmail.com
    sample3@oldmail.com --> sample3@newmail.com

    or do you want:
    anything@oldmail.com --> something@newmail.com

    The second one is what I was explaining. To do that, just set the default address in cpanels mail functions to route all mail to something@newmail.com, or just put
    *: something@newmail.com
    in the valiases file.

    If the first one is the one you want, I'm not sure if there is an easy way to do that.
     
  10. TechGuy

    TechGuy Well-Known Member

    Joined:
    Nov 29, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    Yup, I'm looking for the first one. It's pretty easy in Plesk and Sendmail... I can't figure out why cPanel wouldn't have some function for it. I'm sure Exim does, but I'll have to find it. It's very useful for domain names with alternative spellings, brandings, etc...
     
  11. TechGuy

    TechGuy Well-Known Member

    Joined:
    Nov 29, 2001
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    From www.exim.org:

    Now, exactly what that means is a mystery to me so far... :)
     
Loading...

Share This Page