inbox.MoveTo Folder does not move message out of inbox #160

 Closed
vnwind opened this issue on 14 Mar 2015 · 3 comments

Comments

 
Assignees

No one assigned

 
Labels
 
Projects

None yet

 
Milestone

No milestone

2 participants
 

vnwind commented on 14 Mar 2015

Hi I am trying to move a message to a different folder using inbox.MoveTo(uid, matchFolder);. Here is my code:

foreach (var uid in matchedMsgList)
{
var matchFolder = imapClient.GetFolder(folderName);
if (matchFolder != null)
inbox.MoveTo(uid, matchFolder);
}

However, the message shows up on both inbox and matchFolder under outlook. View the message detail and it is label as "Inbox" & "matchFolder"

How can I move the message out of Inbox completely? Or is it has something to do with my outlook program?

Thanks for your help

 

 vnwind changed the title from Move.ToFolder to inbox.MoveTo Folder does not move message out of inbox on 14 Mar 2015

 jstedfast added the question label on 14 Mar 2015

 

Owner

jstedfast commented on 14 Mar 2015

If you look at the source code for the MoveTo() method, what you'll notice is that there are several code paths depending on the features that the IMAP server supports.

If the IMAP server supports the MOVE extension, then MailKit's MoveTo() method will use the MOVEcommand. I suspect that your server does not support the MOVE command or you probably wouldn't be seeing what you are seeing.

When the IMAP server does not support the MOVE command, MailKit has to use the COPY command to copy the message(s) to the destination folder. Once the COPY command has completed, it will then mark the messages that you asked it to move for deletion by setting the \Deleted flag on those messages.

If the server supports the UIDPLUS extension, then MailKit will attempt to EXPUNGE the subset of messages that it just marked for deletion, however, if the UIDPLUS extension is not supported by the IMAP server, then it cannot safely expunge just that subset of messages and so it simply stops there.

My guess is that your server supports neither MOVE nor UIDPLUS and that is why Outlook continues to see the messages in your folder. I believe, however, that Outlook has a setting to show deleted messages with a strikeout (which you probably have disabled).

So to answer your question more succinctly: After calling folder.MoveTo (...);, if you are confident that the messages marked for deletion should be expunged, call folder.Expunge ();

 
 

Owner

jstedfast commented on 14 Mar 2015

FWIW, if you follow the directions in the FAQ for getting protocol logs, it should show you in more detail what I'm talking about and will confirm (or deny) my explanation.

inbox.MoveTo Folder does not move message out of inbox的更多相关文章

  1. Java-收邮件

    import java.util.Properties; import javax.mail.Folder; import javax.mail.Message; import javax.mail. ...

  2. React 入门学习笔记整理(九)——路由

    (1)安装路由 React-router React-router提供了一些router的核心api,包括Router, Route, Switch等,但是它没有提供dom操作进行跳转的api. Re ...

  3. c++ Message与Folder 拷贝 析构(没有动态空间的类)

    c++ Message与Folder 拷贝 析构(没有动态空间的类) 1.两个类里边分别保存一个对方的set表,当前类有拷贝或者销毁时需要更新另一个类的set表. 2.两个类都需要访问对方的priva ...

  4. [转]VBA Check if an outlook folder exists; if not create it

    本文转自:http://www.outlookcode.com/d/code/quarexe.htm To quarantine application file attachments This O ...

  5. spark 源码分析之六--Spark RPC剖析之Dispatcher和Inbox、Outbox剖析

    在上篇 spark 源码分析之五 -- Spark内置RPC机制剖析之一创建NettyRPCEnv 中,涉及到了Diapatcher 内容,未做过多的剖析.本篇来剖析一下它的工作原理. Dispatc ...

  6. Fancytree Javascript Tree的入门使用

    Fancytree Javascript Tree的入门使用 一.概念----是做什么的能干什么 Fancytree是一个Javascript控件,它依赖于: <script src=" ...

  7. Fancytree Javascript Tree TreeTable 树介绍和使用

    Fancytree是一个非常棒的Javascript控件,功能强大,文档健全.在做Javascript Tree控件选型时,主要基于以下几点选择了Fancytree 在Javascript Tree控 ...

  8. Cryptographic method and system

    The present invention relates to the field of security of electronic data and/or communications. In ...

  9. Angular2学习笔记——路由器模型(Router)

    Angular2以组件化的视角来看待web应用,使用Angular2开发的web应用,就是一棵组件树.组件大致分为两类:一类是如list.table这种通放之四海而皆准的通用组件,一类是专为业务开发的 ...

随机推荐

  1. 客户端TortoiseSVN的安装及使用方法 (申明:来源于网络)

    客户端TortoiseSVN的安装及使用方法 (申明:来源于网络) 地址:http://blog.chinaunix.net/uid-27004869-id-4112057.html

  2. JavaScript----特效代码

    1.不同时间段显示不同问候语 <Script Language="JavaScript"> <!-- var text=""; day = n ...

  3. mapReducer 去重副的单词

    需求是: 统计输出某目录文件的所有单词,去除重复的单词. mapper阶段正常做map工作,映射. 切割单词. <key,value> -->  <word,nullWrita ...

  4. [No0000187]可能是把Java内存区域讲的最清楚的一篇文章

    写在前面(常见面试题) 基本问题: 介绍下 Java 内存区域(运行时数据区) Java 对象的创建过程(五步,建议能默写出来并且要知道每一步虚拟机做了什么) 对象的访问定位的两种方式(句柄和直接指针 ...

  5. 编译安装spark 1.5.x(Building Spark)

    原文连接:http://spark.apache.org/docs/1.5.0/building-spark.html · Building with build/mvn · Building a R ...

  6. AngularJs $watch监听模型变化

    $watch是一个scope函数,用于监听模型变化,当你的模型部分发生变化时它会通知你. $watch(watchExpression, listener, objectEquality); 举个栗子 ...

  7. haproxy实现会话保持

    HAProxy系列文章:http://www.cnblogs.com/f-ck-need-u/p/7576137.html 1.反向代理为什么需要设置cookie 任何一个七层的http负载均衡器,都 ...

  8. bc https://en.wikipedia.org/wiki/Gossip_protocol

    分布式容错性:分布式网络极其鲁棒,能够容忍部分节点的异常状态: 不可篡改性:一致提交后的数据会一直存在,不可被销毁或修改: 隐私保护性:密码学保证了数据隐私,即便数据泄露,也无法解析. 随之带来的业务 ...

  9. [Day4]Switch语句、数组、二维数组

    1.选择结构switch (1)格式 switch (表达式){ case 目标值1: 执行语句1; break; case 目标值2: 执行语句2; break; ...... case 目标值n: ...

  10. [security][modsecurity][nginx] nginx 与 modsecurity

    参考文档: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#installation-for-nginx nginx不支 ...