mirror of
https://github.com/opensolutions/ViMbAdmin.git
synced 2026-04-26 00:36:00 +03:00
[GH-ISSUE #197] [Enhancement] Exception when creating a mailbox with the same email as an alis #158
Labels
No labels
bug
feature
feature
improvement
improvement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ViMbAdmin-opensolutions#158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Jun 21, 2016).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/197
Hello,
Today I discovered a bug that occurred when trying to create a mailbox with the same email as an already existing alias.
For example:
anna@example.com is an alias for bob@example.com
When you create a new mailbox with the email anna@example.com the following exception occurs:
`
2016-06-21T10:45:55+02:00 ERR (3):
****************************** EXCEPTIONS *******************************
--------------------------- EXCEPTION --------------------------
Message: An exception occurred while executing 'INSERT INTO alias (address, goto, active, created, modified, Domain_id) VALUES (?, ?, ?, ?, ?, ?)' with params ["anna@example.com", "anna@example.com", 1, "2016-06-21 10:45:54", null, "75"]:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'anna@example.com' for key 'UNIQ_B6F7CA81D4E6F81'
Line: 66
File: /usr/local/vimbadmin/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php
Trace:
#0 /usr/local/vimbadmin/vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php(116): Doctrine\DBAL\Driver\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\DBAL\Driver\PDOException))
#1 /usr/local/vimbadmin/vendor/doctrine/dbal/lib/Doctrine/DBAL/Statement.php(175): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(Doctrine\DBAL\Driver\PDOMySql\Driver), Object(Doctrine\DBAL\Driver\PDOException), 'INSERT INTO ali...', Array)
#2 /usr/local/vimbadmin/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php(279): Doctrine\DBAL\Statement->execute()
#3 /usr/local/vimbadmin/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(966): Doctrine\ORM\Persisters\BasicEntityPersister->executeInserts()
#4 /usr/local/vimbadmin/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(335): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrine\ORM\Mapping\ClassMetadata))
#5 /usr/local/vimbadmin/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(340): Doctrine\ORM\UnitOfWork->commit(NULL)
#6 /usr/local/vimbadmin/application/controllers/MailboxController.php(360): Doctrine\ORM\EntityManager->flush()
#7 /usr/local/vimbadmin/vendor/zendframework/zendframework1/library/Zend/Controller/Action.php(516): MailboxController->addAction()
#8 /usr/local/vimbadmin/vendor/zendframework/zendframework1/library/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('addAction')
#9 /usr/local/vimbadmin/vendor/zendframework/zendframework1/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#10 /usr/local/vimbadmin/vendor/zendframework/zendframework1/library/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#11 /usr/local/vimbadmin/vendor/zendframework/zendframework1/library/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#12 /usr/local/vimbadmin/public/index.php(34): Zend_Application->run()
#13 {main}
Array
(
[0] => Array
(
[file] => /usr/local/vimbadmin/vendor/opensolutions/oss-framework/src/OSS/Controller/Trait/Error.php
[line] => 78
[function] => compact_debug_backtrace
[class] => OSS_Debug
)
)
HTTP_HOST : mailserver.example.com
HTTP_USER_AGENT: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0
HTTP_COOKIE: aval=xxx; bval=xxx; vm_prefs={"iLength":10}; VIMBADMIN3=xxx
REMOTE_PORT: 48530
REQUEST_METHOD: POST
REQUEST_URI: /vimbadmin/mailbox/add/did/75
`
While it didn't break anything, perhaps a message along the lines of "An alias already exists for this email, please delete it first" would be nice. :)
Thanks in advance!
@gunawanw9 commented on GitHub (Feb 17, 2019):
Actually, you can not create a mailbox with the same address with aliases...
@barryo commented on GitHub (May 16, 2020):
Fixed in #260