[imp] Re: Initial folders and settings for all users

Craig White craigwhite at azapple.com
Thu Mar 3 01:18:03 PST 2005


On Thu, 2005-03-03 at 08:39 +0000, Áncor González Sosa wrote:
> I have a server with both Courier-IMAP and Postfix configured to get users 
> from a MySQL database and have IMP installed with IMAP authentication. 
> Everything worked with a straigthforward installation.
> 
> Now, I have to create all the user accounts. I will do it with a command-line 
> PHP script and I want all user to have the same initial preferences and 
> folders. My user creation script should:
> 
> 1) Create the sent-mail ("Enviados"), deleted ("Papelera"), "Spam" and Drafts 
> ("Borradores") folders.
> 2) Create the default identity with the user name, surname and address
> 3) Set-up a filter for DSPAM marked messages
> 4) Set any other IMP/Horde preference
> 
> It seems that (2) and (3) can be achieved with a hook as seen in
> http://wiki.horde.org/display.php?referrer=HowTo&page=CustomizingPreferences#toc5
> 
> How can I automatically create the IMP special folders trought a command-line 
> PHP script or a IMP hook?
----
the folders need to be created in courier - imp would only handle things
like include the folders in a list of folders to poll for new mail.

I am not familiar with courier but I used to use uw-imap, which put
'folders' in a users home directory which I would put into /etc/skel but
of course this doesn't apply here. I recently started using cyrus-imapd
and through it's configuration, it permits me to 'autocreate' folders
when the user's mailbox is created.

As for item #4...

I have a comprehensive system to have a 'default user' i.e. an
Administrator and this set of 'hooks' would allow you to choose which
settings you want to copy from the 'default user' upon first login. This
is extremely simple to implement.

The 'default user' thing is finished, at least for now because I think
that there will be enough interest in this to more tightly integrate it
into horde and it's likely that the code can be cleaned up a bit. I have
been holding it back because I have been working on a 'horde-utils'
quasi-module that would allow you to clear the settings for a specific
attribute across the board (except for the default user) - for example,
if you set up all of the categories and colors for the 'default user',
this utility would allow you to clear out the settings for these
properties for all existing users so the next time that they performed a
login, they would get those settings. Obviously, someone with some skill
with their SQL backend can accomplish this pretty easily.

also as part of these 'horde-utils' - I am including a 'shared object'
inspector which would query an sql backend for shared objects and allow
you to delete or reassign them to another user. This is significantly
more complicated since horde_datatree contains the base elements and
horde_datatree_attributes has more items that link to the datatree so
you can't change one without changing the other. 

If you want the 'default user' stuff before I finish the 'horde-utils' -
send me a private email and I'll send it to you. Otherwise, it appears
that I won't finish the horde utils before the weekend and maybe longer
since I haven't done html in a long time and my php skills are minimal
at best so progress is slow (I have to have one browser window open to
pear.php.net, www.php.net and www.w3c.org for their basic usage stuff).
In fact, my SQL knowledge is pretty weak as well - why am I even doing
this?  ;-)

Craig



More information about the imp mailing list