A NOTE has been added to this issue. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=505 
====================================================================== 
Reported By:                jasb
Assigned To:                aaron
====================================================================== 
Project:                    DBMail
Issue ID:                   505
Category:                   Command-Line programs (dbmail-users, dbmail-util)
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     assigned
target:                      
====================================================================== 
Date Submitted:             09-Feb-07 23:25 CET
Last Modified:              10-Feb-07 01:21 CET
====================================================================== 
Summary:                    When deleting a user with sieve scripts, the sieve
script should be erased also.
Description: 
When i delete a user with dbmail-users, i think that if the user has one or
more sieve script, the values should be deleted along the user.
I had a situation today with this, for example:

I use the free numbers in owner_idnr so, imagine this:
I have a user created with owner_idnr=80, and created a sieve script with
some rule, later this i've created some more users, and some time ahead
i've deleted the user with owner_idnr=80, and the sieve script just stayed
intact in the DB, and the new user is going to take place of the
owner_idnr=80 that has a script from the older user with onwer_idnr=80
that should have been deleted.
What do you think about this? should it be deleted also? i think so, give
some feedback :P

Jorge
====================================================================== 

---------------------------------------------------------------------- 
 aaron - 10-Feb-07 00:58  
---------------------------------------------------------------------- 
There's a foreign key relationship that should remove entries from the
dbmail_sievescripts table when the corresponding useridnr is removed
dbmail_users. Is that not working for you?

There's also functionality in dbmail-sievecmd to delete sieve scripts for
a user. 

There isn't a command in dbmail-util to check for unowned sieve scripts.
I'll add that. 

---------------------------------------------------------------------- 
 jasb - 10-Feb-07 01:21  
---------------------------------------------------------------------- 
Hum... going to check my table defenitions, maybe i've missed that in some
where.

An aditional argument for dbmail-util would be nice sinse, at least me,
run dbmail-util once per day.

But what i've thinked was, that dbmail-users could remove that info even
if there's no foreign relation, what do you think?

below there's the show create table of table dbmail_sievescripts, i don't
see nothing related to foreign keys...

CREATE TABLE `dbmail_sievescripts` (
  `id` bigint(20) NOT NULL auto_increment,
  `owner_idnr` bigint(20) NOT NULL default '0',
  `active` tinyint(1) NOT NULL default '0',
  `name` varchar(100) NOT NULL,
  `script` text NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `dbmail_sievescripts_1` (`owner_idnr`,`name`),
  KEY `dbmail_sievescripts_2` (`owner_idnr`,`active`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 

I was checking create_tables.sql from 2.2.2 version and i see that it has
a reference on that, i think that when i started using dbmail this doesn't
exist, ok it didn't because i started with dbmail 2.0x, but when i upgraded
to 2.1x maybe the upgrade script of mysql was missing this and was added
after i upgraded.

3 possible solutions here
1-add check on dbmail-users to delete this manually
2-add the foreign key to the table
3-add this option to dbmail-util


my best opinion is, add the new option to check this to dbmail-util, and
i'll update the table defenition to make it work from now on.
(you already said that were going to add this to dbmail-util :) )

Do you agree Aaron? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-Feb-07 23:25 jasb           New Issue                                    
09-Feb-07 23:25 jasb           Issue Monitored: jasb                        
10-Feb-07 00:55 aaron          Status                   new => assigned     
10-Feb-07 00:55 aaron          Assigned To               => aaron           
10-Feb-07 00:58 aaron          Note Added: 0001821                          
10-Feb-07 01:21 jasb           Note Added: 0001822                          
======================================================================

_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to