Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6598145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:18:08+00:00 2026-05-25T18:18:08+00:00

Im connecting to a webmail (Exchange 2003) via IMAP. Im using a library from

  • 0

Im connecting to a webmail (Exchange 2003) via IMAP.

Im using a library from mailbee to do this.

After i’v read a mail I whant it to be deleted. My problem is that it’s never removed from my mailbox.

So my question is this, is there some setting in Exchange where you have to allow “external” users to delete messages?

    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;
}

This is what is log for the connection from the MailBee library

[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.]

I think this should set and delete the messages. Anyone got any inputs on whats wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:18:09+00:00Added an answer on May 25, 2026 at 6:18 pm

    According to the documentation with sample code of Mailbee regarding DeleteMessages you need a call to imp.Close() before calling imp. Disconnect() – otherwise the messages won’t get purged.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried connecting to my cassandra cluster [version 1.0.6] via nodejs using node-cassandra-client This
connecting to a mysql database from java using jdbc. declaring a query String query
When connecting to oracle server from .NET application using ADO.NET for oracle, even if
An older application using System.Web.Mail is throwing an exception on emails coming from hr@domain.com
When connecting to an SQLite database from Python (using Python 2.6), what strategies are
When connecting from a local AIR/Flex application to a local application (c++) using sockets
After connecting to my Rails app via Facebook I have #_=_ added on to
If I'm connecting to a mail server over SSL or TLS but using PLAIN
When connecting to sql server, I have the hardcoded string (local). Is this a
I have someone connecting to my repository using the url (substituted the IP address):

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.