{{ transformations:FetchEmailAction.png}} ====== FETCH EMAIL ====== Category: Workflow / External\\ \\ =====Description===== This action retrieves emails from a mail server (IMAP or MS Exchange) and creates a table in which each line corresponds to one email message, and the columns contain various message attributes, such as sender,\\ sent date, subject, message body, etc. \\ =====Use cases===== Workflows using //Fetch email// can be constructed to retrieve preconfigured emails with attachments, process the attached file(s), and return the processed file(s) to the sender using the [[transformations:sendemail|Send email]] action. \\ =====Action settings===== ^ Setting ^ Description ^ |Connector*|Select or create a connector to the email server and account to retrieve email from.| |Fetch from|Select whether emails will be retrieved from the account's Inbox or another, specified folder. Options: //Inbox// or //Other folder//* (and enter the folder name)| |Pre-filter|If specific emails are to be retrieved, select the pre-filter options to use. See the "Pre-filter options" table below for details.| |Attachments|Select whether attached files will be retrieved as well. See the "Attachments options" table below for details.| |Options|Select what occurs after an email is fetched. Options: //Do nothing//, //Mark as read//, or //Delete message// (cannot be undone).| * Setting can be specified using a [[:parameters|parameter]].\\ \\ ====Pre-filter options==== ^Option ^Description ^ |Pre-filter by sender|Check this to fetch email from specific senders, and enter the text to be found within the sender's name\\ or email address in the //Sender contains//* field.| |Pre-filter by subject|Check this to fetch email with specific text in the subject line, and enter the text to be found in the\\ //Subject contains//* field.| |Fetch only unread messages|Check this to fetch only messages that have not yet been read.| |Messages to fetch|Select whether to retrieve the //Last N messages//* (and enter the number of messages), or messages\\ received in the //Last N hours//* (and enter the number of hours).| * Setting can be specified using a [[:parameters|parameter]].\\ \\ ====Attachments options==== ^Option ^Description ^ |Fetch attachments|Check this to retrieve files attached to emails.| |Folder path*|Enter or browse to the folder to save the attached files to.| |Save|Select whether attachments to each message will be stored in a temporary subfolder under the folder\\ selected above, or all attachments will be saved together in the folder selected above.\\ Options: //For each message create a new temporary subfolder with attachments// or //Save all\\ attachments from all messages into one folder//.| |Enable images in attachments|Check this to allow image attachments to be retrieved.| * Setting can be specified using a [[:parameters|parameter]].\\ \\ =====Remarks===== Message bodies are limited to the first 1000 characters only. \\ \\ ====Attachments==== Optionally, the action can also retrieve attachments of the email messages. In this case, a new column named "Path to attachments" will be added with paths to saved attachments from each message. Also, each line in the result table will correspond to each saved attachment. Therefore there can be several lines for one message if the message contained several attachments. All attachments can be saved into one folder. In an alternative mode, for each message, a temporary folder is created and all attachments of the message are saved into this temporary folder. After processing attachments, the folder that contains them can be cleaned by using the "Clean folder" command of the [[transformations:filecommand|"File command"]] action. \\ \\ ====Compatibility==== Any email server that supports standard IMAP (without extensions) is supported. Supported MS Exchange versions are 2010 and up. \\ =====See also===== * [[transformations:sendemail|Send email]]