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!

API Hook for bulk mailbox and forward creation?

Discussion in 'cPanel Developers' started by Murray Trainer, Aug 8, 2016.

Tags:
  1. Murray Trainer

    Murray Trainer Registered

    Joined:
    Jun 10, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Perth WA
    cPanel Access Level:
    Reseller Owner
    Hi,

    I am using Cpanel API Hooks for adding mailbox accounts and forwarders. I just tested the Address Importer Cpanel functionality which allows bulk creation of mailboxes and forwarders from a CSV file. This doesn't appear to trigger any of the API hooks for creating mailboxes or forwarders. Either there should be a hook triggered for each mailbox/forward creation or there should be one hook triggered for the bulk mailbox/forward creation. I think this should be logged as a bug or feature request.

    Regards

    Murray
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,947
    Likes Received:
    1,821
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you provide an example of one of the hooks that you implemented, and the method you used to create it?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Murray Trainer

    Murray Trainer Registered

    Joined:
    Jun 10, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Perth WA
    cPanel Access Level:
    Reseller Owner
    Hi Michael,

    Thanks for the reply. We are using a perl module for the Hooks. The hooks for mailbox and forward creation are below. We had some old WHM skins that used API1 hooks but I don't think they get triggered any more. Hope the info below helps.

    THanks

    Murray

    Code:
      my $mail_addpop = {
      'category' => 'Cpanel',
      'event' => 'Api2::Email::addpop',
      'stage' => 'post',
      'hook' => 'DSMail::Hooks::addpop',
      'exectype' => 'module',
      };
    
      my $mail_addpop_api1 = {
      'category' => 'Cpanel',
      'event' => 'Api1::Email::addpop',
      'stage' => 'post',
      'hook' => 'DSMail::Hooks::addpop_api1',
      'exectype' => 'module',
      };
    
      my $mail_addforward = {
      'category' => 'Cpanel',
      'event' => 'Api2::Email::addforward',
      'stage' => 'post',
      'hook' => 'DSMail::Hooks::addforward',
      'exectype' => 'module',
      };
    
      my $mail_addforward_api1 = {
      'category' => 'Cpanel',
      'event' => 'Api1::Email::addforward',
      'stage' => 'post',
      'hook' => 'DSMail::Hooks::addforward',
      'exectype' => 'module',
      };
    
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,947
    Likes Received:
    1,821
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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