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. 关于OpenJDK和Orcale JDK区别

    一.环境Centos 今天搞tomcat发现了一个问题,众所周知,tomcat需要java环境支持,然后我今天就想着尝试yum安装java,命令 yum install -y java* 确实可以安装 ...

  2. 蚂蚁金服缘何自研Service Mesh?

    2018年,微服务方兴未艾,Service Mesh(服务网格)又快速崛起.有观点认为,2018年可被称之为“Service Mesh元年”,在未来两年中,Service Mesh将迎来爆发式增长,成 ...

  3. js 去除金额的千位分隔符

    export function delcommafy(num) { if (num != undefined) { num = num.toString(); num = num.replace(/[ ...

  4. zookeeper集群扩容/下线节点实践

    环境:zookeeper版本 3.4.6jdk版本 1.7.0_8010.111.1.29 zk110.111.1.44 zk210.111.1.45 zk310.111.1.46 zk410.111 ...

  5. Hystrix在项目中实践

    Hystrix在项目中实践 https://mp.weixin.qq.com/s/4Fg0COnWRB3rRWfxbJt7gA

  6. azkaban---visualize crontab--frontail

    azkaban---visualize crontab azkaban--docker-----http://www.jkeabc.com/254015.html azkaban--tips   ht ...

  7. eclipse debug模式

    eclipse debug模式 1.怎样在Eclipse中设置断点 方法/步骤 1 首先打开工程项目 2 第一种是,把鼠标移动想要设置断点的行,在行号前面空白地方双击,就会出现断点 3 第二种是,在菜 ...

  8. Java之旅_面向对象_多态

    参考并摘自:http://www.runoob.com/java/java-polymorphism.html 多态 多态是一个行为具有多个不同表现形式的能力. 多态就是同一个接口,使用不同的实例而执 ...

  9. python进程池爬取下载美女图片(xpath)--lowbiprogrammer

    # -*- coding: utf-8 -*-import requests,osfrom lxml import etreeimport multiprocessingfrom retrying i ...

  10. 根据Request获取客户端IP

    转自: http://www.cnblogs.com/icerainsoft/p/3584532.html http://www.cnblogs.com/bingya/articles/3134227 ...