SOLVED Account username in exim_mainlog

MarceloKonrath

Well-Known Member
Jun 8, 2013
47
9
58
cPanel Access Level
Root Administrator
Hello

I am writing a script for automatic account suspension when it reaches the max emails hour and exceeded the max defers.

To facilitate the procedure, I need the user account to be written to exim_mainlog.

Are there ways to do this? I'm not finding material that explains how to do it.

Thank you.
Konrath
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello,

You could utilize the following WHM API 1 function when developing your script if you needed to find the username associated with a domain name:

Code:
whmapi1 listaccts search=domain.tld searchtype=domain
The account username associated with the domain name is listed under "user" in the output.

Thank you.
 

MarceloKonrath

Well-Known Member
Jun 8, 2013
47
9
58
cPanel Access Level
Root Administrator
My script works as follows:

1) I extract the domain name from the / var / log / exim_mainlog file by searching for max defer or max mail hour.

2) I keep the domain name in a variable

3) I execute the suspension of the account via script.

PERFECT ! :)
 
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I'm happy to see you found a suitable solution. Thank you for updating us with the outcome.