Task Messaging - Email - Get Headers
The Email - Get headers Task lists the messages in a mail folder that match its conditions and attachment filter, using a POP3, IMAP4, Exchange EWS, Exchange WebDAV or Microsoft Graph API Connection. For each message it writes one line with the fields chosen on the Output tab, such as From, Subject and Received date.
The Main settings, Flow, On error, Conditions and TimeOut tabs are the same for every Task; see Job - Tasks.
Email - Get headers: Main settings tab

- Connection: the Connection to the mailbox, of one of these types: Connection - POP3, Connection - IMAP4, Connection - Exchange EWS, Connection - Exchange WebDAV or Connection - Microsoft Graph API
- Mail folder: the folder to read
- Use default folder (default): the default folder of the mailbox, the Inbox
- Use specified folder: type the folder path, or click the folder button to choose it from the server. Choosing is not possible with POP3, and with POP3 the setting is ignored. If the folder does not exist, the Task fails with the error
Folder "<name>" not found - Is public folder: select it when the specified folder is an Exchange public folder. It is applied with Exchange EWS and Microsoft Graph API Connections only
- Decryption by...: Certificate is the certificate that decrypts encrypted messages; see Global - Certificates. An encrypted message is skipped, with nothing in the output, when no certificate is selected or the certificate cannot decrypt it
Email - Get headers: Conditions tab

A message is listed only when it matches every condition that is set.
- From address, Subject and Body: each has a list and a value field. The list holds "Don't check" (default), "Equal (=)", "Not equal (!=)", "Contains (=%)" and "Not contains (!=%)"
- Received date: a list and a date value. The list holds "Don't check" (default), "Equal (=)", "Not equal (!=)", "Larger than (>)", "Larger than or equal (>=)", "Smaller than (<)" and "Smaller than or equal (<=)". "Larger than" means received after the date; "Smaller than" means received before it. The default value is
{DATENOWADD(Minutes,10,T)}. With POP3, Exchange EWS and Microsoft Graph API Connections, "Equal (=)" matches only a message received at exactly that date and time, so it rarely matches. With IMAP4 and Exchange WebDAV Connections, "Smaller than (<)" also leaves out the messages received earlier on the same day as the date - Read option: All emails (default), Only unread emails or Only read emails. It is not applied with POP3, which has no read state
With POP3, Exchange EWS and Microsoft Graph API Connections, VisualCron checks the conditions itself. "Contains (=%)" matches any part of the text, and case is ignored. Body is compared with the text body and the HTML body of the message joined together. With a Microsoft Graph API Connection, "Equal (=)" on Subject and Body is case-sensitive, and on Body it matches only a message whose HTML body is empty.
With IMAP4 and Exchange WebDAV Connections, the mail server runs the search, and how it compares text depends on the server. VisualCron checks "Equal (=)" on Subject and Body again, exactly and with case; for Body it compares the text body only. These limits apply:
- "Not equal (!=)" on Subject works as "Not contains (!=%)": a message is left out when its subject contains the value
- "Not equal (!=)" on Body leaves out every message that contains the value in its header or body
With IMAP4 and Exchange WebDAV Connections, every From address condition acts as "Contains (=%)". "Not equal (!=)" and "Not contains (!=%)" list the messages from that address instead of leaving them out, and "Equal (=)" also lists longer addresses that contain the value. With POP3, Exchange EWS and Microsoft Graph API Connections, From address is applied as set.
Email - Get headers: Attachment filter tab

When File mask is not *, or a size check is selected, only messages with at least one matching attachment are listed; messages without attachments are left out.
- File mask: the attachment file names to match, for example
*.pdf. Separate several masks with;. The default*matches every name. The browse button picks a file name from disk - Is regex: File mask is a regular expression
- Case sensitive: has no effect at present. The setting is not saved, and file names are always matched without regard to case
- Check if file is smaller than x size and Check if file is larger than x size: each has a size value and a unit, "kilobyte(s)" by default. The list between them combines the two checks with "AND" (default) or "OR"
Email - Get headers: Test tab
Show filtered message headers runs the current settings on the Server and shows the result. Number of lines in the result limits how many lines are shown.
Output tab
- Output to standard output (default) or Output to file: where the lines are written
- Show mail headers: the fields to write for each message. The default is From, Priority, Subject and Received date. ID and Index are the values that Task Messaging - Email - Get Single Message and Task Messaging - Email - Delete Single Message use. Body is not offered on this Task
- Include field names: the first line holds the field names
- Field separator, Text qualifier and Line break: how fields and lines are separated
- File path, Append to file (selected by default), Include BOM (if UTF8) (selected by default) and a Credential: used with Output to file. The file uses Encoding from the Task window's Main settings tab
Output and errors
- When no message matches, the output is empty, and the Task succeeds
- If a message cannot be downloaded from the server, the Task stops with an error
- If the Connection is missing, the Task fails with "Connection not found". If the specified folder does not exist, it fails with the error
Folder "<name>" not found(the "No folder(s) found" cause on the On error tab)
If a message is downloaded but cannot be processed, the error is written to the Server log, the message is left out of the output, the Task goes on with the next message, and the Task reports success.
An encrypted message that is skipped because no certificate is selected, or because the certificate cannot decrypt it, is left out of the output, and the Task reports success.