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!
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!
Just set the default address. It can be set to go to any address you want.
So I can have domain2.com : domain1.com ?
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
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?)
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.
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.
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...![]()
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.
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...
From www.exim.org:
Now, exactly what that means is a mystery to me so far...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![]()