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 using API with emails

Discussion in 'cPanel Developers' started by Petya Shylov, Sep 19, 2012.

  1. Petya Shylov

    Petya Shylov Registered

    Joined:
    Sep 19, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Kyiv, Ukraine, Ukraine
    cPanel Access Level:
    Root Administrator
    We did some changes with website and got such error:


    Code:
    [17-Sep-2012 12:22:02 UTC] URL: https://222.222.222.222:2087/xml-api/cpanel
    [17-Sep-2012 12:22:02 UTC] DATA: rootdomain=outsitename.org&dir=public_html&domain=aasasaaa&cpanel_xmlapi_user=outsitename&cpanel_xmlapi_module=SubDomain&cpanel_xmlapi_func=addsubdomain&cpanel_xmlapi_apiversion=2
    [17-Sep-2012 12:22:02 UTC] Authentication Header: Authorization: Basic cm9vdDo5eDc2ZnU3YkRO
    After that we have this error:

    Code:
    [12-Sep-2012 12:22:02 UTC] RESPONSE:
    <?xml version="1.0" ?>
    <cpanelresult>
      <error>Access denied</error>
      <data>
        <result>0</result>
        <reason>Access denied</reason>
      </data>
    </cpanelresult>

    This error was occurred suddenly

    And we got such email - cpanel@mail.outsitename.org:
    Code:
    Note: If this is the first time you received this mail, it contains the history for the entire month so far.
    
    Below are the recently upload scripts that contain code to send email. You may wish to inspect them to ensure they are not sending out SPAM.
    
    /home/outsitename/public_html/protected/vendors/swift/lib/classes/Swift/Transport/MailInvoker.php:11: /**
    /home/outsitename/public_html/protected/vendors/swift/lib/classes/Swift/Transport/MailInvoker.php:12: * This interface intercepts calls to the mail() function.
    /home/outsitename/public_html/protected/vendors/swift/lib/classes/Swift/Transport/MailInvoker.php:13: * 
    ---
    /home/outsitename/public_html/protected/vendors/swift/lib/classes/Swift/Transport/MailInvoker.php:21

    The question is why CPANEL has blocked our account? How possibly we can turn off all anti-spam control in Cpanel using ROOT account?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    1. Could you let us know more details about the changes you made?

    2. I don't see a coloration between using API to add a subdomain, and receiving the email you provided. This email is sent out when scripts are uploaded that have the ability to send email. You can control how you are alerted about this by modifying the value for "Recently Uploaded Cgi Script Mail" in:

    "WHM >> Server Contacts >> Contact Manager"

    Thank you.
     
  3. Petya Shylov

    Petya Shylov Registered

    Joined:
    Sep 19, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Kyiv, Ukraine, Ukraine
    cPanel Access Level:
    Root Administrator
    Hello!

    We have made such script just to test the API

    Code:
    <?php
    // Connect to cPanel API
    include('xmlapi.php');
    
    //  Checking script
    $ip = '222.222.222.2222';
    $root_user = 'root';
    $root_pass = 'rootpass';
    
    $xmlapi = new xmlapi($ip, $root_user, $root_pass);
    
    print_r($xmlapi->listzones()); /
    When we run it, such error is occurred

    Code:
    SimpleXMLElement Object ( [error] => Access denied [data] => SimpleXMLElement Object ( [result] => 0 [reason] => Access denied ) )
     
Loading...

Share This Page