API Hook for bulk mailbox and forward creation?

Murray Trainer

Registered
Jun 10, 2015
4
0
1
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
I am using Cpanel API Hooks for adding mailbox accounts and forwarders.
Hello,

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

Thank you.
 

Murray Trainer

Registered
Jun 10, 2015
4
0
1
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',
  };
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463