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. js callback 和 js 混淆

    function test(a,callback){ a+=100; callback(a) } function abc(a){ a+=100; alert(a); } test(5,abc) js ...

  2. 406 UDP协议是面向非连接的协议

    HTTP The Definitive Guide   Table 3-1. Common HTTP methods   Method Description Message body?   GET ...

  3. 一种历史详细记录表,完整实现:CommonOperateLog 详细记录某用户、某时间、对某表、某主键、某字段的修改(新旧值

    一种历史详细记录表,完整实现:CommonOperateLog 详细记录某用户.某时间.对某表.某主键.某字段的修改(新旧值). 特别适用于订单历史记录.重要财务记录.审批流记录 表设计: names ...

  4. iOS-原生纯代码约束总结(一)之 AutoresizingMask

    一,概述 iOS有两大自动布局利器:autoresizing 和 autolayout(autolayout是IOS6以后新增).autoresizing是UIView的属性,一直存在,使用也比较简单 ...

  5. iOS中的静态库与动态库,区别、制作和使用

    如果我们有些功能要给别人用,但是又不想公开代码实现,比如高德地图.第三方登录分享等等,这时候我们就要打包成库了.库分静态库和动态库两种: 静态库:以.a 和 .framework为文件后缀名.动态库: ...

  6. 转:JDK动态代理为什么必须用接口以及与CGLIB的对比

    参考链接: JDK动态代理为什么必须用接口以及与CGLIB的对比 文章中提到:试验了JDK动态代理与CGLIB动态代理.从Spring的AOP框架介绍中得知对于使用接口的类,Spring使用JDK动态 ...

  7. python内置函数,lambda表达式,文件读写

    Lambda表达式: lambda是个匿名函数,自动加return返回 a={ 6:2,8:0, 1:4,-5:6,99:11,4:22} print(sorted(a.items()))#按key排 ...

  8. php面向对象的封装性

    面向对象编程 1:封装性 访问修饰符,作用为封装,防止外部访问. public 公有的 private 私有的 protected 受保护的 一开始具体也没搞明白是怎么回事,搞个小的Demo就出来了 ...

  9. 7620N路由器刷openwrt系统并配置***

    之前一直用goAgent***,主要用gmail.逛逛twitter.youtube.维基百科.加速stackoverflow等等.但goAgent只能PC使用,手机.iPad都不能用,直到我拿到了一 ...

  10. jq优化

    1.使用链式写法 $('div').find('h3').eq(2).html('Hello');采用链式写法时,jQuery自动缓存每一步的结果,因此比非链式写法要快.根据测试,链式写法比(不使用缓 ...