macOS: Reading Subject-line from emails via IMAP?

I try to read the subject-lines of emails via IMAP with Xojo.

I know the way with POP3, but our admin don’t want to activate the old POP3 protocol. I have to use IMAP.

I don’t need the body of the emails, I don’t need to synchronize emails, I only need to connect, read the subject lines and delete old emails.

Can I do this with Xojo? I don’t find a IMAPSocket in Xojo.

When googling “Xojo imap” I got a few threads here.
Your options include MBS CURL, Chilkat IMAP plugin, and a few side-projects.

MBS Plugin has an email parser to properly decode the emails.

and you can use IMAP/POP3 via our CURL plugin to download emails.

As usual this depends on how robust your solution needs to be. If you connect to a specific IMAP server and your Subject has a simple format then CURL should work fine.

The Chilkat plugin can connect to all hosts and can parse all subjects.

Theoretically, IMAP is simple. Practically, it sucks.

@Christian Schmitz I have the MBS Plugins, but when I click on your link, I don’t find anything for IMAP. Do you have an example how I can use the MBS with IMAP?

Please download the plugins, check examples for CURL and find the one for IMAP in the Receive Email folder.

I using Xojo, not Filemaker. :wink:

I found the example, but in the source code of the example, there is a note, that IMAP subject line don’t work.
Or do I have to download a newer one of MBS?

normally you download whole emails and run them through parser and get subject line.

So maybe I need to update the example text.

IMAP has the ability to just request the Subject header using the FETCH ENVELOPE command (not 100% certain about the actual syntax)…