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.

Problem with mailform when dns/email is located externally

Discussion in 'Bind / DNS / Nameserver Issues' started by torkil, Sep 12, 2006.

  1. torkil

    torkil Member

    Joined:
    Sep 12, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    The situation:
    We host a website for a client, clientname.com, but another company has the DNS and their e-mail accounts. No problem: The other company just sets their A-record to point to our webserver. Now we have set up a standard contact mailform on the clients website, using php's mail function to let the clients visitors send e-mails to the client.

    Problem: No e-mails ever arrive!
    Background for problem: The cPanel account is automatically created with MX record being clientname.com, when the MX record should really read mail.othercompany.com since they are the ones hosting the e-mail. So our webserver is in fact trying to send mail to itself, where there are no email accounts set up.

    Half-a-solution:
    I insert the correct MX record for clientname.com in our cPanel. But this leaves us with...:

    New problem: What if the other company that hosts the domain and the email decides to change the MX record? We would never know about it, and emails would get stopped again.

    So can anyone give me a suggestion for a more permanent solution to this problem? It would really make my day...
     
    #1 torkil, Sep 12, 2006
    Last edited: Sep 12, 2006
  2. ujr

    ujr Well-Known Member

    Joined:
    Mar 19, 2004
    Messages:
    290
    Likes Received:
    0
    Trophy Points:
    16
    well, that is somewhat out of your control, however, you could test that the mailserver exists and that you can connect to it BEFORE you send your email. If it fails, just make it send you a an email stating that it's unreachable.

    Other than that, the MX handler would need to be changed for the domain if the mailserver changes.
     
  3. torkil

    torkil Member

    Joined:
    Sep 12, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your response!

    So you basically think my best option would be to try to convince the client to host his DNS with us, so we have control of the MX record?

    ... or is there a "disable MX-automation" or something like that in the account setups anywhere?
     
  4. ujr

    ujr Well-Known Member

    Joined:
    Mar 19, 2004
    Messages:
    290
    Likes Received:
    0
    Trophy Points:
    16
    Ideally, for control, yes... but there may be other reasons why a client may want to point their MX records to some other server.

    Anyway, why must the email be sent through the remote SMTP server anyway? Couldn't your form simply use php mail?
     
  5. torkil

    torkil Member

    Joined:
    Sep 12, 2006
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    This happens with the php mailer too, I've spotted the problem in all the following applications:

    - Regular contact form, using php's mail() function
    - E-mails going out of our webbased CRM solution, using sendmail
    - E-mails going out of our customer's mailing list, probably using php's mail() function too
     
Loading...

Share This Page