Ticket #1355 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

You can't create a mail alias account if the user part already exists as a subdomain mail account.

Reported by: kilburn Assigned to:
Priority: major Milestone: ispCP ω 1.0.0 - RC6
Component: Frontend (GUI) Version: ispCP ω 1.0.0 - RC5
Severity: Don't know Keywords:
Cc:

Description (Last modified by kilburn)

I'm unable to create an alias account if the user part already exists as a subdomain mail account. How to reproduce:

1) Add dmn.tld domain
2) Add sub.dmn.tld subdomain
3) Add user@sub.dmn.tld mail account
4) Add als.tld as domain alias of dmn.tld
5) Try to add user@als.tld

Expected result: the new mail account "user@als.tld" is created.
Current result: Error message telling you that the user already exists!

Attachments

1335patch.txt (0.8 kB) - added by kilburn on 06/18/08 01:26:44.

Change History

06/18/08 00:24:34 changed by kilburn

  • version changed from ispCP ω 1.0.0 - RC4 to ispCP ω 1.0.0 - RC5.

06/18/08 00:32:57 changed by kilburn

  • description changed.
  • summary changed from You can't create a mail alias account if the user part already exists as a mail domain account. to You can't create a mail alias account if the user part already exists as a subdomain mail account..

06/18/08 00:34:02 changed by kilburn

  • description changed.

06/18/08 00:34:18 changed by kilburn

  • description changed.

06/18/08 00:46:09 changed by kilburn

In my system, step 3 created the following mail_users records (sub_id here refers to "subdomain_id" field in "subdomains" table):

mail_id 	mail_acc 	domain_id 	sub_id 	mail_addr
37  		user  		8  		3  	user@sub.dmn.tld

When trying to add the alias, this SQL Query is executed to check if it already exists:

SELECT COUNT(mail_id) AS cnt FROM `mail_users` WHERE `mail_acc` = 'user' AND `domain_id` = 8 AND `sub_id` = 3

As you can see, "sub_id" here should refer to "alias_id" field in "domain_aliasses" table.

So the "sub_id" field in "mail_users" table is actually relating to two different primary keys (domain_aliasses.alias_id and subdomains.subdomain_id). This is a problem when you have a subdomain and a domain_alias that use the same id, raising this bug.

IMHO the solution is to add a new "alias_id" field to the "mail_users" table instead of reusing the "sub_id" one.

(follow-up: ↓ 8 ) 06/18/08 01:26:25 changed by kilburn

I've solved this issue with the attached 1335patch.txt patch. Can someone test it and post results please?

06/18/08 01:26:44 changed by kilburn

  • attachment 1335patch.txt added.

06/18/08 10:17:27 changed by kilburn

  • owner changed.
  • component changed from Backend (Engine) to Frontend (GUI).

(in reply to: ↑ 6 ) 06/18/08 20:13:04 changed by sci2tech

Replying to kilburn:

I've solved this issue with the attached 1335patch.txt patch. Can someone test it and post results please?

I confirm the bug, and confirm that the patch work ok

06/19/08 14:16:50 changed by zothos

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone changed from Working to ispCP ω 1.0.0 - RC6.

fixed in r1231

06/19/08 19:01:09 changed by rats

  • status changed from closed to reopened.
  • resolution deleted.

reverted with r1233

06/21/08 12:15:49 changed by rats

  • status changed from reopened to closed.
  • resolution set to fixed.

overlooked the pacht and added it in r1234


Add/Change #1355 (You can't create a mail alias account if the user part already exists as a subdomain mail account.)




Action