Use Case: OWA-based spam filtering
Spam filtering is the ability to dynamically block emails that are not from a known or trusted source or that have inappropriate content. Spam filtering requires an associated business logic that indicates that a particular kind of message is spam. When the Citrix ADC appliance processes Outlook Web Access (OWA) messages based on the HTTP protocol, HTTP callouts can be used to filter spam.
You can use HTTP callouts to extract any portion of the incoming message and check with an external callout server that has been configured with rules that are meant for determining whether a message is legitimate or spam. In case of spam email, for security reasons, the Citrix ADC appliance does not notify the sender that the email is marked as spam.
The following example conducts a very basic check for various listed keywords in the email subject. These checks can be more complex in a production environment.
To implement this configuration, you must perform the following tasks:
- Enable the responder feature on the Citrix ADC appliance.
- Create an HTTP callout on the Citrix ADC appliance and configure it with details about the external server and other required parameters.
- Create a responder policy to analyze the response, and then bind the policy globally.
- Create a callout agent on the remote server.
Enabling responder
The responder feature must be enabled before it can be used on the Citrix ADC appliance.
To enable responder by using the GUI
- Make sure that the responder license is installed.
- In the configuration utility, expand AppExpert, and right-clickResponder, and then clickEnable Responderfeature.
Creating an HTTP callout on the Citrix ADC appliance
Create an HTTP callout, HTTP-Callout-4, with the parameter settings shown in the following table. For more information about creating an HTTP callout, seeConfiguring an HTTP Callout.
For more information, see参数和值for HTTP-Callout-4pdf.
Creating a responder action
Create a responder action, Action-Responder-4. Create the action with the parameter settings shown in the following table.
Parameter | Value |
---|---|
Name | Action-Responder-4 |
Type | Respond with |
Target | ”"HTTP/1.1 200 OK\r\nServer: Microsoft-IIS/6.0\r\nX-Powered-By: ASP.NET\r\nContent-Length: 0\r\nMS-WebStorage: 6.5.6944\r\nCache-Control: no-cache\r\n\r\n"” |
Table 2. Parameters and Values for Action-Responder-4
To create a responder action by using the configuration utility
Navigate toAppExpert>Responder>Actions.
In the details pane, clickAdd.
In theCreate Responder Actiondialog box, in Name, typeAction-Responder-4.
In Type, clickRespond with.
In Target, type:
"\"HTTP/1.1 200 OK\r\nServer: Microsoft-IIS/6.0\r\nX-Powered-By: ASP.NET\r\nContent-Length: 0\r\nMS-WebStorage: 6.5.6944\r\nCache-Control: no-cache\r\n\r\n\""
ClickCreate, and then clickClose.
Creating a Responder Policy to Invoke the HTTP Callout
Create a responder policy, Policy-Responder-4, that will check the request body and, if the body contains the word “subject,” invoke the HTTP callout to verify the email. Create the policy with the parameter settings shown in the following table. While you can create a responder policy in the Policies subnode and then bind it globally by using the Responder Policy Manager, this demonstration uses the Responder Policy Manager to create the responder policy and bind it globally.
Parameter | Value |
---|---|
Name | Policy-Responder-4 |
Action | Action-Responder-4 |
Undefined-Result-Action | -Global undefined-result action- |
Expression | “HTTP.REQ.BODY(1000).CONTAINS("urn:schemas:httpmail:subject") && SYS.HTTP_CALLOUT(HTTP-Callout-4)” |
To create a responder policy by using the configuration utility
- Navigate toAppExpert>Responder.
- In the details pane, underPolicy Manager, clickResponder policymanager.
- In theResponder Policy Mangerdialog box, clickOverride Global.
- ClickInsert Policy, and then, in thePolicy Namecolumn, clickNew Policy.
- In theCreate Responder Policydialog box, do the following:
- In Name, typePolicy-Responder-4.
- In Action, clickAction-Responder-4.
- In Undefined-Result Action, clickGlobal undefined-resultaction.
In theExpressiontext box, type:
"HTTP.REQ.BODY(1000).CONTAINS(\"urn:schemas:httpmail:subject\") && SYS.HTTP_CALLOUT(HTTP-Callout-4)"
- ClickCreate, and then clickClose.
- ClickApply Changes, and then clickClose.
Creating an HTTP callout agent on the remote server
You will now need to create an HTTP callout agent on the remote callout server. The HTTP callout agent receives callout requests from the Citrix ADC appliance and responds accordingly. The callout agent is a script that is different for each deployment and must be written with server specifications in mind, such as the type of database and the scripting language supported.
The following pseudo-code provides instructions for creating a callout agent that checks a list of words that are generally understood to indicate spam mails. The agent can be implemented in any programming language of your choice. The pseudo-code is to be used only as a guideline for developing the callout agent. You can build additional functionality into the program.
To identify spam email by using pseudo-code
- Accept the email subjecta provided by the Citrix ADC appliance.
- Connect to the database that contains all the terms against which the email subject is checked.
- Check the words in the email subject against the spam word list.
- Format the response as required by the HTTP callout.
- Send the response to the Citrix ADC appliance.