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.

Receive mail to subdomain on different server

Discussion in 'E-mail Discussions' started by sebandrei, Feb 24, 2016.

  1. sebandrei

    sebandrei Registered

    Joined:
    Feb 24, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Europe
    cPanel Access Level:
    Reseller Owner
    Hello,

    I'm using a cPanel/WHM reseller account and am trying to receive emails sent to a subdomain on a different email server.

    I came across this thread which details a similar issue to the one I am trying to solve. However, as its over 4 years old, the system advised me not to bump it.

    Here is a detailed account of this issue:

    I have a domain mydomain.com where i receive email to an external provider because I need Exchange which my host doesn't support. So for mydomain.com, I have an MX record which points to my external email host. Of course the disadvantage of this setup is that I cannot use the POP3 and IMAP capabilities which my web host provides. As Exchange accounts are expensive, I am also not in a position where I can simply add more to cover my needs.

    As a solution, I thought about using a subdomain sub.mydomain.com to receive mail on my host. So I added an MX record for sub.mydomain.com which points to mydomain.com as this is where the mail server is located. However, any mail which i send to say user@sub.mydomain.com never arrives. In fact, it is never even returned to the originating email address. I have no idea what happens to it.

    I'm guessing that the problem is that the MX record for the subdomain is routing the mail to mydomain.com just fine, but then from there the MX record for mydomain.com is routing it on to my Exchange host. As the corresponding address/account doesn't exist there, it never arrives ... of course.

    Logically, it seems that one solution would be to use Exchange via the subdomain. This isn't ideal for me for a number of reasons.

    Is it at all possible to accomplish what I am trying to do? Is there something I might have overlooked?

    Any help would be appreciated.

    Kinds regards,

    Seb.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you verify if the subdomain is added to the /etc/localdomains file on the cPanel server? Have you tried searching /var/log/exim_mainlog for any email accounts associated with the subdomain? EX:

    Code:
    exigrep user@sub.domain.com /var/log/exim_mainlog
    Thank you.
     
    sebandrei likes this.
  3. sebandrei

    sebandrei Registered

    Joined:
    Feb 24, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Europe
    cPanel Access Level:
    Reseller Owner
    Hi Michael,

    First of all, thank you for your reply.

    I checked at both the cPanel and WHM level for the localdomains file and exim_mainlog. I couldn't find either of them. Furthermore, exigrep doesn't seem to be available on my server. Could it be that I don't have sufficient permissions to access these files? Is there any other way I can check?

    Thanks again for your help.

    Best regards,

    Sebastian

    Edit: My host has just confirmed that I do not have access to the these logs - they are limited to the root user.
     
    #3 sebandrei, Feb 24, 2016
    Last edited: Feb 25, 2016
  4. PHILLIP BOOTH

    PHILLIP BOOTH Member

    Joined:
    Dec 6, 2015
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    If you need to retrieve emails from an inbox on an external server and then forward them to another email address you can use something like fetchmail with a cron

    ssh # yum install fetchmail

    # nano ~/.fetchmailrc

    set no spambounce
    poll mail.example.com proto POP3 auth password port 110 timeout 300
    user 'account@example.com' there with password "12345"
    sslproto ""
    is "toaccount@example2.com" here
    options nokeep;

    ssh # fetchmail
     
  5. sebandrei

    sebandrei Registered

    Joined:
    Feb 24, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Europe
    cPanel Access Level:
    Reseller Owner
    Hi Philipp,

    Thanks for your reply.

    I'm not sure this will solve my problem.

    Essentially, at the most basic level, what I am trying to do is receive mail to one domain via two different servers. I am hoping to accomplish that by using one MX record to route mail from my main domain to my Exchange host and using another MX record for a subdomain to route mail to my other POP3/IMAP mail server.

    I'm not sure if what you propose above can do this...

    Kind regards,

    Sebastian
     
  6. sebandrei

    sebandrei Registered

    Joined:
    Feb 24, 2016
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Europe
    cPanel Access Level:
    Reseller Owner
    Hello,

    I just wanted to post to say that I am successfully receiving mails on my subdomain account. I have no idea how or why - I didn't change anything since yesterday. Perhaps it was just a matter of DNS propagation... I'm not sure.

    Kind regards,

    Sebastian
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I am happy to see the issue is now resolved. It's possible there was an issue with the email routing for the domain name, but it's difficult to pinpoint any particular reason without root access to the system. Thank you for updating us with the outcome.

    Thank you.
     
Loading...

Share This Page