Flow Run by Mail Monitoring
By monitoring a specified account's mail box with a specified mail server, once a mail is received, the Flow will run.
To communicate with a mail server by SSL, you can use the certifications registered into the Management Console according to PKI.
Flow
For the Flows executed by mail monitoring, we have prepared 3 kinds of Flow. They are "Text Processing Flow", "Attachment Processing Flow" and "Error Processing Flow". Having analysed received mails, the Flow Service will run the Flow as the following steps.
You can select to create a "Text Processing Flow" or "Attachment Processing Flow" or "Error Processing Flow" according to your needs. To create them, you should start it with a Start Component, and finish it with an End Component.
Text Processing Flow
To create the Text Processing Flow, you should start it with a Start Component, and finish it with an End Component.
Create a Flow
To create it, you can click the "Text Processing Flow" icon under the "Flow" tab in the "Create Flow" dialog box. In the created Flow, the settings for supporting mail monitoring execution have completed.
- Flow property
- Initial status
- The Flow variables as below has been set.
- Variable name is From. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is To.The "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is Subject. "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is Date. "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is MIME-Filepath. "Public"'s check box is selected, but the "Modify"'s isn't .
- Variable name is Attachment-Count. "Public"'s check box is selected, but the "Modify"'s isn't .
- Component
- An HttpStart Component has been put.
- Output stream type is Text.
- An HttpStart Component has been put.
Start (Input stream)
Flow's input stream is Start Component's output stream. You can click Start Component to open a stream pane, and define for the stream there. If you want to process the mail's text by Flow, you can select Text for the Start Component's output stream type. If you want to process the mail's whole MIME by Flow, you can select MIME for the Start Component's output stream type.
Flow parameter
Flow's parameter is a framework in which the value you want to set can be got from a caller by publishing the variable of the Flow you want to run. In the Flow run by mail monitoring, by defining and publising the Flow variable with the name as same as the mail header name as below, the Flow Service will get a value automatically to set a Flow variable.
| Flow variable name to define | Got content |
|---|---|
| From | Mail header From's content. |
| To | Mail header To's content. |
| Subject | Mail header Subject's content. |
| Date | Mail header Date's content. |
| MIME-Filepath | The file path for saving the mail's MIME data as file. |
| Attachment-Count | The number of attachment files. |
For example, if "X-Mailer" is added to the public Flow variable, the name of the client who sent the mail can be got by the variable.
※ Some mail clients don't have "X-Mailer".
Finish(Output stream)
There is no output stream. The finish component's return value's property is sometimes used for setting of "Delete mails".
Caution
The Flow run by mail monitoring can't call another Flow continually. Namely, the NextFlow Component can't be used in the Flow.
Attachment Processing Flow
To create an Attachment Processing Flow, you should start it with a Start Component, and finish it with an End Component.
Create a Flow
To create it, you can click the "Attachment Processing Flow" icon under the "Flow" tab in the "Create Flow" dialog box. In the created Flow, the settings for supporting mail execution have completed.
- Flow's property
- Initial status
- Set Flow variables
- Varaibale name is From. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Varaibale name is To. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Varaibale name is Subject. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Varaibale name is Date. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Varaibale name is Attachment-Count. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Varaibale name is Attachment-Filename. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Varaibale name is Attachment-Content-Type. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Varaibale name is Attachment-Charse. The "Public"'s check box is selected, but the "Modify"'s isn't .
- Component
- An HttpStart Component has been put.
- Output stream type is Binary.
- An HttpStart Component has been put.
Start (Input Stream)
Flow's input stream is Start Component's output stream. You can click the Start Component to open a stream pane, and define for the stream there. The attachment processing flow's input stream is the attached file itself. You can specify any type for the stream, but if the attachment file's content can't be changed into the specified type, an error will happen.
Flow parameter
Flow's parameter is a framework in which the value you want to set can be got from a caller by publishing the variable of the Flow you want to run. In the Flow run by mail monitoring, by defining and publishing the decided Flow variables (mail header's contents) as below, the Flow Service will get a value automatically to set a Flow variable.
| Flow variables to define | Got contents |
|---|---|
| From | Mail header From's content. |
| To | Mail header To's content. |
| Subject | Mail header Subject's content. |
| Date | Mail header Date's content. |
| Attachment-Count | The number of attached files. |
| Attachment-Filename | Attached file's name. |
| Attachment-Content-Type | Attached file's Content-Type. |
| Attachment-Charset | Attached file's Charset. |
Caution
Attached file's name is Content-Disposition's filename's content. If the file name can't be got from Content-Disposition, it's OK to set Content-Type's name name.
Finish (Output stream)
There is no output stream.
Caution
The Flow run by mail monitoring can't call another Flow continually. Namely, the NextFlow Component can't be used in the Flow.
Error Processing Flow
To create an Error Processing Flow, you should start it with a Start Component, and finish it with an End Component.
Create a Flow
To create it is as same as to create a common error processing Flow, you can create a Flow, then describe the error processing in it. You can click the "NewFlow" icon under the "Flow" tab in the "Create Flow" dialog box.
Start (Input stream)
There is no input stream.
Flow parameter
There is no Flow parameter.
Finish (Output stream)
There is no output stream.
Execution setting
You can make a connection between Flow and interval to monitor POP3 server by execution setting. It's necessary to define the POP3 server's connection previously.
Define an execution setting
Click "Mail" in the Execution Setting dialog box or Trigger Management's tool bar. Then click "Select" in the right of the "Text Processing Flow" under "Flow settings", and select a Flow from the dialog box. You can also select "Attachment Processing Flow" or "Error Processing Flow" according to your needs. You can select a POP3 connection name which has been created in the connection pane or the Manegement Console from the "Connectin name" pull-down list under "Mail box settings".
Define POP3 server connection
In the Flow Designer, click "Create connection" in the connection pane's tool bar and open a dialog box. Next, select "POP3" from the "Connection type"'s pull-down list, and enter a name into the "Name" field. Then enter a host name and a user name and so on into the inspector and save them. Saved connection will be shown in the "Connection name"'s pull-down list in the execution settings.