Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.1
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
Statistic
FMM
Blog
Parses result of an IMAP list query.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CURL | 9.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
curl | The CURL session handle. | $curl |
Returns JSON or error.
Query email list as JSON:
Go to Layout [ “IMAP Postbox” (IMAP Postbox) ; Animation: None ]
# get URL
Set Variable [ $URL ; Value: "imap://imap.monkeybreadsoftware.com/INBOX" ]
# query list of emails
Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionURL"; $curl; $URL) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionUserName"; $curl; IMAP Postbox::Username) ]
Set Variable [ $r ; Value: MBS("CURL.SetOptionPassword"; $curl; IMAP Postbox::Password) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUseSSL"; $curl; 3) // required ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionSSLVersion"; $curl; 6) // TLS v1.2 ]
# Set query for all emails by UID. Not all fields are needed. Only request those you need to make it quicker.
Set Variable [ $r ; Value: MBS("CURL.SetOptionCustomRequest"; $curl; "UID FETCH 1:* (FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (Message-Id DATE FROM SUBJECT TO SENDER REPLY-TO CC BCC)])") ]
# Run transfer
Set Variable [ $result ; Value: MBS("CURL.Perform"; $curl) ]
# We show results for debugging
Set Variable [ $output ; Value: MBS("CURL.GetResultAsText"; $curl) ]
Set Variable [ $debug ; Value: MBS("CURL.GetDebugMessages"; $curl) ]
Set Variable [ $list ; Value: MBS( "JSON.Colorize";MBS("CURL.GetResultAsEMailList"; $curl)) ]
Set Variable [ $r ; Value: MBS("CURL.Release"; $curl) ]
Set Field [ IMAP Postbox::Log ; $debug ]
Set Field [ IMAP Postbox::JSON ; $list ]
This function checks for a license.
Created 21st December 2018, last changed 4th March 2023