nmh-workers
[Top] [All Lists]

[Nmh-workers] Re: Google contacts an MH

2009-07-04 22:50:21
"Jeffrey Honig" <jch(_at_)honig(_dot_)net> writes:

I have been working on Python scripts to manipulate gContacts.
...
Not to far down on my list is the ability to build MH aliases from
the contacts.

Great!

A script to add an e-mail address to a new, or existing, contact
wouldn't be too hard.

I think the hardest part will be parsing the aliases file and
determining what to do with the pieces. The tool will likely need to
enforce some structure on the aliases as well.

Let's chat about how such a tool would work. I'd imagine that everyone
on this list would have something to contribute :-).

Some general principles to discuss:

1. Do we simply sort the file by alias, or do we allow the user to
organize the file as they wish. I currently have sections by subject
or business but would consider changing that. In any case, the
addresses for a single alias must not be sorted in order to preserve
the primary address. In MH-E, we have a user-customizable setting for
prepending new aliases to the beginning or appending new aliases to
the end of the file if they don't already exist which supports a
user-defined order. By default, this setting is alphabetical which
supports an alphabetized order.

We could probably have a similar command-line argument, so I guess
this won't be too controversial.


2. Do we create a separate alias for each address for a particular
person, or a single alias for a particular person? Let's consider the
two scenarios.

a) Single alias per person

    bill.wohler: Bill Wohler <wohler(_at_)newt(_dot_)com>
    bill.wohler: Bill Wohler <bill(_dot_)wohler(_at_)nasa(_dot_)gov>

This method latter is convenient in MH-E since we use the alias as a suggested
folder name. This puts all messages from a person in a single folder.

I don't add organization information to my personal aliases, but I do
add it for others. For example, I might have:

    joe.blow: Joe Blow <joe(_at_)yahoo(_dot_)com>
    google.jane.doe: Jane Doe <jane(_at_)google(_dot_)com>

To complicate matters, consider my situation at work. We have folks
working in our group NASA who are either civil servants or work for
one of two contractors. But we all have nasa.gov addresses and I
prefix each of their address by nasa.

In this scenario, you cannot sort the file alphabetically since your
primary address for a person comes first.

b) Separate alias per address

    newt.bill.wohler: Bill Wohler <wohler(_at_)newt(_dot_)com>
    nasa.bill.wohler: Bill Wohler <bill(_dot_)wohler(_at_)nasa(_dot_)gov>

    or

    bill.wohler.newt: Bill Wohler <wohler(_at_)newt(_dot_)com>
    bill.wohler.nasa: Bill Wohler <bill(_dot_)wohler(_at_)nasa(_dot_)gov>

This makes it possible to use aliases to send to multiple addresses
for a particular person (which I find I need to do pretty often). If
the organization goes first, then it is easy to use completion in MH-E
to see all the folks at a particular organization. That's useful if
you know the name of the organization well, but might not remember the
name of the individual. It also makes for a nice grouping by
organization in a folder listing.

If the individual switches startups every week so that you don't
remember the name of the individual's organization, then this method
isn't quite as useful. If you put the name first, then completion on
the name will show all of the possibilities for that individual. You
may prefer the grouping by name as well.

One other thing to think about is that you might want to abbreviate
the name of the organization. For example, I used "df" as an
abbreviation for all of my contacts as a previous startup called
Datafusion. This might be supported with a comment in the aliases file such as:

  ; df = Datafusion

This scheme supports alphabetical sorting.


Which scheme do you prefer? Should we support both and make it
configurable? Keep reading, and see if the possible implementations
support or change your mind.


Let's discuss the synchronization considering scheme 2a. For
example, consider:

    bill.wohler: Bill Wohler <wohler(_at_)newt(_dot_)com>
    bill.wohler: Bill Wohler <bill(_dot_)wohler(_at_)nasa(_dot_)gov>

We'd want to find or create a Google contact whose first name is
"Bill" and last name is "Wohler" and ensure that both
"wohler(_at_)newt(_dot_)com" and "bill(_dot_)wohler(_at_)nasa(_dot_)gov" are 
addresses for this
individual. Note that I can have several aliases for a single person,
which is useful when creating folder names automatically from the
address.

If the alias contains organization information, then that can be used
to set the Company field.

What happens if there are two entries with Bill Wohler in the Google
contacts?

The other direction is equally straightforward. If I have an contact
whose first name is Bill and last name Wohler and address
wohler(_at_)newt(_dot_)com, then the following alias would be created (and
inserted pursuant to #1) if it doesn't already exist.

    bill.wohler: Bill Wohler <wohler(_at_)newt(_dot_)com>

Otherwise, if the alias already exists, then the new alias would be
appended immediately after the existing alias; the user would have to
manually make it a primary address by making it the first alias for
that user.

If it is desired that the alias contain the organization, this has to
be done manually as well.


Let's now consider synchronization using scheme 2b.

    bill.wohler.newt: Bill Wohler <wohler(_at_)newt(_dot_)com>
    bill.wohler.nasa: Bill Wohler <bill(_dot_)wohler(_at_)nasa(_dot_)gov>

We'd want to find or create a single Google contact whose first name
is "Bill" and last name is "Wohler" and ensure that both
"wohler(_at_)newt(_dot_)com" and "bill(_dot_)wohler(_at_)nasa(_dot_)gov" are 
addresses for this
individual.

If the alias contains organization information, then that can be used
to set the Company field.

What happens if there are two entries with Bill Wohler in the Google
contacts?

The other direction is equally straightforward. If I have an entry
whose first name is Bill, last name Wohler, and Company Orbital, and
addresses bill(_dot_)wohler(_at_)nasa(_dot_)gov and wohler(_at_)newt(_dot_)com, 
we'd have to
create the following two aliases (and insert pursuant to #1) if they
didn't already exist:

    bill.wohler.newt: Bill Wohler <wohler(_at_)newt(_dot_)com>
    bill.wohler.nasa: Bill Wohler <bill(_dot_)wohler(_at_)nasa(_dot_)gov>

Note that we can't use the Company name in the alias since an individual
may have several addresses. This also matches the way I create aliases
today. It also avoids having to abbreviate programmatically really
long company names.


Hey, you got this far!

I think I'm leaning towards scheme 2b but I'll have to review my
aliases to see how that'll work out. Note that scheme only really
matters when creating new aliases--the user can always change the
alias since a new alias will not be created if the address is found.

Which scheme do you prefer or currently use? Other thoughts?

-- 
Bill Wohler <wohler(_at_)newt(_dot_)com>  http://www.newt.com/wohler/  GnuPG 
ID:610BD9AD



_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>