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 Account username in exim_mainlog

Discussion in 'E-mail Discussions' started by MarceloKonrath, May 31, 2017.

  1. MarceloKonrath

    Joined:
    Jun 8, 2013
    Messages:
    16
    Likes Received:
    2
    Trophy Points:
    3
    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
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
  3. MarceloKonrath

    Joined:
    Jun 8, 2013
    Messages:
    16
    Likes Received:
    2
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    No more necessary

    The /scripts/suspendacct can suspend by domain name.

    I was able to make my script work.

    Thank you
     
  4. MarceloKonrath

    Joined:
    Jun 8, 2013
    Messages:
    16
    Likes Received:
    2
    Trophy Points:
    3
    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 ! :)
     
    cPanelMichael likes this.
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    I'm happy to see you found a suitable solution. Thank you for updating us with the outcome.
     
Loading...

Share This Page