邮件如何转发邮件? [英] how to notice if a mail is a forwarded mail?

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

问题描述

我有一个很特别的问题。



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



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



所以现在有没有人知道如何一个消息是转发的消息,或者如何告诉Outlook不将用户属性复制到转发(新)消息?



thx。我们的想法是,但不是为我们的案例工作

- 第二个userproperty包含一个简单的标签linkefromSystem。因为这也将被复制。

- 包含从subject和Body计算的hashs的第二个userproperty。原因可以由用户更改。我们只是创建消息,添加所有属性并显示它。从这一点开始,我们不再需要控制邮件发生了,直到服务处理它。

解决方案

您的服务使用EWS应检查 ConversationIndex ,只有当 22个字节长原始源消息)更新数据库。转发电子邮件和回复电子邮件会继续在 ConversationIndex 中附加5个字节( 10个字符),将其扩展到超过22个字节。



Sample ConversationIndexes



原始:01CDD15D80E51C1D4522172840ACA96287DA28A15D97
回复:01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630
转发:01CDD15D80E51C1D4522172840ACA96287DA28A15D970000018630000000FC30

ConversationIndex 表示 ConversationTopic (本质上GUID +时间戳)。请参阅在MSDN上使用对话 ConversationIndex 明确定义在MSDN这里

  if(message.ConversationIndex.Length == 22) 
{
//更新DB体,主题等
}

还要确保您加载了 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天全站免登陆