Email automation: processing inbound email
Corteza supports email automation and processing of incoming email messages. This can be achieved through local email service like [postfix] or 3rd party provider that forward received emails through webhooks.
- 
Email is received by internal or external system
 - 
Email is forwarded to sink API endpoint
 - 
Corteza sink service extracts header and body data from received email
 - 
onReceive triggers are filtered for a match (trigger can be configured to match specific headers like sender or subject)
 - 
Automation script is called
 
Preparing (signing) sink URL
Signing the URL (the sign=… parameter and value) is created as a combination of all parameters and Corteza’s secret string. This signature should be kept secret as it is effectively same as password that allows access to Corteza.
docker-compose exec server system sink signature --method POST --origin postfix --content-type email
/sink?content-type=email&expires=&method=POST&origin=postfix&sign=6280d530ae74f1f9c55e4dd362c9ef2094221287
| Parameter | Description | 
|---|---|
method  | 
must match the request method  | 
origin  | 
arbitrary string, can be used to describe  | 
content-type  | 
used to set the processor for the data inputed  | 
expires  | 
can be used to sign link with expiration date.  | 
echo "
From: 
To: 
Subject: hello
Message-ID: <1234@local.machine.example>
Ola Corteza!
" | curl -i --data-binary @- "https://api.your-corteza-instance.tld/system/sink?content-type=email&expires=&method=POST&origin=postfix&sign=6280d530ae74f1f9c55e4dd362c9ef2094221287'"  
This command must return 200 OK response.