Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jul 2010
    Posts
    22

    Question Email::delmx function doesn't delete MX entry

    I have a script that uses the cPanel XML API2 to set up a domain with the MX entries required to forward mail to Google Apps (7 different MX entries with varying priorities).

    Since by default every domain in our system has an MX entry that points to itself with a priority of 0, I set up the first part of my Google Apps script to check for this original MX entry and delete it before adding the new ones.
    Using the Email::listmx function I can find the entry fine, and then the script uses the Email::delmx function (with all three parameters) to attempt to delete that original entry. The delmx function comes back with a result of 1 (success), and then when I log in to cPanel and check the MX entries for the domain it says there aren't any.
    However when I run the listmx function again for that domain it still shows the original MX entry. It also shows up in WHM.

    Any ideas? Thanks!

  2. #2
    Member
    Join Date
    Jul 2010
    Posts
    22

    Default Re: Email::delmx function doesn't delete MX entry

    Update:
    I tried deleting the MX from WHM and that doesn't get rid of it either. I also tried restarting the BIND service but it still shows up.
    I don't know why I didn't think of this before but I'm going to try adding the new MX entries first and THEN removing the original

  3. #3
    Member
    Join Date
    Jul 2010
    Posts
    22

    Default Re: Email::delmx function doesn't delete MX entry

    That fixed it! Woot for self-solving threads.

  4. #4
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default Re: Email::delmx function doesn't delete MX entry

    I'm glad that you were able to resolve your own issue, but I'm curious as to what the problem was so that someone who encounters the same program in the future may address it.
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  5. #5
    Member
    Join Date
    Jul 2010
    Posts
    22

    Default Re: Email::delmx function doesn't delete MX entry

    For some reason it seems if a domain only has one MX entry you can't delete it. You'll get a success message but it's a false positive.
    The solution was to add the new MX entries first and then delete the original first entry. Hope that helps someone in the future.

Similar Threads & Tags
Similar threads

  1. Urgent:How do i Delete a DNS entry if it DOES NOT exist
    By Quadragon in forum cPanel and WHM Discussions
    Replies: 13
    Last Post: 10-16-2005, 06:49 PM
  2. function mail() doesn't work
    By DjMiX in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-13-2005, 02:13 PM
  3. delete DNS entry
    By _MID_Matrix in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 02-16-2004, 10:39 AM
  4. Function Mail (PHP), it doesn't work!
    By jpvechor in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-07-2003, 10:20 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube