Connecting to IMAP servers

Basic connectivity 

AlertMagic allows you to ingest emailed events via the IMAP protocol.

To permit this, you first need to add an "IMAP Server" connection.

The fields should be completed as follows:

  • URL: Your secure IMAP server in the form imaps://<server>:<port>
    • Example: imaps://imap.gmail.com:993
    • You can change the server and port
    • You cannot change the protocol, as only secure connections are supported
    • Make sure there is no trailing slash
  • Username:
    • Your IMAP username
    • Usually the account's email address 
  • Password:
    • Many providers, including Google, require that you create a dedicated application password
    • If you need this for Gmail, click here.

AlertMagic Integration

AlertMagic can be configured to pick up emails from the IMAP server, parse them, repackage as JSON and send the results to AlertMagic.  This is achieved using an "AlertMagic" node in the JSON configuration fields.

This is best illustrated with an example:

Incoming email:


From: trinity@zion.com

Subject: alert - Wake up Neo

Body:

Follow the white rabbit
Spoon: false
Skills: "Kung Fu", "Helicopter Pilot"

Configuration:

{
    "AlertMagic": {
        "Ingests": [
            {
"Name": "Knock Knock", "Url": "https://pdl-alertmagic-production.azurewebsites.net/api/notify",
                "Username": "xxx",
                "Password": "yyy",
"Filter": { "From": "^tri.+@zion.com$", "Subject": "^alert", "Body": "white.+rabbit" } "Payload": { "FromCaptures": [ "^(?<from>.+)$" ] "SubjectCaptures": [ "^alert - (?<subject>.+)$" ] "BodyCaptures": [ "Spoon: (?<spoon>[^\n]+)", "Skills: (?<skills>[^\n]+)" ] },
                "CleanUp": {         "Action": "MoveToFolder",          "Folder": "AlertMagic Processed",
                    "DeleteAfterDays": 30
                }
            } ] } }

In this configuration example, incoming emails are only processed if they are from someone whose name starts with "tri", working for "zion.com".  Next, the Subject line must start with the word alert and the Body must contain the words "white" and "rabbit" in that order.  The text is scanned for the fields "Spoon" and "Skills".

The result would be a new WebHook, injected into AlertMagic's Integration with Id = 123, as follows:

{
    "from": "trinity@zion.com",
    "subject": "Wake up Neo",
    "spoon": "false",
    "skills": "\"Kung Fu\", \"Helicopter Pilot\""
}

Note that only string values are supported at present.


An unhandled error has occurred. Reload 🗙