In addition, because electronic mail is so pervasive in the UNIX community, ClearDDTS can be connected between any two systems on the Internet or any two systems where a telephone exists. Thus connectivity can be sophisticated or simple and ClearDDTS will use whatever system is in place.
The daemon forwards any items it cannot understand to the person who has been designated the ClearDDTS administrator. For example, mail about the company picnic sent to ClearDDTS would be forwarded to the ClearDDTS administrator. Usually such mail is from human users; these typically are questions about ClearDDTS, but occasionally they are "bounced" notification messages resulting from incorrect user mail addresses.
After reading and processing each mail message, ClearDDTS records the transaction, and deletes the message.
Note: The ClearDDTS administrator should not modify or delete ClearDDTS mail. ClearDDTS manages its own mail box with no help from human users.
ClearDDTS uses the ~ddts/conf/aliases file to determine the mail addresses and aliases for the local host. Since formatted bug mail is only generated locally, the ClearDDTS administrator never has to worry about remote aliases.
Note: Global aliases are recognized as long as the mailer program specified in adminbug inst uses them. However, ClearDDTS does not explicitly use those aliases.If a state transition occurs on SFOqa and a user on LDNcc must be notified, then ClearDDTS on SFOqa will send a raw bug transaction to LDNcc, and ClearDDTS on LDNcc will then send local formatted mail to the user on LDNcc.
Similarly, if an engineer on machine SFOqa submits a defect against a project ZZ that resides on the remote machine LDNcc, the raw bug (ASCII) data that comprises the transaction is sent from SFOqa to LDNcc where it is incorporated in LDNcc's database.
An acknowledgment is then sent back from LDNcc to SFOqa and SFOqa's database is updated to reflect the fact that the bug was received. This round trip handshake guarantees that no defect will ever be lost in the mail system.
Note: By default, notification mail is not sent to the person performing the update transaction (the value of $Updated-by). To force e-mail to be sent to the updater, add the following line to the
~ddts/etc/ddtsrc
file:
Allow-updater-mail: Y
######################################################## Submitter-id: if equals $STATE$OPERATION Sp or null whoami fi if equals $OPERATION v "!%-.8s" fi Submitter-mail: if match $STATE$OPERATION Sp Sm Nm if equals $Notify-submitter Y get_email_address "$Submitter-id" else echo " " fi fi . . . Engineer: if match $OPERATION v m or match $STATE$OPERATION Ap Af "\n\(6,41)LABORATORY INFORMATION" "\(7,42)Assigned engineer: %-8.8s" fi if match $OPERATION p m required help user.H goodusers fi Engineer-mail: if match $OPERATION p m get_email_address "$Engineer" fi ########################################################
N-notify: chris dave O-notify: chris A-notify: chris R-notify: chris dave D-notify: chris F-notify: chris P-notify: chris V-notify: chrisIn this example, the user chris is notified of every new state transition. The user dave is only notified of bugs entering or modified in the New and Resolved states. The ClearDDTS administrator and the project manager can modify this list with the adminbug mprj command.
~ddts/www/user_prefs/<userid>.notify.tmpl ~ddts/class/$class/notify.tmpl ~ddts/class/$class/mail.subject (format prior to release 4.5)
Note: Using a notification template is optional. If you do not use a notification template, ClearDDTS uses the default mail.subject file only. The mail.subject file allows you to customize the subject string of e-mail, but not the content. There are extensive comments in the mail.subject file that describe how to do this.
Notify-domain: @<your_domain>.comWith this field set, ClearDDTS can find the preferences file for the user chris (chris.notify.tmpl) even if the e-mail address found is chris@bigcorp.com. If the domain found does not match the domain in the ddtsrc file, ClearDDTS uses the entire e-mail address when looking for the notification template.
Bugmail-verbose-log: YThe additional output can include information on the notification template used, user e-mail address, message-template used, and other options.
In addition, all the old fields are also available to the notification template and have been renamed to have "--" added to the beginning of the name. For example, the old headline can be accessed using the name "$--Headline" while the new headline is accessed with "$Headline".
Message-template
The Message-template field defines the template file used to determine which defect fields to include in the notification e-mail. By default, this field contains the path to the master.tmpl. You can create your own message template (or multiple templates) to include only the fields you are interested in. If the Message-template field points to a non-existent file, no e-mail is sent. For example:
Message-template: if equals $TRANSITION-TYPE modify echo $~/class/$Class/modify.tmpl elif equals $TRANSITION-TYPE assign echo $~/class/$Class/engr.tmpl elif not equals "$Project" "$--Project" and not equals $TRANSITION-TYPE new echo $~/etc/forward.tmpl elif equals $TRANSITION O echo "" elif equals "$Showstopper" Y echo $~/class/$Class/showst.tmpl else echo $~/class/$Class/master.tmpl fiIn this example, the
$TRANSITION-TYPE
and $TRANSITION
variables are used to determine which message template to use for formatting the mail. It is defined as follows:
In the default master.tmpl (which is also the default message template), OPERATION n is used by ClearDDTS to process notification mail. In the default master.tmpl file, the Begin derivation tests for OPERATION n and sets Putmail as follows:
Begin: unset Begin . . . if equals $OPERATION n # mail notification? set OPERATION v # yes, pretend viewing, set Do-enclosures Y # but also show enclosures, set Putmail Y # and process mail. elif equals $OPERATION l # dumpbug w/enclosures? set OPERATION v # yes, pretend viewing, set Do-enclosures Y # but also show enclosures, set Putmail N # ...with no mail processing else set Do-enclosures N # don't show enclosures fiWhen OPERATION is n, ClearDDTS changes OPERATION to v with the addition of showing enclosures (Do-enclosures) and processing mail (Putmail).
Because Putmail is set in the Begin derivation you must add the change_history filter to the Putmail field derivation in the default master.tmpl (it is the last derivation in the default master.tmpl):
Putmail: unset Putmail if equals "Y" change_history "Changes to this defect include:" fiTo set up a change log when using a different message template, you must include a field derivation containing change_history in that template. For example:
Changes: unset Change_history "\n" change_history "Changes to this defect include:" "\n"If you choose to include the change log you can also choose where in the e-mail message it should appear. To do this, move the entire derivation containing the change_history filter to a new location in the message template. For example, in the master.tmpl file you can put it between the Begin and Identifier field derivations to make the change log appear at the beginning of the notification e-mail.
The change_history filter can accept up to two optional arguments:
Defect access with webddts
Notification mail can contain a URL to access the referenced defect using the webddts interface. If you have web integration with your e-mail tool, this provides a way to quickly launch webddts and view the defect. A sample derivation containing a URL might be:
Putmail: unset Putmail change_history "Changes to this defect include:" "\nThe URL for the defect is:\n" "http://web.server/ddts/ddts_main?id=$Identifier\n\n"
Subject: echo "$Project defect $Identifier" if equals $TRANSITION S echo "$$ was submitted" elif equals $OLDSTATUS$TRANSITION SN echo "$$ arrived" break elif equals $OLDSTATUS $TRANSITION echo "$$ was updated" else echo "$$ was moved to state $TRANSITION" fi
Timestamp:
Bugmail-ignore-fields-file: echo ~ddts/www/user_prefs/<userid>_ignore_fields
Suppress-mail: echo YWhen the Suppress-mail field is set to Y, changed fields are compared to those listed in the bugmail_ignore_fields file. Notification mail is not sent if the only changes to a defect are to suppressed fields.
Note: You can also suppress enclosure changes by adding certain enclosure fields to the bugmail_ignore_fields file as in the following examples:
Related-file::::Problem History::::
If the bugmail_diff script finds differences to report, the changed text is printed in the changes section of the notification mail under the heading "Enclosure Changed: <title> ".
Old-Machids: BUGno XXXxxThe notification mail process compares the site identifier of a defect to the current site and to values set in this field. If it finds a match, it acts like it owns the defect and is able to send notification mail.
You can also send mail to ClearDDTS that is appended to a defect as an enclosure. If you send mail (or reply to notification mail) that contains a defect ID for the current site in the subject of the message, that message is appended to the defect in an enclosure. If a defect ID is not found in the subject, a "Confusing mail" message is sent to the ClearDDTS administrator.
ClearDDTS also searches the subject for "enclosure=", and uses the word following as the enclosure title. If ClearDDTS cannot determine the name of the enclosure, it defaults to "mail_log".
When the message is appended to the defect, you will see text similar to the following in the enclosure:
batchbug 981116 164457 Appended via email by "chris@bigcorp.com" <body of e-mail message> batchbug 981116 164457 End of messageClearDDTS checks the sender and prevents "root", "mailer-daemon", "daemon", "postmaster", and names starting with "ddts" from being appended. For more information on appended mail to defects and how to customize this feature see the man page for ddtsappend(1).