I'm a publisher of a newsletter and many of our subscribers have 'changed' their email addresses and what they have are 'replies' to our email with a friendly notice that their email address has changed.

This is causing a problem for us because it stacks up in the thousands and shows up on our mail delivery software as if they 'opened' the letter when in fact it was a 'bot' that auto-replied.

I'm looking for a PHP library or a 3rd party Open Source tool that can simply connect to an IMAP server and export the 'from' address from a given folder one address per line and the subject.

The contents of the email do not matter. We just want the 'from' address so we can first remove them from the newsletter.

Does anyone know of a tool, free or paid that can read IMAP email and export CSV summaries of email activity?

Every tool I've investigated so far will let you save '1 message' as a text file - completely useless.

What we need is a tool to export an entire IMAP folder where all the replies to our newsletter are neatly stored.

Thank you!

  • Something like mbsync to copy the folder to a local maildir. This stores emails one message per file so it's very easy to pick out the "From" line, one per file. I'd write you a full answer but it's late...
    – roaima
    Dec 9, 2020 at 23:56
  • Hey thank you - what I need is to get the email out of either imap or outlook for a specific folder. I don't understand what mbsync is when I searched for it - it looked like a command line program on github. help?
    – Viktor
    Dec 12, 2020 at 0:42

2 Answers 2


Based on my research, maybe IMAP Addresses Exporter tool could be helpful to you, It is said that allows you to connect to any mail account that supports the IMAP protocol (Gmail, Yahoo!, AOL…) and make a plain list of every sender mail address…, please kindly check if it could also work for you.

  • I tried that software - got it to connect to my address book but it did not successfully extract the addresses. I was only able to see my folders but no addresses showed up. Do you have another tool?
    – Viktor
    Dec 12, 2020 at 0:40
  • Maybe you could try the script in this thread, many users say it works for them. stackoverflow.com/questions/48217519/…
    – Jade
    Dec 15, 2020 at 4:24

After a lot of searching, I finally found a solution that is viable and open source without hidden costs:

How to Export Your Emails from Fastmail into a CSV Install Mozilla Thunderbird - connect to your IMAP Then Install This Extension> search for Add Ons "ImportExportTools NG"

Once the extension is installed into Thunderbird you don't even see that it is there. What you want to do is right-click on your folder and then choose the extension. From there you can EXPORT > CSV

It produces a nice text file that contains the FROM, TO, TIME, Subject etc.

Problem solved. It takes a few steps, maybe someone has found an even simpler solution? If so, please post. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.