[vchkpw] Re: ONCHANGE behavior

2006-04-17 Thread Robin Bowes
Tom Collins wrote: > On Apr 16, 2006, at 10:41 PM, Rick Widmer wrote: >> >> Throwing in add-user and mod-user is arbitrarily picking _some_ of the >> internal functionality of the add-domain operation. If you want them >> why don't we throw in: > > I think I agree with Robin on this. > > If I've

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-17 Thread Tom Collins
On Apr 16, 2006, at 10:41 PM, Rick Widmer wrote: Robin Bowes wrote: Rick Widmer wrote: I would still argue that the hooks should match the calls in the vopmail api, and not an arbitrary subset of the operations within them. Why? Why not make the hooks reflect the "useful" operations rather th

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Rick Widmer
Robin Bowes wrote: Rick Widmer wrote: I would still argue that the hooks should match the calls in the vopmail api, and not an arbitrary subset of the operations within them. Why? Why not make the hooks reflect the "useful" operations rather than just what goes in internal to vpopmail? I t

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread John Simpson
On 2006-04-16, at 1649, Robin Bowes wrote: John Simpson wrote: On 2006-04-16, at 0639, Robin Bowes wrote: It also calls different "scripts" for each hook rather than having one monolithic "something's changed" script. Would that be a better approach for vpopmail? i don't think so. if you

[vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Robin Bowes
John Simpson wrote: > On 2006-04-16, at 0639, Robin Bowes wrote: > >> It also calls different "scripts" for each hook rather than having one >> monolithic "something's changed" script. Would that be a better approach >> for vpopmail? > > i don't think so. if you want to use this kind of approach,

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread John Simpson
On 2006-04-16, at 0639, Robin Bowes wrote: If you look at qpsmtpd (which is where I believe the idea of onchange hooks came from) not really... it's something i've wished that vpopmail had for several years, but never had the time to write. It also calls different "scripts" for each hook

[vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Robin Bowes
Rick Widmer wrote: > Robin Bowes wrote: >> Having thought about this some more, I think that a better approach >> would be to have both pre- and post- hooks for each action and to call a >> separate script for each hook. > > This has some possibilities. There would be an advantage if most of the

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Rick Widmer
Robin Bowes wrote: Having thought about this some more, I think that a better approach would be to have both pre- and post- hooks for each action and to call a separate script for each hook. This has some possibilities. There would be an advantage if most of the hooks were empty, and a liabil

[vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Robin Bowes
John Simpson wrote: > (re-arranging things so the sequence of my answers makes sense...) > > On 2006-04-15, at 2237, Rick Widmer wrote: >> John Simpson wrote: >>> for me, the trick is dealing with the fact that input may arrive on >>> the pipe at any time- including three notifications within the

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Rick Widmer
Robin Bowes wrote: What is [EMAIL PROTECTED] also forwards to [EMAIL PROTECTED] How does valias_remove [EMAIL PROTECTED] know which alias to remove? valias_remove( alias, domain, alias_line ); You would call: valias_remove( 'foobar', 'example.com', '[EMAIL PROTECTED]' ); or to eliminate

[vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Robin Bowes
Rick Widmer wrote: > I don't see any value in reporting a delete operation after the fact, > other than to log it. On the other hand it might be a good idea to move > the script before the delete. That would give you a chance to take a > snapshot of the resource usage right before delete, or may

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Rick Widmer
Robin Bowes wrote: I really don't think the multiple calls cause any problem at all and add clarity, i.e. they reflect what's actually happening rather than requiring the sysadmin to make assumptions about what's going on behind the scenes. For example, assuming that a postmaster user is created

[vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Robin Bowes
John Simpson wrote: > On 2006-04-15, at 1917, Rick Widmer wrote: >> Robin Bowes wrote: >>> What is the problem you are trying to solve? >> >> No real problem, just something I consider wasteful of resources. For >> example, if all you are doing is rebuilding a validrcptto database >> currently you

[vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Robin Bowes
Rick Widmer wrote: > Robin Bowes wrote: >> What is the problem you are trying to solve? > > No real problem, just something I consider wasteful of resources. For > example, if all you are doing is rebuilding a validrcptto database > currently you are doing it three times every time you add a doma

[vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Robin Bowes
Rick Widmer wrote: > > I see no problem with that. You will get: > > add-domain example.com - when they run vadddomain > > add-user [EMAIL PROTECTED] - when they run vadduser > > mod-user [EMAIL PROTECTED] - when they run vmoduser > > del-user [EMAIL PROTECTED] - when they run vdeluser >

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-16 Thread Rick Widmer
John Simpson wrote: (re-arranging things so the sequence of my answers makes sense...) On 2006-04-15, at 2237, Rick Widmer wrote: John Simpson wrote: I do think it is a good idea to name the parent domain if you delete an alias domain, even if I don't know how someone would use it today.

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-15 Thread John Simpson
(re-arranging things so the sequence of my answers makes sense...) On 2006-04-15, at 2237, Rick Widmer wrote: John Simpson wrote: if the "onchange" script needs to know whether the user's request affected a real or alias domain, simply look to see if there IS another domain listed afterward

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-15 Thread Tom Collins
On Apr 15, 2006, at 4:17 PM, Rick Widmer wrote: I believe adduser() calls moduser() to store the data about the user in the vpasswd file, or the database. My recollection is that it calls moduser to set the quota. The original adduser() API in the backends didn't allow for setting a quota wh

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-15 Thread Rick Widmer
John Simpson wrote: i can understand this. however, since the call_onchange() function waits for the script to complete, it is up to you as the author of an onchange script to make it run as quickly as possible. as i explained before, my "onchange" script sends its command line arguments to

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-15 Thread John Simpson
On 2006-04-15, at 1917, Rick Widmer wrote: Robin Bowes wrote: I must admit I've not actually looked at John's code. However, my thoughts (based on your comments) are as follows: add_user should be called as well as add_domain when a new domain is created - these are separate actions that happen

Re: [vchkpw] Re: ONCHANGE behavior

2006-04-15 Thread Rick Widmer
Robin Bowes wrote: Rick Widmer wrote: John Simpson & Robin Bowes Do you really want the onchange function to be called three times on an add_domain operation, and two times on an add_user operation? I find it problematic that you are notified of the mod_user before the add_user, and personal

[vchkpw] Re: ONCHANGE behavior

2006-04-15 Thread Robin Bowes
Rick Widmer wrote: > John Simpson & Robin Bowes > > Do you really want the onchange function to be called three times on an > add_domain operation, and two times on an add_user operation? I find it > problematic that you are notified of the mod_user before the add_user, > and personally would pre