[imp] Moving Addressbooks

jonathan soong jon.soong at imvs.sa.gov.au
Mon Aug 25 16:38:34 PDT 2003


The object ID is just a random, unique MD5...
i saw this on the Turba list a short while back (not my work):

Michael Richey wrote:

Thanks Jan, it worked perfectly.

To anyone who wants to know how I generated the ID's:
I couldn't use timestamp because I kept getting duplicates (script runs
faster than the clock)...so I used /dev/urandom to generate the ID's

I started with a comma separated list of
senders_address,contact_name,contact_email and performed the following

bash-2.05b$ for line in `cat addresses.list | sed s/^/","/g | sed s/"
"/"_"/g`; do echo $line | sed s/^/`head -c6 /dev/urandom | md5sum | sed
s/"  -"//g`/g >> modified.list ; done

The above statement can be broken into several parts.
first, sed s/^/","/g - inserts a comma at the beginning of the line
second, sed s/" "/"_"/g - inserts an "_" wherever it fines a space
next, sed s/^/`head -c6 /dev/urandom | md5sum | sed s/"  ="//g`/g -
inserts a random number from /dev/urandom which has been md5summed and
stripped of its trailing "  -" at the beginning of the line

finally, it's all concatenated onto the end of modified.list

With little effort, one can add quotes around each field and insert the
proper statements to turn the whole shebang into an sql statement.

When all was said and done, 3556 address book listings were imported
into the database.

Anyway, I hope this helps anyone in the same situation.

Thanks again Jan, I continue to be impressed by the capabilities (and
stability) of horde!  I'm setting it up on a separate server just see
what I can make it do.

Michael


Curt LeCaptain wrote:

> Hey everyone,
>
> I'm wondering if there's anyway to convert a BasiliX address book to a 
> Turba addressbook.  I've attempted to add a record to my MySQL 
> database as an address, but it doesn't create an object ID and I'm not 
> sure how the Object ID is created.  It's not extremely mission 
> critical that this happens, it'd just be nice if we could move the 
> address books over for customers.  The other problem is that I noticed 
> a manual insert into this database without the Object ID breaks some 
> functionality.  I have Horde set to automatically open up IMP>Inbox, 
> and as soon as I added that addressbook entry, it no longer could open 
> Inbox directly.  As soon as the addressbook entry was deleted from the 
> table, functionality was restored.
> Oh, one last important detail, BasiliX doesn't have an export option 
> for address books... so that's another wrench in the system.
>
> Thanks,
> Curt LeCaptain,
> Systems Administrator,
> Infinity Technology, Inc.
>
>
>



More information about the imp mailing list