EmailDiscussions.com  

Go Back   EmailDiscussions.com > Email Service Provider-specific Forums > FastMail Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Stay in touch wirelessly

FastMail Forum All posts relating to FastMail.FM should go here: suggestions, comments, requests for help, complaints, technical issues etc.

Reply
 
Thread Tools
Old 16 Oct 2017, 03:26 AM   #1
equaeghe
Junior Member
 
Join Date: Apr 2007
Posts: 23
Checking whether list of messages with given msgids are in mailbox

Hi,


I have a set of emails-as-files on my hard drive that are mangled a bit (multiple emails per file). Most of these are in my FastMail mailbox, but some may not be. i would like to check which are and which aren't.

I know how to do this for each message manually: find msgid, search for it in FM interface. However, I have more than 500 such messages…

I can create a list of msgids for all the mails contained in these files.

Is there a way in which I can check all of these in an automated way? Using the interface? Use a third-party tool (open source)?



Erik
equaeghe is offline   Reply With Quote

Old 16 Oct 2017, 05:47 AM   #2
equaeghe
Junior Member
 
Join Date: Apr 2007
Posts: 23
Quote:
Originally Posted by equaeghe View Post
Is there a way in which I can check all of these in an automated way? Use a third-party tool (open source)?
Ok, I came up with a simple Python approach using the IMAPClient module:

Code:
for msgid in msgids:
    if c.search("HEADER Message-ID " + msgid) == []:
        print(msgid)
Here msgids is the list of, obviously, msgids and c is the client instance for the FastMail mailbox. In the end I only had to follow-up four msgids manually.
equaeghe is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 01:35 PM.

 

Copyright EmailDiscussions.com 1998-2022. All Rights Reserved. Privacy Policy