Outlook 联系人同步 - 如何识别要同步的正确对象?
我有一个 Web 应用程序,可以通过 CDO 将 Outlook 联系人同步到数据库(并返回)。 数据库只包含每个联系人一次(至少理论上是这样,当然会发生双联),为联系人提供单点更改,无论有多少用户在 Outlook 中拥有该特定联系人(例如 Interaction 或类似产品)。
同步过程不是自动的,而是由用户初始化的。 在用户决定同步其联系人之前,可能会经过任意时间跨度。 这些联系人的子集可能已被其他用户同时更新。
一般来说,这运行得很好,但我一直无法解决这个基本问题:
如何毫无疑问地识别邮箱中的联系人对象?
- 我不能依赖
PR_ENTRYID
,这个 接触移动时属性发生变化或 邮箱移动。 - 我不能依赖我自己的 ID(例如 DB 表 ID),因为这些被复制 与联系。
- 我绝对不能依赖领域 例如姓名或电子邮件地址,他们 可能会发生变化和更新。
目前我使用 1(首选)和 2(备用)的组合。 但不可避免的是,有时用户会遇到同步到错误联系人的问题,因为没有一个具有给定的 PR_ENTRYID,而是两个具有相同的 DB ID,其中选择了错误的一个。
市面上有很多 Outlook 同步产品,所以我想这个问题一定是可以解决的。
I have a web application that syncs Outlook contacts to a database (and back) via CDO. The DB contains every contact only once (at least theoretically, of course doublets happen), providing a single point of change for a contact, regardless of how many users have that particular contact in Outlook (like Interaction or similar products).
The sync process is not automatic, but user-initialized. An arbitrary timespan can pass before users decide to sync their contacts. A subset of these contacts may have been updated by other users in the meantime.
Generally, this runs fine, but I have never been able to solve this fundamental problem:
How do I doubtlessly identify a contact object in a mailbox?
- I can't rely on
PR_ENTRYID
, this
property changes on contact move or
mailbox move. - I can't rely on my own IDs (e.g. DB
table ID), because these get copied
with the contact. - I absolutely can't rely on fields
like name or e-mail address, they
are subject to changes and updates.
Currently I use a combination of 1 (preferred) and 2 (fall-back). But inevitably, sometimes users run into the problem of synching to the wrong contact because there is none with a given PR_ENTRYID
, but two with the same DB ID, of which the wrong one is chosen.
There are a bunch of Outlook-synching products out there, so I guess the problem must be solvable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了类似的问题,需要使用一个进行联系人同步的内部 Outlook 插件来克服。 我最终在 Outlook 对象中粘贴了一个数据库 ID,并在进行同步时引用该 ID。
这里的区别在于,我们的系统有一堆重复项,稍后由用户解决。 当它们合并时,我将删除旧记录并使用所有新信息和新 ID 更新 Outlook。
您可以进行模糊匹配来识别重复项,但重复解决是一个有趣的问题,主要是反复试验。 我们已经成功地使用编辑距离算法将名称和地址清理为哈希码来实现“模糊”匹配逻辑。
祝你好运,我的同步经历有点痛苦。
I had a similar problem to overcome with an internal outlook plugin that does contact syncing. I ended up sticking a database id in the Outlook object and referring to that when doing syncs.
The difference here is that our system has a bunch of duplicates that get resolved later by the users. When they get merged I'll remove the old records and update outlook with all of the new information along with a new id.
You could do fuzzy matching to identify duplicates, but duplicate resolution is a funny problem that's mostly trial and error. We've been successful at implementing "fuzzy" matching logic using the levenshtein distance algorithm for names and addresses cleaned down to a hash code.
Good luck, my syncing experiences have been somewhat painful.