0

IMAP経由でWebメール(Exchange 2003)に接続しています。

これを行うためにmailbeeのライブラリを使用しています。

メールを読んだ後、削除したいです。私の問題は、それが私のメールボックスから決して削除されないことです。

だから私の質問はこれです、あなたが「外部」ユーザーにメッセージを削除することを許可しなければならないExchangeのいくつかの設定はありますか?

    foreach (MailMessage msg in msgs)
    {
        if (msg.HasAttachments)
        {

            foreach (Attachment attach in msg.Attachments)
            {
                // Save the attachment to the file.
                if (Path.GetExtension(attach.Filename).CompareTo(".csv") == 0)
                {
                    path = localFolder + "\\" + attach.Filename;
                    Console.WriteLine("Saved file: " + path);
                    attach.Save(@path, true);

                    paths.Add(path);

                    //deletes the message
                    imp.DeleteMessages(msg.IndexOnServer.ToString(), false);
                    Console.WriteLine("file nr:" + msg.IndexOnServer);
                }
                else
                {
                    Console.WriteLine("Found a different file: " + attach.Filename);
                }
            }

        }
    }

    DbHandler.Add(paths, backupMonths * -1);                

    return true;
}
catch (Exception e)
{
    Console.Out.WriteLine(e);
    return false;
}

これは、MailBeeライブラリからの接続のログです。

[22:02:18.41] [RECV] Received: from BL2PRD0103MB072.prod.exchangelabs.com ([169.254.7 ... 004_7708CE53FE258F4B9804719502D521C4076B23BL2PRD0103MB072pr_--\r\n [Literal of length 173705.]
[22:02:18.41] [RECV]  FLAGS (\Seen \Deleted))\r\n [Total 173784 bytes received.]
[22:02:18.80] [RECV] * 7 FETCH (UID 8 RFC822.SIZE 126633 BODY[] {173862}\r\n
[22:02:18.80] [RECV] Received: from BL2PRD0103MB072.prod.exchangelabs.com ([169.254.7 ... 004_7708CE53FE258F4B9804719502D521C4076B11BL2PRD0103MB072pr_--\r\n [Literal of length 173862.]
[22:02:18.81] [RECV]  FLAGS (\Seen \Deleted))\r\n [Total 173941 bytes received.]
[22:02:18.81] [RECV] MBN00000004 OK FETCH completed.\r\n [Total 33 bytes received.]
[22:02:18.81] [INFO] Envelopes downloaded
[22:02:18.92] [INFO] Setting flags for messages.
[22:02:18.92] [SEND] MBN00000005 STORE 5 +FLAGS.SILENT (\Deleted)\r\n
[22:02:19.07] [RECV] MBN00000005 OK STORE completed.\r\n [Total 33 bytes received.]
[22:02:19.09] [INFO] Setting flags for messages.
[22:02:19.09] [SEND] MBN00000006 STORE 6 +FLAGS.SILENT (\Deleted)\r\n
[22:02:19.24] [RECV] MBN00000006 OK STORE completed.\r\n [Total 33 bytes received.]
[22:02:19.25] [INFO] Setting flags for messages.
[22:02:19.25] [SEND] MBN00000007 STORE 7 +FLAGS.SILENT (\Deleted)\r\n
[22:02:19.40] [RECV] MBN00000007 OK STORE completed.\r\n [Total 33 bytes received.]
[22:02:35.67] [SEND] MBN00000008 LOGOUT\r\n
[22:02:35.82] [RECV] * BYE Microsoft Exchange Server 2010 IMAP4 server signing off.\r\n [Total 64 bytes received.]
[22:02:35.82] [RECV] MBN00000008 OK LOGOUT completed.\r\n [Total 34 bytes received.]

これでメッセージを設定して削除する必要があると思います。誰かが何が悪いのかについて何か入力を得ましたか?

4

1 に答える 1

3

DeleteMessagesに関するMailbeeのサンプルコードのドキュメントによると、呼び出すimp.Close()前に呼び出す 必要がありますimp. Disconnect()。そうしないと、メッセージが削除されません。

于 2011-09-14T20:41:17.697 に答える