mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-10-28 20:23:26 +00:00
[Web][Dovecot][SOGo][DockerApi] Add mailbox groups, shared mailboxes and identity provider sync
This commit is contained in:
82 files changed
+6488
-1027
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Mailcow\Identity\Legacy;
|
||||
|
||||
use Mailcow\MailboxGroup\Legacy\LegacyMailbox;
|
||||
|
||||
/**
|
||||
* Bridge to the procedural mailbox code for the IdP sync: creating mailboxes, applying templates.
|
||||
*/
|
||||
class LegacyAccounts extends LegacyMailbox
|
||||
{
|
||||
/**
|
||||
* Creates a mailbox of the IdP from a template, like the IdP login does.
|
||||
*
|
||||
* @return ?string null on success, else the message key of the legacy error
|
||||
*/
|
||||
public function createMailbox(string $email, string $name, string $authsource, string $template): ?string
|
||||
{
|
||||
return $this->asSystem(fn(): mixed => $this->callCreate($email, $name, $authsource, $template));
|
||||
}
|
||||
|
||||
protected function callCreate(string $email, string $name, string $authsource, string $template): mixed
|
||||
{
|
||||
[$local, $domain] = explode('@', $email, 2);
|
||||
return mailbox('add', 'mailbox_from_template', ['domain' => $domain, 'local_part' => $local, 'name' => $name,
|
||||
'authsource' => $authsource, 'template' => $template]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user