SOLVED whmapi1 emailtrack_user_stats showing very high numbers in v76.0.5-6

domeneas

Well-Known Member
Sep 20, 2013
48
13
58
cPanel Access Level
Root Administrator
Hi,

I wrote my own little spam tracking script based on data from "whmapi1 emailtrack_user_stats". I dump the results of the previous 24 hours every morning, format what I want to see a bit a, just to see that all the values are in-line and nothing is suspicious.

After the upgrade to v76, all my servers that are upgraded show very inflated number, almost 10 fold in SENDCOUNT and SUCCESSCOUNT for example, compared to mail I can see in "View Relayers" and "Mail Delivery Reports". The non-upgraded servers continue to do as they always have, showing numbers that are quite close to the "View Relayers" in WHM.

I run
Code:
/usr/sbin/whmapi1 emailtrack_user_stats starttime UNIXTIME_OF_24_HOURS_AGO
v76:
45 emails in "View Relayers" gives a sendcount 428, successcount of 599.
1 email in "View Relayers" gives a sendcount 7, successcount of 7.

v74:
106 emails in "View Relayers", gives a sendcount 57, successcount 126
1 email in "View Relayers" gives a sendcount 1, successcount of 1.


All my servers have the "Standard Node" role. I use CloudLinux and get the same result if I use the complete path
Code:
/usr/local/cpanel/bin/whmapi1
-or if I use-
Code:
/usr/sbin/whmapi1
Any idea what could be causing this? I know the numbers should not be identical, but this is a huge difference and has made my script go haywire overnight when the server is upgraded.

Thank you for any input.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello @domeneas,

Could you open a support ticket so we can take a closer look at the system and determine where the difference in the reported numbers stems from? You can post the ticket number here and we'll link this thread to it.

Thank you.
 

domeneas

Well-Known Member
Sep 20, 2013
48
13
58
cPanel Access Level
Root Administrator
The fix was that the syntax needs an "=" sign between the "starttime" and the UNIX_DATE

/usr/sbin/whmapi1 emailtrack_user_stats starttime=UNIXTIME_OF_24_HOURS_AGO

works just fine. This has apparently been patched now so it should throw an error if you try to do what I did originally.
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello @domeneas,

Thanks for sharing the outcome. Here's the case you referenced that's included in version 76.0.9:

Fixed case CPANEL-23950: Only attempt to process argument values that are defined with the API tooling.

Thanks!