Canopy
Canopy

Email auto-CC

This plugin allows a Canopy administrator to configure email addresses that are appended to outgoing emails’ CC/BCC fields, based on the type of message being sent.

Installation

Ensure that the email_autocc.py file, as provided by CheckSec, is copied into one of Canopy’s plugin directory on the Canopy server. By default that directory is /var/opt/checksec/canopy/plugins.

Restart the Canopy server process to allow the plugin to be (re)loaded:

systemctl restart canopy canopy-celery

Check the Canopy logs to ensure that the plugin has been successfully loaded. The log should include entries similar to the follow the following:

INFO [canopy.libs.plugins:84] Loading plugins into package canopy.plugins:
INFO [canopy.libs.plugins:91] > Directory: /var/opt/checksec/canopy/plugins
INFO [canopy.libs.plugins:108]  * email_autocc.py [0.0.1]: Email auto-[B]CC (email-processor)

Configuration

Email addresses are configured via the EMAIL_AUTOCC_ADDRESSES configuration option, accessible in Canopy’s Admin section. The value is required to be a valid JSON object, with the following structure:

{
    "email.phase_starting": {
        "cc": [
            "phasestarting1@example.org",
            "phasestarting2@example.org"
        ],
        "bcc": "somebot@example.org"
    },
    "email.phase_completed": {
        "cc": "phasecompleted@example.org",
        "bcc": "somebot@example.org"
    }
}

The top-level object’s keys identify the message type, as specified in the message template (Templates → Messages). Only exact matches will be recognised.

The inner objects have optional cc and bcc fields. The value of those fields are one or more email addresses, to be appended to the relevant recipient field.

The example configuration above will CC all emails created from the email.phase_starting message templates to phasestarting1@example.org and phasestarting2@example.org, and BCC somebot@example.org. It will also CC all email.phase_completed emails to phasecompleted@example.org, and BCC somebot@example.org.