mailAuthors (element)

Description

The mailAuthors element, which must be nested within the instantiations.audit (or codepro.audit) task, is used to send e-mail to the authors of the resources that contain violations. The body of the e-mail is a report that is filtered to contain only those violations associated with the declared author.

Attributes

The following attributes are used to control the both the e-mail and report generation process:

Attribute Description Required
addressBook

The absolute or relative path to the file containing the address book that will be used to translate author names into e-mail addresses.

No
smtpHost

The name of the SMTP host used to send the mail. If the attribute is not specified, the value of the property named codepro.mail.smtpHost will be used. If the property is not defined, the value localhost will be used.

Either the attribute or the corresponding property must be defined.

smtpPort

The number of the port on which the host is listening. If the attribute is not specified, the value of the property named codepro.mail.smtpPort will be used. If the property is not defined, the value 25 will be used.

Either the attribute or the corresponding property must be defined.

username

The username used to access the mail server. If the attribute is not specified, the value of the property named codepro.mail.username will be used. It is an error if neither the attribute nor the property are specified.

Either the attribute or the corresponding property must be defined.

password

The password used to access the mail server. If the attribute is not specified, the value of the property named codepro.mail.password will be used. It is an error if neither the attribute nor the property are specified.

Either the attribute or the corresponding property must be defined.

from

The address used as the From field of the e-mail. If the attribute is not specified, the value of the property named codepro.mail.from will be used. It is an error if neither the attribute nor the property are specified.

Either the attribute or the corresponding property must be defined.

defaultAddress

The address to which an e-mail will be sent containing all of the violations that are not associated with any author and any violations associated with an author whose name does not appear in the address book. No e-mail will be sent to this address if all of the violations are associated with at least one author.

Yes
sendTo

Used in the cases where there is more than one author tag for a given type to determine which of the author(s) should receive notification. The possible values are

  • first - the first author listed
  • last - the last author listed
  • all - all of the authors
No, default is first
groupBy

The way in which the audit violations are grouped in the e-mail. If not specified, then the results will be grouped by audit rule. Currently supported groupings include:

  • audit rule
  • audit rule group
  • resource
  • severity
No, default is audit rule
filter

The filter used to restrict which violations are included in the e-mail that is generated. Only those violations whose severity level is included in the given list will be included in the e-mail. If this attribute is not specified, all severities of violations will be included in the e-mail.

No

Examples

The following mailAuthors element will generate one e-mail message for each of the authors whose code contains high-severity violations.

<mailAuthors
      addressBook="addressBook.xml"
      defaultAddress="testManager@company.com"
      from="testManager@company.com"
      groupBy="audit rule"
      filter="high"/>