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.

MDaemon support for cPanel

Discussion in 'cPanel Developers' started by KeithPersonett, May 7, 2014.

  1. KeithPersonett

    KeithPersonett Registered

    Joined:
    May 7, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    One of my current projects is to come up with the means to integrate MDaemon Messaging Server with cPanel.

    From what I can tell so far, cPanel runs on Linux systems only, please correct me if I am wrong.

    MDaemon, on the other hand, only runs on Windows Servers.

    Based on what little I've been able to find out, my current plan is to create an ISAPI module to run on the MDaemon server that could be called from a remote cPanel installation.

    There is a TON of documentation on cPanel, so much, that finding the correct documentation to look over has been a challenge. I would appreciate any help I can get in this regard.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Could you provide some more information on what type of documentation you are looking for in particular? The following document is a good place to get started:

    Software Development Kit Home

    Thank you.
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:

    You are correct, cPanel runs on Linux only.
     
  4. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    It's a big project to replace Exim with MDaemon. You'll want to intercept all mail related actions with Standardized Hooks. You'll probably want to email integration [at] cPanel (dot) NET to see if they've done anything on making the mail server modular like they've done with FTP, SQL, and DNS.
     
  5. KeithPersonett

    KeithPersonett Registered

    Joined:
    May 7, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks all,

    I think that the powers that be may have a different idea of what cPanel is. At this point, even I am not sure what cPanel is comprised of entirely. I think that my management sees cPanel as a web based management front end, similar to WebSitePanel...

    The goal is (as explained to me) not necessarily to replace cPanel's built in mail services (to my knowledge) but to come up with the means to manage MDaemon accounts from cPanel's web interface. Still reading up on what cPanel is and does. In the process of standing up a Linux box to install it on, so hopefully, I can get a better idea of what the possibilities are.
     
  6. KeithPersonett

    KeithPersonett Registered

    Joined:
    May 7, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Michael,
    What I've been tasked with is the means to manage an MDaemon Messaging Server running on a Windows Server, via the cPanel front end running on a Linux machine. Such tasks in MDaemon as User Management, Group Management, Domain Management, Distribution List management, Mobile device management, etc...

    Since cPanel is running on a separate machine, and being Linux, I figured I would write an ISAPI module that was an XML consumer/provider, since something like DCOM is not goingot be easily done. Of course, there would have to be a Perl component to run on the cPanel front end (and we are looking for an experience Perl/.cPanel developer to handle that side of things).
     
  7. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    That makes sense. cPanel/WHM is a really comprehensive way to manage all the services on a Linux server related to web hosting. Those include (but are not limited to):

    DNS
    FTP/S
    SQL
    HTTP/S
    SSH and keys
    Analytics
    Logging
    Website Software
    POP/IMAP/SMTP
    OS Updates

    cPanel is a user interface that allows an individual user a "self service" way to manage both their website(s)' applications and files as well as the configuration of that website(s).

    WHM is a user interface that allows you to manage the overall server, what hosting plans are offered, and hosting accounts.

    In addition, there are lots of tools like backups, automated OS updates, service monitoring, etc that make managing the server relatively hands off.

    If you're looking to integrate MDaemon in addition to the existing email functionality in cPanel, you'll likely want to do that by creating 1 or more cPanel plugins which are PHP/Perl scripts that allow you to either interface with the MDaemon API, or provide a single-sign on interface to the MDaemon web interface.

    A cPanel plugin is really just an application that gets it's own icon in the cPanel UI. You can make the application do whatever. To give it an icon, create a plugin file:

    https://cpanel.net/developers/cpanel-plugins/

    You'll also need to register the application's permissions and execution use using the AppConfig system:

    cPanel Plugin Registration 11.38+ - cPanel KnowledgeBase

    The application itself can be a single PHP/Perl file or an entire application. Note that you'll want to put it in one of the cPanel Web Server's web roots:

    /usr/local/cpanel/whostmgr/docroot/cgi/ <-- WHM
    /usr/local/cpanel/base/frontend/ <-- cPanel

    For WHM, I recommend creating your own directory like so:

    /usr/local/cpanel/whostmgr/docroot/cgi/addons/mdaemon

    For cPanel, you'll want to either drop it into the specific theme you are using like:

    /usr/local/cpanel/base/frontend/x3/mdaemon

    or put it in a general location that can be accessed by all themes:

    /usr/local/cpanel/base/3rdparty/mdaemon

    With PHP, you'll want to use the LiveAPI to give you access to the cPanel API's to get info about the hosting account:

    LiveAPI

    I definitely recommend using PHP as there are some really annoying issues with using Perl and add ons:

    1. cPanel no longer manages the system perl by default so there are often multiple copies of system perl on a system and it's hard to know which one to use, or the one installed is not properly installed/maintained

    2. cPanel/WHM and the cPanel Hooks execute against different perl installs so you have to manage module inclusion for both or ship your perl application with all required module dependencies

    3. Not many hosting sysadmins care about Perl so it is often neglected and hosts have difficulty troubleshooting issues. On the flip side, they have extensive experience with PHP due to WordPress and other plugins so you'll get a lot of help when issues come up.
     
  8. KeithPersonett

    KeithPersonett Registered

    Joined:
    May 7, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you, GREAT answer! That means that if we wrote a PHP or Perl cPanel plugin that ran on the cPanel site, that plugin could make Ajax calls to my ISAPI running on the MDaemon server and render results, check status codes, etc...

    This gives me much more flexibility than having to restrict my ISAPI to just handle pre-defined cPanel functions, and allows me to design my schema custom tailored for MDaemon so that the plugin would not be limited to what cPanel already does.

    I appreciate the assist here. Now I can start the design work and once we have a developer able to do the PHP or Perl side of things, I can provide them with the schema and work with them on integration.
     

Share This Page