如何通知邮件是否为转发邮件? [英] how to notice if a mail is a forwarded mail?

查看:38
本文介绍了如何通知邮件是否为转发邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常特殊的问题.

如果我们在 Outlook 中创建邮件,我们会添加一个 UserProperty,其中包含我们系统的 DataBase-ID,因此我们可以将邮件链接到表示的 DataBase-Item.在读取每个邮箱中的邮件并自动导入它们的服务上,我可以使用 ExtendedPropertyDefinitions 读取此属性.到目前为止一切都很好...

如果用户现在在 Outlook 中转发邮件,Olk 会将 UserProperty 复制到新邮件.现在我的问题开始了.现在我的服务认为新消息也链接到我们的数据库并使用新的正文和新的主题更新 DB-Entry.

那么现在有人如何确定邮件是否为转发邮件,或者如何告诉 Outlook 不要将用户属性复制到转发的(新)邮件中?

谢谢.杰

我们想到了什么,但对我们的案例不起作用
- 包含简单标签链接fromSystem"的第二个用户属性.因为这也会被复制.
- 包含从主题和正文计算的哈希和的第二个用户属性.因为两者都可以由用户更改.我们只是创建消息,添加所有属性并显示它.从现在开始,在服务处理邮件之前,我们无法再控制邮件发生了什么.

解决方案

您使用 EWS 的服务应该检查 ConversationIndex 并且仅在22 字节长时更新数据库strong>(原始源消息).转发电子邮件和回复电子邮件不断向 ConversationIndex 附加 5 个字节(10 个字符),将其扩展到 22 个字节以上.

示例对话索引

<前>原件:01CDD15D80E51C1D4522172840ACA96287DA28A15D97回复:01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630转发:01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630000000FC30

ConversationIndex 表示 ConversationTopic 的顺序(本质上是 GUID + 时间戳).请参阅处理 MSDN 上的对话.ConversationIndex此处在 MSDN 上明确定义.

 if (message.ConversationIndex.Length == 22){//更新数据库主体、主题等.}

还要确保您加载了 EmailMessageSchema.ConversationIndex,然后再尝试访问其值.

I have a very special problem.

If we create a mail in Outlook, we add a UserProperty which contains a DataBase-ID of our System, so we can Link the mail to the representing DataBase-Item. On the service which reads the mails in each Mailbox and imports them automatically I can read this property by using ExtendedPropertyDefinitions. So far everything is fine...

If the User now forwards the message in Outlook, Olk copies the UserProperty to the new message. And now my problems beginn. Now my Service thinks the new message is also linked to our database and updates DB-Entry with the new Body and new Subject.

So does anyone now how to find out if a message is a forwarded one or how to tell Outlook not to copy the userproperty to the forwarded (new) message?

thx. Jay

What we thought about, but isnt working for our case
- a second userproperty containing a simple tag linke "fromSystem". Cause this would be copied too.
- a second userproperty containing a hashsum calculated from subject and Body. Cause both could be changed by the user. We just create the message, add all properties and Display it. from this Point on we no longer have control what is Happening to the mail until the Service handles it.

解决方案

Your service consuming EWS should check the ConversationIndex and only update the database if it's 22 bytes long (original source message). Forward emails and reply emails keep appending 5 bytes (10 chars) to the ConversationIndex extending it beyond 22 bytes.

Sample ConversationIndexes

Original: 01CDD15D80E51C1D4522172840ACA96287DA28A15D97
Reply:    01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630
Forward:  01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630000000FC30

ConversationIndex represents the sequential ordering of the ConversationTopic (essentially GUID + timestamp). See Working with Conversations on MSDN. ConversationIndex is explicitly defined on MSDN here.

 if (message.ConversationIndex.Length == 22)
 {
   // update DB body, subject, etc.
 }

Also make sure you load the EmailMessageSchema.ConversationIndex before trying to access its value.

这篇关于如何通知邮件是否为转发邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆