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.

Moved to new server - PHP contact forms stopped working

Discussion in 'E-mail Discussions' started by Manny89, Dec 3, 2013.

  1. Manny89

    Manny89 Registered

    Joined:
    Nov 24, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello everybody,

    I recently moved my websites from one hosting company to another, where I am running on a VPS. I have root access to SSH and am also able to get into WHM, so any help here would be much appreciated.

    Using DNS and MX, all mail accounts for my (and clients) websites go through Gmail or Outlook. Emails sent from those interfaces are going out as they should, while anybody who emails directly is also able to get their messages through.

    Now, I have contact forms on several sites which have suddenly stopped sending mail since the server move. I'm not finding any PHP errors, so I was directed to my exim_mainlog file.

    Here is an example of what I received after my latest attempt at a form submission.

    Code:
    2013-12-03 23:23:42 cwd=/user/public_html/domain.com 3 args: /usr/sbin/sendmail -t -i
    2013-12-03 23:23:42 1VnzJe-0005LS-GN <= user@server.domain.com user P=local S=527 T="The test for php mail function" for admin@domain.com
    2013-12-03 23:23:42 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1VnzJe-0005LS-GN
    2013-12-03 23:23:42 1VnzJe-0005LS-GN ** user@domain.com R=virtual_aliases: No Such User Here
    2013-12-03 23:23:42 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1VnzJe-0005LS-GN
    2013-12-03 23:23:42 1VnzJe-0005LX-Ie <= <> R=1VnzJe-0005LS-GN U=mailnull P=local S=1435 T="Mail delivery failed: returning message to sender" for user@server.domain.com
    2013-12-03 23:23:42 1VnzJe-0005LS-GN Completed
    2013-12-03 23:23:42 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1VnzJe-0005LX-Ie
    2013-12-03 23:23:42 1VnzJe-0005LX-Ie => user <user@server.domain.com> R=localuser T=local_delivery
    2013-12-03 23:23:42 1VnzJe-0005LX-Ie Completed
    
    I have replaced all instances of usernames and the server name.

    DNS and MX all appear to be correct, but I just can't get contact forms to work at all. Any help would be greatly appreciated.
     
  2. LDHosting

    LDHosting Well-Known Member

    Joined:
    Jan 19, 2008
    Messages:
    93
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Take a look at WHM -> Edit a DNS Zone -> domain.com.

    As you are using external mailservers, make sure that the MX entries there are correct. Also, at the bottom of the page, make sure that email routing is set to 'remote mail exchanger'.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Yes, check to see if the domain name exists in the /etc/remotedomains file. If it's not in that file, use the instructions from the previous post to ensure it's added to it.

    Thank you.
     
  4. Manny89

    Manny89 Registered

    Joined:
    Nov 24, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Thank you for the feedback. All my domains are set to the recommended 'Automatically Detect Configuration', which is being displayed as local in my cPanel. My /etc/remotedomains file is empty so I'll make that change, but I do have one further question.

    My hosting company - heartinternet.co.uk - provide a DNS and MX interface as a domain registrar. All my settings have been made with the registrar and I was told that if I use their nameservers, I wouldn't have to enter any DNS or MX settings inside cPanel - as the registrar settings would take priority. To the best of your knowledge, are they correct here or have I been given false information?

    I only say this because my MX inside cPanel and WHM has a priority of 0 and points to domain.co.uk, but my registrar is all set up and stored to use either Gmail or Outlook.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Yes, it's correct that no DNS changes are required on the cPanel server if you have DNS handled on a remote server (e.g. your registrar). However, the change mentioned regarding the "Email Routing" value is not necessarily a DNS change, so using the "Edit a DNS Zone" option in this case is necessary.

    Thank you.
     
  6. Manny89

    Manny89 Registered

    Joined:
    Nov 24, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    That's great. It's not a major job if the DNS had to me replicated, but there's obviously no point in doing it twice if once is sufficient enough.

    I have changed settings to 'Remote Mail Exchanger' and all my websites appear to be working again. I'm awaiting feedback from a number of clients, but I'm confident this issue should now be resolved.

    Thank you both for your help.
     
Loading...

Share This Page