Code Monkey home page Code Monkey logo

ctx-email's Introduction

CTX-Email

This repository contains flows and subtasks poll an IMAP Email Server for emails and to process each received email asynchronously in a separate flow

CTX-Email-Get-Emails

This is the main flow to retrieve emails from an email IMAP server

Inputs

  • i_config-area: The name of an area in the CTX-Configuration-Store containing the following configuration parameters:
    • Server: The FQDN of the IMAP server
    • Port: The port on the server to which Cortex must connect (Optional - defaults to 993)
    • Timeout: The timeout in seconds before an attempt to connect to the server fails; a value of 0 means do not timeout (Optional - defaults to 0)
    • Secure-Connection Specifies whether Transport Layer Security (TLS) is enabled for the IMAP connection (Optional - defaults to true)
    • Username: The email account username
    • Password: The email account password
    • In-Folder: The name of the folder containing emails to be processed by Cortex (Optional - defaults to Inbox)
    • Retrieved-Folder: The name of the folder into which emails downloaded by Cortex are moved before they are processed (Optional - defaults to Retrieved)
    • Processed-Folder: The name of the folder into which emails downloaded by Cortex are moved after they are processed (Optional - defaults to Processed)
    • Attachment-Folder: The name of a folder (directory) on the Cortex server to which email attachments are saved; all attachments in a single email are saved to the same, unique folder

Processing

For each unread email in the In-Folder folder of the mainbox, Cortex will:

  • Download the email
  • Move the email to the Processed folder
  • Asynchronously execute an instance of the CTX-Email-Process-Email flow

CTX-Email-Process-Email

This flow is exected to process a single email message. The flow will:

  • downloads any attachments to the Attachment-Folder/flow-UUID on the Cortex Server; this folder (directory) will be created if it does not exist
  • determines how to handle the email
  • if the email is successfully processed, moves the email to the Processed-Folder on the IMAP server (otherwise it is left in the Retrived-Folder)

Processing emails

To process emails, modify the process-Email state of the flow. Inspect the email information contained in the g_Message structure to determine how to process the email. Set the g_Processed boolean parameter to true if the email has been processed successfully.

It may be easier to perform the processing in another synchronously executed flow; this flow should accept the g_Message structure parameter as an input parameter, and return the g_processed boolean parameter as a return parameter.

Installation Instructions

Download the Studio Package file and Import it into your Cortex Environment. Don't forget to apply rights using the Studio Authorization module.

Dependencies

This library depends upon the following libraries:

๐Ÿ‘ Enjoy! ๐Ÿ˜‰

ctx-email's People

Contributors

srconnor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.