Skip to content

Commit

Permalink
Merge branch 'master' of github.com:opensolutions/ViMbAdmin
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Feb 23, 2023
2 parents b049ad8 + 91cd43d commit dc0576e
Show file tree
Hide file tree
Showing 5 changed files with 436 additions and 227 deletions.
15 changes: 3 additions & 12 deletions application/configs/application.ini.dist
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,6 @@ skipVersionCheck = 0
skipInstallPingback = 0









;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Allow admins to dictate whether a user can use BOTH, IMAP ONLY,
; POP3 ONLY when creating mailboxes.
Expand All @@ -395,7 +388,6 @@ vimbadmin_plugins.AccessPermissions.type.POP3 = "POP3"
vimbadmin_plugins.AccessPermissions.type.SIEVE = "SIEVE"



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Allow admins to force that for a mailbox/domain basic aliases are existing
; If a new mailbox is created the system will check if the aliases are existing, if not they are created.
Expand All @@ -411,10 +403,9 @@ vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "hostmaster"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "webmaster"

; Define this if emails should be forwarded to a fixed address instead of the first mailbox address of the domain
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.postmaster = "postmaster@example.net"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.abuse = "abuse@example.net"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.hostmaster = "hostmaster@example.net"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.webmaster = "webmaster@example.net"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.postmaster = "@other.tld"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.abuse = "postmaster"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.* = "root@domain.tld"



Expand Down
22 changes: 14 additions & 8 deletions application/configs/application.ini.vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,6 @@ skipVersionCheck = 0
skipInstallPingback = 0









;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Allow admins to dictate whether a user can use BOTH, IMAP ONLY,
; POP3 ONLY when creating mailboxes.
Expand All @@ -375,11 +368,24 @@ vimbadmin_plugins.AccessPermissions.type.POP3 = "POP3"
vimbadmin_plugins.AccessPermissions.type.SIEVE = "SIEVE"


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Allow admins to force that for a mailbox/domain basic aliases are existing
; If a new mailbox is created the system will check if the aliases are existing, if not they are created.

vimbadmin_plugins.MailboxAutomaticAliases.disabled = true

; These aliases should always exist, it is not recommened to delete it
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "postmaster"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "abuse"

; These aliases are optional, but it recommended to not remove them
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "hostmaster"
vimbadmin_plugins.MailboxAutomaticAliases.defaultAliases[] = "webmaster"


; Define this if emails should be forwarded to a fixed address instead of the first mailbox address of the domain
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.postmaster = "@other.tld"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.abuse = "postmaster"
;vimbadmin_plugins.MailboxAutomaticAliases.defaultMapping.* = "root@domain.tld"



Expand Down
2 changes: 1 addition & 1 deletion application/controllers/AliasController.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ public function ajaxToggleActiveAction()
$this->notify( 'alias', 'toggleActive', 'preflush', $this, [ 'active' => $this->getAlias()->getActive() ] );
$this->getD2EM()->flush();
$this->notify( 'alias', 'toggleActive', 'postflush', $this, [ 'active' => $this->getAlias()->getActive() ] );
print 'ok';
} else {
print 'ko';
}
print 'ok';
}


Expand Down
24 changes: 14 additions & 10 deletions application/controllers/MailboxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,18 +408,22 @@ public function ajaxToggleActiveAction()
if( !$this->getMailbox() )
print 'ko';

$this->getMailbox()->setActive( !$this->getMailbox()->getActive() );
$this->getMailbox()->setModified( new \DateTime() );
if($this->notify( 'mailbox', 'toggleActive', 'preToggle', $this, [ 'active' => $this->getMailbox()->getActive() ]) === true) {
$this->getMailbox()->setActive( !$this->getMailbox()->getActive() );
$this->getMailbox()->setModified( new \DateTime() );

$this->log(
$this->getMailbox()->getActive() ? \Entities\Log::ACTION_MAILBOX_ACTIVATE : \Entities\Log::ACTION_MAILBOX_DEACTIVATE,
"{$this->getAdmin()->getFormattedName()} " . ( $this->getMailbox()->getActive() ? 'activated' : 'deactivated' ) . " mailbox {$this->getMailbox()->getUsername()}"
);
$this->log(
$this->getMailbox()->getActive() ? \Entities\Log::ACTION_MAILBOX_ACTIVATE : \Entities\Log::ACTION_MAILBOX_DEACTIVATE,
"{$this->getAdmin()->getFormattedName()} " . ( $this->getMailbox()->getActive() ? 'activated' : 'deactivated' ) . " mailbox {$this->getMailbox()->getUsername()}"
);

$this->notify( 'mailbox', 'toggleActive', 'postflush', $this, [ 'active' => $this->getMailbox()->getActive() ] );
$this->getD2EM()->flush();
$this->notify( 'mailbox', 'toggleActive', 'postflush', $this, [ 'active' => $this->getMailbox()->getActive() ] );
print 'ok';
$this->notify( 'mailbox', 'toggleActive', 'preflush', $this, [ 'active' => $this->getMailbox()->getActive() ] );
$this->getD2EM()->flush();
$this->notify( 'mailbox', 'toggleActive', 'postflush', $this, [ 'active' => $this->getMailbox()->getActive() ] );
print 'ok';
} else {
print 'ko';
}
}


Expand Down
Loading

0 comments on commit dc0576e

Please sign in to comment.