Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

SOLVED Track Delivery API

Discussion in 'cPanel Developers' started by swbrains, Mar 22, 2016.

Tags:
  1. swbrains

    swbrains Well-Known Member

    Joined:
    Sep 13, 2006
    Messages:
    54
    Likes Received:
    2
    Trophy Points:
    158
    Hi,

    Is there a way using the cPanel API to generate the same results from the UI's Track Delivery. Using this feature, you can enter an email address and it returns:
    Event, Sender, Sent Time, Spam Score, Recipient, Result
    Is there some way to do this via an API call? The only thing I could find was the Email Trace function which appears to be the older function in the UI that displays the mail server path a message sent to the specified address would take rather than a history of actual email messages sent to an address.

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. swbrains

    swbrains Well-Known Member

    Joined:
    Sep 13, 2006
    Messages:
    54
    Likes Received:
    2
    Trophy Points:
    158
    Hmmm... I'm not sure why this one is marked solved; maybe I marked it that way for some reason.

    I did try this function "EmailTrack::search" as documented in the Email API module you linked to, but it doesn't allow me to specify a user account to filter by. It's results are similar to those provided by WHM, but without the ability to filter by user account. I'd like to offer my customers the ability to see which email deliveries have failed (incoming or outgoing) along with the reasons, but I don't want them to see mail sent/received outside their account. As the function stands (if I'm correct about the lack of filtering server-side), it's not practical to return all mail delivery records for the entire server and then filter them client-side in my script for one customer.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The cPanel API 2 function will only output results for the account that's running the command. For example, a user logged in via SSH as "account1" can run the following command:

    Code:
    cpapi2 EmailTrack stats
    This will only output information about queued email for that specific cPanel account.

    Thank you.
     
  5. swbrains

    swbrains Well-Known Member

    Joined:
    Sep 13, 2006
    Messages:
    54
    Likes Received:
    2
    Trophy Points:
    158
    Thanks. I was able to all the function successfully under the logged account. However it returned no results, unlike the ones in cPanel UI->Track Delivery. Then I noticed the API docs say "This function displays tracking information for the messages in the account's message queue." The UI Track Delivery function seems to return email "history" (already sent/received messages) but perhaps this API call only returns what's currently in the queue (in progress)?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    There's no UAPI or cPanel API 2 function that will provide the same functionality as the the "Track Delivery" option in cPanel. I encourage you to open a feature request if you'd like to see support for that added:

    Submit A Feature Request

    Thanks!
     
  7. swbrains

    swbrains Well-Known Member

    Joined:
    Sep 13, 2006
    Messages:
    54
    Likes Received:
    2
    Trophy Points:
    158
    I tried just now. It doesn't seem to show up in my Feature Requests after submitting. I probably tried 3 times so sorry if there is more than one copy. :(
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Requests are moderated by default, so once you make the submission it can sometimes take 24-48 hours before it's approved.

    Thank you.
     
  9. swbrains

    swbrains Well-Known Member

    Joined:
    Sep 13, 2006
    Messages:
    54
    Likes Received:
    2
    Trophy Points:
    158
    Got it -- thanks!
     
Loading...

Share This Page