Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED Account username in exim_mainlog

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

  1. MarceloKonrath

    MarceloKonrath Active Member

    Joined:
    Jun 8, 2013
    Messages:
    31
    Likes Received:
    2
    Trophy Points:
    8
    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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,161
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. MarceloKonrath

    MarceloKonrath Active Member

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

    MarceloKonrath Active Member

    Joined:
    Jun 8, 2013
    Messages:
    31
    Likes Received:
    2
    Trophy Points:
    8
    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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,161
    Likes Received:
    1,933
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm happy to see you found a suitable solution. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice