Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Mar 2009
    Posts
    11

    Question Email::listpopswithdisk and multiple domains

    I'm trying to understand why my primary user on a WHM server is unable to get a listing of a domain in a separate account. I think I don't understand the different relationships between users and WHM accounts. Here's the situation:

    I have a WHM account with a user "user1". In this WHM account there are two cPanel accounts (sorry if I'm using the wrong words here). The first is for domain "mydomain1.com" and the second is for "mydomain2.com". The primary user for the "mydomain1.com" account is "user1" and the primary user for the "mydomain2.com" account is "user2".

    So:

    WHM Account >> "user1"
    "mydomain1.com" >> "user1"
    "mydomain2.com" >> "user2"

    Now, I'm using the Email::listpopswithdisk to try and retrieve email accounts for a domain. The problem is when I login as "user1" with the API and try to retrieve email accounts for "mydomain2.com", I get nothing back. This kind of makes since that account is owned by "user2". But what confuses me then is why one of the arguments for this API call is "domain" when the logged in user can apparently only access the domain of their own account (even if the user is the WHM account holder).

    I know this is a convoluted question but I can't think of a better way to ask it. Any help getting me to understand would be very much appreciated.

    Thanks,
    Karim

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by k_shehadeh View Post
    I'm trying to understand why my primary user on a WHM server is unable to get a listing of a domain in a separate account. I think I don't understand the different relationships between users and WHM accounts. Here's the situation:

    I have a WHM account with a user "user1". In this WHM account there are two cPanel accounts (sorry if I'm using the wrong words here). The first is for domain "mydomain1.com" and the second is for "mydomain2.com". The primary user for the "mydomain1.com" account is "user1" and the primary user for the "mydomain2.com" account is "user2".

    So:

    WHM Account >> "user1"
    "mydomain1.com" >> "user1"
    "mydomain2.com" >> "user2"

    Now, I'm using the Email::listpopswithdisk to try and retrieve email accounts for a domain. The problem is when I login as "user1" with the API and try to retrieve email accounts for "mydomain2.com", I get nothing back. This kind of makes since that account is owned by "user2". But what confuses me then is why one of the arguments for this API call is "domain" when the logged in user can apparently only access the domain of their own account (even if the user is the WHM account holder).

    I know this is a convoluted question but I can't think of a better way to ask it. Any help getting me to understand would be very much appreciated.

    Thanks,
    Karim
    Even though you are logging in as the reseller user (user1), which cPanel user are you passing to the XML API (via the user= URL parameter) when attempting to retrieve the email accounts for user2?

  3. #3
    Member
    Join Date
    Mar 2009
    Posts
    11

    Default

    Thanks for the response. To answer your question, it doesn't seem to matter what the "user" parameter is - I don't even have to supply a user and I still get back the email accounts associated with the authenticated user (as opposed to the one in the url parameter list).

  4. #4
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by k_shehadeh View Post
    Thanks for the response. To answer your question, it doesn't seem to matter what the "user" parameter is - I don't even have to supply a user and I still get back the email accounts associated with the authenticated user (as opposed to the one in the url parameter list).
    Are you using the XML API over a WHM port (2087 or 2086) or a cPanel port (2083 or 2082)?

  5. #5
    Member
    Join Date
    Mar 2009
    Posts
    11

    Default

    Over a cPanel port. I thought i had to since I'm using an API2 call. No?

  6. #6
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by k_shehadeh View Post
    Over a cPanel port. I thought i had to since I'm using an API2 call. No?
    The XML API can be used over the WHM ports even for API2 calls.

    When you use the cPanel ports, you will only be able to access things for the cPanel user you are logged in as. However, with using the WHM ports, you can login as a reseller and then get information about the cPanel accounts that are under your reseller account.

  7. #7
    Member
    Join Date
    Mar 2009
    Posts
    11

    Default

    Okay, that worked. Thanks! When using the WHM port, I *had* to specify a user as a URL parameter. Is there a way to retrieve all email accounts across all WHM accounts with a single call?

  8. #8
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by k_shehadeh View Post
    Okay, that worked. Thanks! When using the WHM port, I *had* to specify a user as a URL parameter. Is there a way to retrieve all email accounts across all WHM accounts with a single call?
    As this is an API1/API2 call, this needs to be done for each individual cPanel user. However you could probably use the XML API's listaccts function to get a list of all cPanel accounts for that reseller and then loop through each account to get the information you need for every WHM account owned by that reseller.

  9. #9
    Member
    Join Date
    Mar 2009
    Posts
    11

    Default

    Okay, yeah. That's what I figured. Thanks again!

Similar Threads & Tags
Similar threads

  1. email security multiple domains
    By gilesrevolution in forum New User Questions
    Replies: 1
    Last Post: 09-03-2010, 04:05 AM
  2. <?cp Email::listpopswithdisk(... DOES NOT WORK since 11.25 STABLE
    By Gino Viroli in forum cPanel Developers
    Replies: 4
    Last Post: 02-20-2010, 03:58 PM
  3. Multiple domains with email domains issue. please help
    By Supra53231 in forum E-mail Discussions
    Replies: 5
    Last Post: 11-17-2009, 09:10 AM
  4. Multiple domains email to pop accounts
    By Agent 86 in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 10-30-2004, 07:26 AM
  5. MX Records and Multiple Email Domains
    By n_kruse in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-22-2003, 01:58 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube