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. ARM v8中断机制和中断处理(转)

    https://blog.csdn.net/firefox_1980/article/details/40113637 https://blog.csdn.net/firefox_1980/artic ...

  2. Red Hat6设置使用CentOS的yum源

    环境查看 red hat系统使用自己默认的yum源未注册在使用yum安装软件的时候会出现以下错误提示 可以修改成centos的yum源 卸载yum软件 rpm -qa|grep yum|xargs r ...

  3. LeetCode 11 - 盛最多水的容器 - [双指针暴力]

    题目链接:https://leetcode-cn.com/problems/container-with-most-water/description/ 给定 n 个非负整数 $a_1,a_2,\cd ...

  4. 【编译原理】c++实现自下而上语法分析器

    写在前面:本博客为本人原创,严禁任何形式的转载!本博客只允许放在博客园(.cnblogs.com),如果您在其他网站看到这篇博文,请通过下面这个唯一的合法链接转到原文! 本博客全网唯一合法URL:ht ...

  5. Java与面向对象之随感(1)

    大一下学期上完了c++课程,当时自我感觉很良好,认为对面向对象编程已经是身经百战了,但是上了院里HuangYu老师的Java课之后,才发现自己对于面向对象的编程风格的理解只在皮毛,着实惭愧不已. 假设 ...

  6. Java 输入/输出——处理流(RandomAccessFile)

    RandomAccessFile是Java输入/输出流体系中功能最丰富的文件内容访问类,它提供了众多的方法来访问文件内容,它既可以读取文件内容,也可以向文件输出数据.与普通的输入/输出流不同的是,Ra ...

  7. get post header获取数据方方法

    /** * get方式获取数据 * @param $url * @param $data * @return bool|string */public function methodGet($url, ...

  8. nodejs prefix(全局)和cache(缓存)windows下设置

    引:在安装完nodejs后,通过npm下载全局模块默认安装到{%USERDATA%}C:\Users\username\AppData\下的Roaming\npm下,这当然是不太对的默认. 1,安装L ...

  9. tomcat在Eclipse中和idea中的使用

    在eclipse中的使用 下载 http://tomcat.apache.org/ 部署项目到tomcat 常见问题 访问时如何出掉项目名 中文乱码问题 1.浏览器编码问题,修改浏览器的编码 2.js ...

  10. 原生js获取到页面上所有的checkbox

    <!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8" ...