Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 11 of 11
  1. #1
    Member
    Join Date
    Nov 2001
    Posts
    56

    Question Forwarding mail from one domain to another

    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. #2
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    Just set the default address. It can be set to go to any address you want.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  3. #3
    Member
    Join Date
    Nov 2001
    Posts
    56

    Default

    So I can have domain2.com : domain1.com ?

  4. #4
    Member
    Join Date
    Apr 2003
    Posts
    479

    Default

    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. #5
    Member
    Join Date
    Nov 2001
    Posts
    56

    Default

    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. #6
    Member
    Join Date
    Apr 2003
    Posts
    479

    Default

    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. #7
    Member
    Join Date
    Nov 2001
    Posts
    56

    Default

    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. #8
    Member
    Join Date
    Nov 2001
    Posts
    56

    Default

    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. #9
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    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.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  10. #10
    Member
    Join Date
    Nov 2001
    Posts
    56

    Default

    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. #11
    Member
    Join Date
    Nov 2001
    Posts
    56

    Default

    From www.exim.org:

    Q0426: One of the things I want to set up is for anything@onedomain to forward to anything@anotherdomain. I tried adding $local_part@anotherdomain to my aliases but it did not expand - it sent it to that literal address.

    A0426: If you want to do it that way, you can make it expand by setting the expand option on the redirect router. Another approach is to use a router like this:

    forwarddomain:
    driver = redirect
    domains = onedomain
    data = $local_part@anotherdomain
    Now, exactly what that means is a mystery to me so far...

Similar Threads & Tags
Similar threads

  1. Replies: 6
    Last Post: 12-30-2003, 06:19 PM
  2. forwarding all mail to different email at separate domain
    By bobbybobbertson in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-17-2003, 02:55 PM
  3. Domain & Mail Forwarding
    By stoo2000 in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 08-24-2003, 03:39 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube