EmailDiscussions.com

EmailDiscussions.com (http://www.emaildiscussions.com/index.php)
-   FastMail Forum (http://www.emaildiscussions.com/forumdisplay.php?f=27)
-   -   Checking whether list of messages with given msgids are in mailbox (http://www.emaildiscussions.com/showthread.php?t=73113)

equaeghe 16 Oct 2017 02:26 AM

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 16 Oct 2017 04:47 AM

Quote:

Originally Posted by equaeghe (Post 604217)
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.


All times are GMT +9. The time now is 07:49 PM.


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