Handling mails for super-domain at an existing domain

sandip

Member
Aug 13, 2003
11
0
151
Delhi
I am trying to shift an account from a cobalt server to a RHL 7.3 cpanel server.

I have to host mail.domain.com on my new server, where domain.com/www.domain.com is already hosted elsewhere.

mail.domain.com just needs to be a webmail setup, and more importantly, this host needs to accept all mails coming to *@domain.com in addition to mails coming to *@mail.domain.com

Cobalt servers had this option in which xxx.domain.com can automatically handle mails coming for *@domain.com in addition to *@xxx.domain.com

How do I do the same in cpanel? I have already set the MX entry of domain.com to point to the new server.

I have tried messing around with /etc/localdomains and /etc/userdomains, but mails keep getting bounced or deferred in either case. :(

Is this setup possible using cpanel?

TIA,
Sandip
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,466
30
473
Go on, have a guess
I've just gone through this. Try these steps for example.com:

1. add the domain example.com to /etc/localdomains

2. create a file in /etc/valiases called example.com

3. add the following line to /etc/valiases/example.com

*: username

Where username is either the local username to receive the catchall email, or another email address.

I think that should do it. Let us know either way :)
 

sandip

Member
Aug 13, 2003
11
0
151
Delhi
Ok, I get your point .. it should work. but there are some problems.

One is that there is a possibility that a cpanel script tries to clean up the settings and removes all localdomains which are not linked to accounts.
Also, using a system catchall account for the domain removes the option for our clients to add mail accounts etc. using the control panel, forwards etc.

I have solved the problem in another way. I created an account for the top most domain, say example.com. Then created a subdomain using the control panel named mail.example.com.

After that I edited the DNS zone record for the domain and changed the A and CNAME records so that www.example.com and example.com point to the external server, and set the mx records to point to this subdomain.

Now my client can add/edit accounts from the control panel easily on his own.

Ofcourse, this means that the site and control panel now has to be accessed using either the IP address or the subdomain name. But that is a minor problem that the client can forgive.