Skip to main content

Cpanel API EmailTrack - Search: "from" vs "return-path"

Comments

16 comments

  • cPRex Jurassic Moderator

    Hey there!  I did some testing on my end with this and I'm not finding a way to pull that data when the values differ.  The best option in this situation would likely be a feature request to get that additional API functionality added to the product.

    Would you like me to submit that request for you?

    0
  • Vinnie Murdico

    Thanks -- Yes, that would be great if you could submit that request on my behalf.  Without it, the usefulness of the function is significantly diminished if the developer's goal is to search messages by the typical "from:" address.  

    As a matter of background, our website platform allows our customers to configure a distinct bounce/return-path address for all outgoing messages, as some want a specific administrator to deal with any bounces rather than the user who's email appears in the from: header, who typically wouldn't know how or have access to the parts of the system to correct the issue.  While this is likely not the most typical use case, our "search email" app (our system's front-end that utilizes this API call) isn't particularly useful if they can't search by sender because it's always the same administrator's email address in the returned dataset. 

    Thanks again for the quick confirmation and follow-up.

    0
  • cPRex Jurassic Moderator

    You're very welcome!  I've submitted that request and I'll bring it up during the next meeting, which is scheduled for Friday the 20th

    I've made sure to link this thread to the request so I'll be sure to reply once I hear more.

    0
  • Vinnie Murdico

    Awesome -- thanks so much!

    Is there a way for me to see the progress of the request, or are those requests only visible from your side?

    0
  • cPRex Jurassic Moderator

    Nope, no way for you to see those.  BUT...I've linked this thread to the cases so if I hear updates on my end I'll be sure to post!

    0
  • Vinnie Murdico

    👍

    0
  • cPRex Jurassic Moderator

    Minor update - I talked with the features team and I'm reaching out to the email team directly to see if I can get some more information.

    0
  • Vinnie Murdico

    Thanks!

    0
  • cPRex Jurassic Moderator

    Vinnie Murdico - I'm working on this today and tomorrow and have a plan, but it'll likely be tomorrow before I have a full response to share with you.  I'll update you as soon as I can!

    0
  • Vinnie Murdico

    Thanks -- That's great!

    0
  • cPRex Jurassic Moderator

    I did some testing on this and confirmed that Eximstats doesn't include the "From" or "Return-Path" header, which is why the search/API isn't able to retrieve that data.  Here is a full list of what is available in the system:

    cpapi2 --output=jsonpretty --user=cptesting EmailTrack search success=1 defer=0 | jq '.cpanelresult.data[] | select(.msgid | IN("1w3EgG-00000001V2E-28OZ","1w3EgH-00000001V2O-0r3d"))'
    {
      "actiontime": "2026-03-19 14:49:01",
      "actionunixtime": 1773931741,
      "deliveredto": "email1@cptesting.tld",
      "deliverydomain": "cptesting.tld",
      "deliveryuser": "cptesting",
      "domain": "",
      "email": "root@10-2-50-186.cprapid.com",
      "host": "localhost",
      "ip": "127.0.0.1",
      "message": "Accepted",
      "msgid": "1w3EgH-00000001V2O-0r3d",
      "recipient": "email1@cptesting.tld",
      "router": "virtual_user",
      "sender": "root",
      "senderauth": "localuser",
      "senderhost": "localhost",
      "senderip": "127.0.0.1",
      "sendunixtime": 1773931741,
      "size": 430,
      "spamscore": "",
      "transport": "dovecot_virtual_delivery",
      "transport_is_remote": 0,
      "type": "success",
      "user": "root"
    }

    I've created case CPANEL-52139 with our development team to see if they can get this added, but I'm not sure if they will change this since the older cpapi2 system is no longer in development.  If anything there would likely be a new tool made under the uapi system that included this functionality.

    I've linked this thread to the case so if I hear any updates on this I'll be sure to post!

    0
  • Vinnie Murdico

    Thanks!   You mentioned that the returned object "doesn't include the "From" or "Return-Path" header", however, in my testing, it seems like the "email" field contains the "Return-Path" value. It's only the "From" header that can't be queried.  In your tests, where did the "email" field value come from?

    0
  • cPRex Jurassic Moderator

    The "email" from my test was performed on the command line with this:

    # echo -e "To: email1@cptesting.tld\nFrom: cptesting$(hostname)\Return-Path: cptesting$(hostname)\nSubject: SameFrom\n" | sendmail email1@cptesting.tld

    so it makes sense that the "email" line said root@hostname in my case. 

    0
  • Vinnie Murdico

    So, it does seem that the "email" field is at least valid coming back from the "Reply-To" header, correct?  We're just missing "From"?

    0
  • cPRex Jurassic Moderator

    From my understanding those should match, yes.  "From" seems to be the missing piece.

    0
  • Vinnie Murdico

    Got it -- thanks!

     

    0

Please sign in to leave a comment.