Mail Routing Macros
(NOTE: Some of the techniques shown or described on this page--marked in purple--require new features in the latest official PIKT 1.19.0 release (pikt-current.tar.gz) that are unavailable in any previous version.)
The macros in the sample pikt_mail_macros.cfg configuration file below are used for routing PIKT alert mail to the appropriate system administrators. Note how, by means of #ifdef directives, we can switch the mail routing instantly when testing. Note, too, how by means of #if directives, we can include or exclude mail sendees for certain systems. Of course, your mail macro setup can be much simpler than this.
/////////////////////////////////////////////////////////////////////////////// // // pikt mail macros - pikt mail routing // /////////////////////////////////////////////////////////////////////////////// // piktadmin #ifndef silence byrd byrd\ #elsedef byrd null\ #endifdef piktadmin =byrd // pikt head honcho /////////////////////////////////////////////////////////////////////////////// // everyone else #ifdef silence dowland =piktnullchar boyce =piktnullchar telemann =piktnullchar tartini =piktnullchar josquin =piktnullchar #elsifdef pikttest dowland =piktnullchar boyce =piktnullchar telemann =piktnullchar tartini =piktnullchar josquin =piktnullchar #elsifdef private dowland =piktnullchar boyce =piktnullchar telemann =piktnullchar tartini =piktnullchar josquin =piktnullchar #elsedef # if new | sidelined | sick | down dowland =piktnullchar boyce =piktnullchar telemann =piktnullchar tartini =piktnullchar josquin =piktnullchar # else dowland dowland\ telemann telemann\ tartini tartini\ josquin desprez.gmail\ boyce # if missioncritical | piktmaster boyce\ # else =piktnullchar # endif # endif // new | sidelined | sick | down #endifdef /////////////////////////////////////////////////////////////////////////////// // mail groups sysadmins =dowland =boyce =piktadmin =piktnullchar coders =telemann =tartini =josquin =piktnullchar /////////////////////////////////////////////////////////////////////////////// // the various pikt- macros, the addresses used in the alerts.cfg mailcmd pikt-emergency =sysadmins =coders pikt-urgent =sysadmins =coders sysadmins-urgent =sysadmins coders-urgent =coders =piktadmin pikt-critical =sysadmins =coders sysadmins-critical =sysadmins coders-critical =coders =piktadmin pikt-warning =piktadmin sysadmins-warning =sysadmins coders-warning =coders =piktadmin pikt-notice =piktadmin sysadmins-notice =dowland =byrd // =sysadmins coders-notice =coders =piktadmin pikt-info =piktadmin pikt-admin =piktadmin pikt-debug =piktadmin pikt-test =piktadmin pikt-security =piktadmin ///////////////////////////////////////////////////////////////////////////////
For more examples, see Samples.