[turba] tsv (tab separated values), pine and mulberry address support

Liam Hoekenga liamr@umich.edu
Tue, 23 Apr 2002 00:24:14 -0400


Hey guys -

I've got a slightly revised version of my tsv stuff.  I supports import and 
export of tsv files.

I've also added the rudimentary support for importing mulberry and pine 
addressbooks into turba.  I've used it sucessfully to import stuff from pine 
and mulberry into my turba address book.  It's not perfect, but it works.

I think it should probably use the IMPORT_MAPPED case in data.php, but I 
couldn't get that working right.  So, it's kind of a bastard hybrid of 
IMPORT_MAPPED and the IMPORT_VCARD stuff.  Hopefully it can be cleaned up - I'd 
welcome help doing so.

the diff for today's version of Horde / IMP and Turba can be found at:

    http://www.umich.edu/~liamr/horde/tsv-CVS.diff

the diff for the RC2 stuff is at:

    http://www.umich.edu/~liamr/horde/tsv.diff

Known problems -
- it doesn't do anything good w/"email groups" from either program.  since 
turba doesn't do groups right now (at least I don't think it does), they should 
probably  be ignored.  mulberry groups have a "Grp:" in field 0, and pine 
groups have paranthesis in field 2.
- mulberry escapes apostrophies when it rights it's addressbook - the \' should 
be replaced with normal apostrophies (It just doesn\'t look right).
- mulberry uses a "\r" to signify a line break inside a multilined field in 
it's records (for example, address).  I don't mean the literal "\r" (carriage 
return), but the actual characters "\r".  So... an entry might contain "line 
one\rline two" in it's text after imported.
- pine does stupid things when it writes it's addressbook - hence the reason I 
couldn't use fgetcsv to handle importing data.  A line in a pine addressbook 
might look like...

liamr     Hoekenga, Liam     "Liam R Hoekenga" <liamr@umich.edu>

where the quoted string is actually part of pine's email address field.
I think that'll need to get parsed (using imap_rfc822_parse_adrlist?)

Pine also creates entries that look like this:
liamr     Hoekenga, Liam     
    "Liam R Hoekenga, BA Linguistics, University of Michigan" <liamr@umich.edu>

where what it considers to be the email address (the stuff on that second line) 
actually gets placed on a second line in the address file.  It doesn't show up 
as a long line, it's a real separate second line. :\  So... when importing, you 
end up with a record with two fields (the alias and full name) followed by a 
separate record w/ one field (the email address).  I'm not sure what to do 
about that.
- pine records can have up to 5 fields, and will only use as many as they need 
(most records only have 3)
- mulberry records *always* have 9 fields - at least the entries for people do.

anyhoo.. that's all for now.
Liam