In addition your IT installation is target of permanent changes from shifting your staff to an other project up to setup and maintain a new processes. Every changing require a update of your business-processes to link the sender of business-information with the right receiver.
To keep your IT in sync with your business the BID server was designed to reduce your the work-load and to organize your network relations. As a goal every sender of business-information use the BID server as the receiver and the BID server is using a business-rule as a plugin to decide how to handle this business-information. For every business-information a different plugin is used. The link between an incoming business-information and a plugin is done using the subject line of the incoming business-information-eMail:
path/to/myplugin, the @ is required) is the path to the plugin relative to the plugins directory of your BID server installation
A plugin can be as easy as rewriting a header up to do complex calculations.
To rewrite a header a one line command is used (from:
SetHeader From "MyFromEMailAddress" To "MyToEmailAddress" Subject $SUB
If you step into this tool you probably want to do more than just rewriting headers. Some processing of the information available in the body of the eMail would help you to classify your eMail better. The mime getbody command gives you everything need to work with the body:
set MY_BODY [mime::getbody $TOK]
If your are lazy and if you don't want to parse the body by your own the BID server can do it for you with a little help in formatting of the incoming eMail (this is an example of a shell script try to send a business relevant information to your BID server using a pre-formatted body) :
mailx -s "path/to/myplugin@my alarm eMail" bid@server <<EOF ><TokenNr1:this is a single line data >TokenNr2 1. multi-line data 2. multi-line data <TokenNr2 EOF
array set MyVariable [ParseBody]
If data is required you can add the token to the command-line of the ParseBody command and the BID server will generate an error if the token is not available:
array set MyVariable [ParseBody TokenNr1 TokenNr2]
If you are able to parse the incoming eMail body you are able to convert your eMail into a more readable format and to provide a common style for your corporate identity. The BID server provide you with the ability to convert your eMails into HTML eMails. A plugin for this case would look like this:
package require email array set VAR [ParseBody TokenNr1 TokenNr2] email::Classify $HOST set email::HEADER "HTML test email" set email::SUBJECT "used to test the local setup" set email::ROWS [array get VAR] ::email::MakeBodyToHTML info.htm SetHeader To [GetFrom] Subject $SUB
package require email
db::Write token value
db::Read token ?default?