Hi,
so I have used whmapi1 emailtrack_user_stats to get the total number of emails sent in a given time for each account on my cpanel servers, but I would like to be able to count the amounts of email a single email account has sent to write an auto suspend script for just that account if it goes over certain limits. Stopping all mail to the cpanel account seems overkill.
The easiest way I can see is if I could get a hold of the number that WHM's "Email Delivery Report" returns (The search matches X records at the top of the page) when I search for an exact match for a From Address.
Is that possible? Or is there a UAPI or API2 command I've overlooked or some other easy way?
I'm trying to avoid writing something of my own that searches exim_mainlog and counts.
I have used:
for a test so far, and it does return only sent emails it seems, but in a live test it returned about 1790 records vs the delivery reports almost 2200.
Thanks.
so I have used whmapi1 emailtrack_user_stats to get the total number of emails sent in a given time for each account on my cpanel servers, but I would like to be able to count the amounts of email a single email account has sent to write an auto suspend script for just that account if it goes over certain limits. Stopping all mail to the cpanel account seems overkill.
The easiest way I can see is if I could get a hold of the number that WHM's "Email Delivery Report" returns (The search matches X records at the top of the page) when I search for an exact match for a From Address.
Is that possible? Or is there a UAPI or API2 command I've overlooked or some other easy way?
I'm trying to avoid writing something of my own that searches exim_mainlog and counts.
I have used:
Code:
exigrep '<= .*@example.com H=' /var/log/exim_mainlog | fgrep '<='
Thanks.
Last edited: