Posts: 3 ,662
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 408
Given 599 thank(s) in 464 post(s)
RE: Cannot reuse previously deleted email address
12-20-2018, 11:12 PM
(12-20-2018, 12:13 PM)fearworks Wrote: Yes that makes sense, particularly in a free hosting environment.
But I didn't think we were talking about being to reuse an address multiple times - just simply changing the system so that if an admin or reseller creates a client, the code only checks against accounts that are still active and haven't been deleted, to determine if the account can be created or not. At the moment, it checks if there was ever an account with that email address, whereas I think it would work better - certainly for me, and apparently for the OP - if it checks against only non-deleted accounts. Then, of course, if you create the fresh account, and someone later tries to use the same address, this would be forbidden as there would be an active account using that address.
Keith.
Now that is a good concept. Zadmin, at least, should be able to override it. I don't think that would be too hard to do.
But I'm not sure if there would be a trickle down affect.
Have it popup a warning saying it has already been used for a verification of reuse.
For testing, I would just add a simple:
Code: if user=zadmin then skip the check
and see what happens.
-TGates - Project Council
SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE
Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Posts: 64
Threads: 19
Joined: Apr 2017
Reputation:
0
Sex: Male
Thanks: 0
Given 0 thank(s) in 0 post(s)
RE: Cannot reuse previously deleted email address
12-21-2018, 12:11 AM
(12-20-2018, 07:46 AM)TGates Wrote: 'Deleted Records Manager'
Notwithstanding all of the discussion I have caused, thanks for the 'Deleted Records Manager'. I cleaned out the entries for all of the categories, but Sentora will still not let me add a mailbox that matches the address belonging to the previously deleted user client, even after rebooting the server.
"A mailbox, alias, forwarder or distribution list already exists with that name."
Bug or "Feature," it is what it is.
Sorry...
Posts: 208
Threads: 4
Joined: Jun 2018
Reputation:
8
Sex: Male
Thanks: 0
Given 37 thank(s) in 33 post(s)
RE: Cannot reuse previously deleted email address
12-21-2018, 03:11 AM
(12-21-2018, 12:11 AM)rsthomas Wrote: Notwithstanding all of the discussion I have caused, thanks for the 'Deleted Records Manager'. I cleaned out the entries for all of the categories, but Sentora will still not let me add a mailbox that matches the address belonging to the previously deleted user client, even after rebooting the server.
"A mailbox, alias, forwarder or distribution list already exists with that name."
Bug or "Feature," it is what it is.
Sorry...
Please, will you post a step-by-step of exactly what you are doing so that we can try to recreate it.
We keep going from talking about new mailboxes, to client creation, then back to mailboxes, and I'm confused with what you're trying to do...
Keith.
Posts: 3 ,662
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 408
Given 599 thank(s) in 464 post(s)
RE: Cannot reuse previously deleted email address
12-21-2018, 08:40 AM
(12-21-2018, 12:11 AM)rsthomas Wrote: Notwithstanding all of the discussion I have caused, thanks for the 'Deleted Records Manager'. I cleaned out the entries for all of the categories, but Sentora will still not let me add a mailbox that matches the address belonging to the previously deleted user client, even after rebooting the server.
"A mailbox, alias, forwarder or distribution list already exists with that name."
Bug or "Feature," it is what it is.
Sorry...
Sorry about that.
Log into phpMyAdmin and navigate to sentora_core>x_mailboxes and see if the email is there. It may not have been marked as deleted and may still be active but not attached to an account. It should be OK to delete it. (Make a backup first just in case!) You may also need to check x_aliases, x_forwarders and x_distlists.
Also check sentora_postfix>mailbox and sentora_postfix>alias and see if the entry is there too. It may have not been deleted for some reason. It should be ok to delete them also. (Make a backup first just in case!)
-TGates - Project Council
SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE
Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Posts: 208
Threads: 4
Joined: Jun 2018
Reputation:
8
Sex: Male
Thanks: 0
Given 37 thank(s) in 33 post(s)
RE: Cannot reuse previously deleted email address
12-21-2018, 12:30 PM
To solve the client account issue where, if you delete a client and then one day want to add a new client with the same email address, the following file is all that needs changing:
Code: /etc/sentora/panel/dryden/ctrl/users.class.php
the last function at the bottom, "CheckUserEmailIsUnique", has a line:
Code: $sql = "SELECT COUNT(*) FROM x_accounts WHERE LOWER(ac_email_vc)=:email";
change this to:
Code: $sql = "SELECT COUNT(*) FROM x_accounts WHERE LOWER(ac_email_vc)=:email AND ac_deleted_ts IS NULL";
and save the file.
You will now be able to create a client account using an email address that was used before to create an account that has since been deleted. It does NOT allow multiple active accounts with the same email address, as that would just be silly.
This modification does not increase, allow or create any additional opportunities for spam.
If the issue is to do with email addresses being left in tables when mailboxes/aliases/forwarders/dist lists are deleted, the only thing I am aware of there being an issue with is mailboxes left in the Postfix database, which I discussed (and proposed the fix for) this in this thread a while back:
http://forums.sentora.org/showthread.php?tid=10597
I'm fairly sure I have been able to create a mailbox for a client, then later delete it, and then even later, create it again for the same client or another client if they want it moving, etc.
I could be wrong - but it would be really useful for that step-by-step description of how to recreate an error with this as I am not seeing any.
Keith.
Posts: 3 ,662
Threads: 241
Joined: May 2014
Reputation:
85
Sex: Male
Thanks: 408
Given 599 thank(s) in 464 post(s)
RE: Cannot reuse previously deleted email address
12-22-2018, 07:43 AM
(12-21-2018, 12:30 PM)fearworks Wrote: To solve the client account issue where, if you delete a client and then one day want to add a new client with the same email address, the following file is all that needs changing:
Code: /etc/sentora/panel/dryden/ctrl/users.class.php
the last function at the bottom, "CheckUserEmailIsUnique", has a line:
Code: $sql = "SELECT COUNT(*) FROM x_accounts WHERE LOWER(ac_email_vc)=:email";
change this to:
Code: $sql = "SELECT COUNT(*) FROM x_accounts WHERE LOWER(ac_email_vc)=:email AND ac_deleted_ts IS NULL";
and save the file.
You will now be able to create a client account using an email address that was used before to create an account that has since been deleted. It does NOT allow multiple active accounts with the same email address, as that would just be silly.
This modification does not increase, allow or create any additional opportunities for spam.
If the issue is to do with email addresses being left in tables when mailboxes/aliases/forwarders/dist lists are deleted, the only thing I am aware of there being an issue with is mailboxes left in the Postfix database, which I discussed (and proposed the fix for) this in this thread a while back:
http://forums.sentora.org/showthread.php?tid=10597
I'm fairly sure I have been able to create a mailbox for a client, then later delete it, and then even later, create it again for the same client or another client if they want it moving, etc.
I could be wrong - but it would be really useful for that step-by-step description of how to recreate an error with this as I am not seeing any.
Keith.
I like this solution. I will add it to the master. I'm not sure why it wasn't done this way originally. And, you will still have a record of all the times the same email was deleted/re-used.
Thanks Keith!
I will also take a look at the proposed postfix fix too.
-TGates - Project Council
SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE
Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Posts: 9
Threads: 1
Joined: Dec 2014
Reputation:
2
Sex: Male
Thanks: 8
Given 5 thank(s) in 4 post(s)
RE: Cannot reuse previously deleted email address
09-04-2019, 07:58 PM
thank you it works great
|