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.

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:
    30,736
    Likes Received:
    661
    Trophy Points:
    113
    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.
     
  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:
    30,736
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page