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.

Mail relay to an IP address

Discussion in 'E-mail Discussions' started by VapourMike, Jan 5, 2010.

  1. VapourMike

    VapourMike Member

    Joined:
    Jul 5, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South East UK
    Hi,

    For ages Ive had emails for a domain coming through an email server hosted on our DSL connections at work (self hosted), we also have a linux box hosting 6x websites, now one of these websites uses email a lot and this email needs to come into our mailserver.

    So in essense, thisdomain.co.uk is on the cpanel server and our mailserver is on IP 123.456.789.000 ... how can I setup cpanel/whm so that ANY email request that comes in on thisdomain.co.uk is pushed to the IP 123.456.789.000.

    Thanks
    Mike
     
  2. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    So you are talking about emails delivered to that domain from a form on the website? What you need to do is remove the domain from /etc/localdomains and add it to /etc/remotedomains . That will tell the system not to store email for it and to check for other mailservers.
     
  3. VapourMike

    VapourMike Member

    Joined:
    Jul 5, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South East UK
    Not really, let me try and explain a bit more.

    We currently have a domain (mydomain.com) which was used purely for emails, it was hosted by fasthosts and we used their nameservers so that mail went to the IP address of our mailserver.

    Now due to expansion of the company, they now have a linux based server running WHM/Cpanel, I have now set the domain to use the nameservers for this linux server.

    However this means that any emails that come to the domain are being dealt via exim that's on the server, this is fine for all the other sites on there, but I need this sites emails to go to the IP address of the mailserver we have here.

    I have tried going to whm and setting the DNS by adjusting the MX record but you cannot put an IP address in the MX record ...

    The only option ive come across is to setup a catch all email address and then set my mailserver here to collect (domainpop) from this catch all every 30 seconds, this isn't ideal for obvious reasons as Id rather do it on a DNS level and relay the mail to the correct server from the start.
     
  4. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    You MX record should be something like mail.domain.com, leave that. What you want to modify is the A record for mail.domain.com. That should fix you up and is a lot better then trying to hack it.
     
  5. VapourMike

    VapourMike Member

    Joined:
    Jul 5, 2003
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South East UK
    So if I just set the mail A record to be the IP address of the mailserver then it should work as intended? Ill give it a try now.
     
  6. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    Yeah that is all you need to do and email will go to that IP.

    If your email is going elsewhere other then where the website is hosted you should still look at the local/remote domains file. That will make sure any email sent via website forms (if you have any) get to your new mailserver, if not they will stay on the server.
     
Loading...

Share This Page