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 616751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:21:38+00:00 2026-05-13T18:21:38+00:00

I would like to create an email client that can access multiple IMAP mailboxes.

  • 0

I would like to create an email client that can access multiple IMAP mailboxes. I’d also like a copy of all emails for processing. What is the best way to do this using IMAP commands?

Right now I have a script that iterates over the folders, FETCHing FLAGS on 1:* to see what’s been read and if any previously read messages have been marked as new, then FETCH BODY.PEEK on all of the messages I don’t have in my database. Is there a better way?

  • 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-13T18:21:38+00:00Added an answer on May 13, 2026 at 6:21 pm

    A better way would be to fetch UIDs of all messages (UID FETCH 1:* FLAGS), compare the resulting UID list with your database and then download any messages you don’t have and remove any messages you have but the server doesn’t (deleted by other IMAP clients or using a web interface, for example). This is the only reliable method to duplicate an IMAP folder, AFAIK.
    (And don’t forget to take UIDVALIDITY into account as well!)

    Your original method would not work correctly if other IMAP clients were accessing the mailbox in addition to your application. In theory, it would work OK if you can stay connected to the IMAP server continuously, using NOOP and IDLE to check new and deleted messages, but this is never possible in practice – even GMail doesn’t have 100% uptime 🙂

    An ultimate IMAP client would combine both these approaches.

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

Sidebar

Ask A Question

Stats

  • Questions 507k
  • Answers 507k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Data::Diver exists for exactly this purpose. my $last_hash = Data::Diver::Dive(… May 16, 2026 at 4:01 pm
  • Editorial Team
    Editorial Team added an answer AutoStart is a feature of the web server and not… May 16, 2026 at 4:01 pm
  • Editorial Team
    Editorial Team added an answer If I'm not mistaken, you could add a constructor to… May 16, 2026 at 4:01 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I would like to have a workflow create a task, then email the assigned
I would just like to clarify that by 'design', I mean software design, not
I am now maintaining a legacy VBA/Access 2000 application for a client. They have
I perform a lot of tests that create e-mail messages. I store each message
I'm trying to generate email from my code that will read correctly for people
Ambiguous question, I know. But anyway, I'm developing a client's site that will enable
Right now I have an asp:Wizard with 3 Steps. Create User Form to Email
Using SQL Server 2008, I have a requirement that email addresses in my user
I created an application as part of an ASP.NET site. I would like to
I've been tasked with creating some sort of service that will take any e-mail

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.