Return to Navigation

Defining Mail Filters

To define mail filters, use the System Parameters/Defaults (RB_ERMS_SETUP) component.

Page Name

Definition Name

Usage

Spam List Page

RB_SPAM_LIST_DEFN

Set up address-based and domain-based filters.

Mail Filters Page

RB_ERMS_SETUP

Activate the filters that you set up on the Spam List page, and apply your own custom email filters.

Use the Spam List page (RB_SPAM_LIST_DEFN) to set up address-based and domain-based filters.

Image: Spam List page

This example illustrates the fields and controls on the Spam List page. You can find definitions for the fields and controls later on this page.

Spam List page

Field or Control

Definition

Email Address/Domain Name

Enter a full email address or a domain name from which you want to block all email.

Type

Select Email or Domain to indicate the type of address being blocked.

Note: To activate the filters that you set up on this page, access the Mail Filters page and ensure that the delivered SYS_SPAM_LIST filter is active.

To implement mail filtering other than by email address or domain, create an application class method that identifies the emails to be discarded.

PeopleSoft provides a base class called MailFilter that you extend when creating your own filters. The delivered base class is in the RB_MCF_SETUP package. PeopleSoft also delivers the SYS_SPAM_LIST class, which you can clone as a starting point.

Properties of the Base Class

This table explains the base class properties:

Property

Description

EmailRow

Identifies a row of data that is retrieved by the PeopleTools MCFGetMail application programming interface (API) using the Message Structure MCFEM_RES_READALL. This message is made up of the MCFEM_RES_MAIN record and its child record MCFEM_RES_PART.

DomainName

The domain from the sender's email address.

The MailFilter constructor populates this property for the specified email.

FromEmailAddress

The sender's full email address.

The MailFilter constructor populates this property for the specified email.

MailFilter(&Row1 As Row) Method

The MailFilter(&Row1 As Row) method uses the &Row1 parameter to populate the DomainName, FromEmailAddress, and EmailRow properties of the class. It accepts this parameter:

Input Parameter

Description

&Row1

A row type object for which the main record is MCFEM_RES_MAIN.

No return parameters are available.

IsFromEmailAddressValid() Method

IsFromEmailAddressValid() sets a Boolean value that indicates whether the email is valid. When you create your own mail filters, your custom logic goes here. The returned value is trapped by the mail reader process and is used in this way:

Return Value

Description

False

The email is considered to be an exception email and is discarded before any further processing takes place.

True

The email is valid.

Sample Code

This sample code filters out email from support@abc.com:

import RB_MCF_SETUP:*;

class CstmFilter1 extends MailFilter;
   method CstmFilter1(&Row1 As Row);
   method IsFromEmailAddressValid() Returns boolean;
end-class;


method CstmFilter1
   /+ &Row1 as Row +/
   %Super = create MailFilter(&Row1);
   
end-method;

method IsFromEmailAddressValid
   /+ Returns Bool +/
   If (%This.FromEmailAddress = "support@abc.com") Then
      Return False;
   Else
      Return True;
   End-If;
   
end-method;

See the product documentation for PeopleTools: PeopleCode Developer's Guide and PeopleTools: PeopleCode Language Reference.

Use the Mail Filters page (RB_ERMS_SETUP) to activate the filters that you set up on the Spam List page, and apply your own custom email filters.

Image: Mail Filters page

This example illustrates the fields and controls on the Mail Filters page. You can find definitions for the fields and controls later on this page.

Mail Filters page

Field or Control

Definition

Mail Filter ID and Description

Enter a name and description for your custom mail filter.

PeopleSoft delivers a mail filter with the ID SYS_SPAM_LIST. This filter blocks email from the addresses and domains that you enter on the Spam List page. You cannot edit or delete the data for this filter.

Status

Select to activate the mail filter. The email addresses and domain filters that you set up on the Spam List page are active only if you activate the SYS_SPAM_LIST filter here.

Application Class ID, Package Tree Viewer, and Application Class Path

Enter the ID and path for an application class that performs custom mail filtering. Click the Package Tree Viewer link to access the Application Packages Lookup page, where you can browse for application classes and select one to use.

Retain Email Body As Exception

Select to have the ERMS mail reader process to save the text of any email that has been blocked by this filter. The blocked email is not routed for handling, but an administrator can review the blocked emails on the Exception Email Details page.

If this option is cleared, you can still review summary information about the email on the Mail Reader Process Log page, but you will not be able to view the email's body text.