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.

find out remotemx users

Discussion in 'General Discussion' started by crazyaboutlinux, Feb 24, 2011.

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    hi,

    Is there a way to find out how many users are uses remotemx ??

    there are 500 cPanel accounts, some users are uses localmx & some remotemx

    how to find the remotemx users ??
     
  2. MattLee

    MattLee BANNED

    Joined:
    Aug 26, 2009
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    You should be able to check for this by performing a check against the user files located in /var/cpanel/users/* for the line: MXCHECK-domain.com=remote

    Something like this should work:
    PHP:
    grep "=remote" /var/cpanel/users/* | awk -F'/' '{ print $5 }' | awk -F ":" '{ print $1 }';
     
  3. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    Hi MattLee

    i got the list of users using
    PHP:
    grep "=remote" /var/cpanel/users/* | awk -F'/' '{ print $5 }' | awk -F ":" '{ print $1 }'; 
    is it also possible to print what remote MX that user/users using ?
     
  4. MattLee

    MattLee BANNED

    Joined:
    Aug 26, 2009
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    0
    Hello,

    You'd need a script that pulls the domain name that has a remote MX from the MXCHECK line in /var/cpanel/users/* and then searches the associated DNS zone on the server or performs a dig request at localhost for the MX entry and then reports it back.

    Here's a one-liner to view the domains that are set up as remote.
    PHP:
    grep "=remote" /var/cpanel/users/* | awk -F ':MXCHECK-' '{ print $2 }' | awk -F '=' '{ print $1 }';
    This performs a dig request for each domain located in file test123 and prints out the MX entries they are using.
    PHP:
    for i in $(cat test123); do echo "$i is using:" && dig @localhost $i mx +shortdone
    If you work on cobbling these two together you should be able to get the information you want.
     
Loading...

Share This Page