views:

215

answers:

3

A Notes calendar entry has an Item called "Chair", which is a distinguished name along the lines of "CN=My Name/OU=Something/O=SomethingElse". How do I convert this to an SMTP address such as "[email protected]"? I tried looking at NotesName which has an Addr821 property, but this only seems to work if you give it an SMTP address - when given a distinguished name, Addr821 gives you back the same thing.

One option I see is to use the address book, but how do I look it up using a distinguished name?

I assume I could look it up using LDAP, but how does my code find out the LDAP server (which in this case is Novell)?

Any help would be appreciated.

I am using c# with Interop.Domino.dll.

+3  A: 

I've never used interop.domino.dll, but I think these approaches might help you:

If you can use the evaluate function, you could use the @NameLookup formula:

evaluate("@NameLookup([Exhaustive];Chair;'InternetAddress')",CalendarDocument)

Another approach is to "manually" look the name up in the Domino Directory:

  • Go through session.addressbooks, find one that's public and on a server.
  • Get the view $VIMPeople.
  • getDocumentByKey using the abbreviated name format.
Anders Lindahl
A: 

If they have Novell Identity Manager, which would be synchronizing data from multiple sources to other multiple destinations, and you have an eDirectory instance to use for LDAP connectivity, just read back the Mail attribute.

Now it depends on how the sync to Notes is handled. I usually would store the Notes fully distinguished name in an attribute in eDirectory, since as you have noted, it is useful to have.

However, if the class of this "Chair" object is not a User nor a group, it is likely they are not synchronizing it. (Mail in DB's are a common third class that might be possible).

geoffc
A: 

If you want to go manually: open up the Names.nsf or use 'Directory Assistance' (details escape me), open up the $Users view and locate the users 'person' document using Abbreviated UserName (derived from the 'chair' name), locate and use the 'InternetAddress' field value. This presumes that this field has been populated with the 'current/real' email address.

While $Vim views (and others) can be useful, you might have more work to do to disambiguate user names in large orgainsations to derive the correct form of the name matching required.

$Users view can match on Abbreviated, Common User name, first, last, shortname and soundex and is generally the most useful 'lookup' view. It is most likely to be 'fully built' as the main notes mail router uses this view to route emails.

To convert the name to the 'distinguished format' use either @name([Abbreviate]; name) or the LotusScript equivalent: Something like:

dim n as new notesName
Set n = session.CreateName(canonical/distinguished/name)
distname = n.abbreviated
andora