And if anyone is into dbmail-util, lets not forget bug id 305 .. I think
it's managed to slip by unaddressed for well over a full year now
(acknowledged, high priority and several sql solutions listed in the
report).


On Fri, 2007-06-01 at 23:30 +0200, Michael Monnerie wrote:
> On Freitag, 1. Juni 2007 Aaron Stone wrote:
> > It might actually be useful to add another flag to dbmail-util to do
> > this for you -- a sort of 'rebuild everything from scratch' option.
> 
> I also found these things should be done in dbmail-util:
> 1) dbmail_aliases: when you have an entry
> alias1 -> 1000 (i.e. the userid 1000)
> and then you delete the user with userid 1000, you have a stale entry 
> that should be removed.
> The bad thing is that the design of that table is broken, as you can't 
> guarantee that the number refers to an existing user. OTOH, I don't 
> know how to do it better, other than introducing another 
> table "dbmail_external_aliases" just for text entries, and changing the 
> existing dbmail_aliases to having only user_idnr.
> So at least dbmail-util should clean up the mess here.
> 
> To see which aliases are stale:
> select * from dbmail_aliases left join dbmail_users on 
> (deliver_to=user_idnr) where deliver_to not like '[EMAIL PROTECTED]' and 
> userid is 
> null order by deliver_to;
> 
> 2) dbmail_aliases: check for loops that can happen when userid's (=login 
> names) are changed:
> alias -> deliver_to -> userid
> and that userid equals alias. I've had this after renaming logins from 
> cyrus users that were "user.dom.ain" to "[EMAIL PROTECTED]", and then the 
> old aliases [EMAIL PROTECTED] -> user.dom.ain became redundant.
> 
> To delete those directly:
> delete from dbmail_aliases where alias in (select a.alias from 
> dbmail_aliases as a left join dbmail_users as b on (a.deliver_to = 
> b.user_idnr) where char_length(a.deliver_to) = 4 and a.alias=b.userid);
> 
> mfg zmi
> _______________________________________________
> DBmail mailing list
> [email protected]
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
-- 
Jesse Norell - [EMAIL PROTECTED]
Kentec Communications, Inc.

_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to