Protocol Plug-in Programming Guide: Sample Protocol Level Plug-ins
Previous Next Contents Index


Chapter 4 Sample Protocol Level Plug-ins

The sample SMTP plug-in DLLs in this chapter take you step by step through constructing a protocol level plug-in using the Protocol Level Plug-in API.

  • The Anti-Relay Plug-in shows how to prevent a third party from using your site to relay UBE (unsolicited bulk email) to other sites.
  • The Tracer Plug-in shows how to log SMTP activity during a messaging session. You can use this plug-in as a template for writing your own protocol plug-ins.


The Anti-Relay Plug-in
You can use the Anti-Relay protocol level plug-in to prevent others from using your site to relay UBE on to other sites. It tests incoming messages at the protocol level, before the server accepts them and writes them to disk, and rejects unauthorized messages, which saves processing resources and disk space. You can use this plug-in, which is installed with Messaging Server, as is or change its code to meet your requirements.

The Anti-Relay plug-in is one of the defenses that Messaging Server provides against third-party relaying, or unauthorized relaying. This is a tactic that people who send UBE use to bypass filters that reject mail from certain sites. In third-party relaying, messages are relayed through other sites, thus hiding their actual origin. This is distinct from the ordinary relaying of authorized messages from one mail server to another during email delivery.

The Anti-Relay plug-in does not stop UBE delivery to users. The only way to do this is to use UBE filters, which are applied by the UBE plug-in. The UBE plug-in, which is also installed automatically with Messaging Server 4.1, was written using the Messaging Server Plug-in API. This post-accept SMTP plug-in acts as a versatile filter that removes or redirects unwanted messages. You set up UBE filters either through configuration files or by using the Netscape Console user interface.

For a detailed discussion of relaying issues and a description of the UBE plug-in and UBE filters, see Chapter 8, "Filtering Unsolicited Bulk Email," in the Messaging Server 4.1 Administrator's Guide. This chapter includes instructions for creating UBE plug-ins and filters and a comparison of their capabilities with those of the Anti-Relay plug-in. For information about the API used to create UBE plug-ins, see the Messaging Server Plug-in API Guide.

The Anti-Relay plug-in works by applying Delivery and Submission rules to incoming messages. It identifies users at your site for whom messages are accepted and delivered using Delivery rules. It identifies hosts whose messages are accepted for initial transmission, relay, or delivery using Submission rules. In addition, as a default, the Anti-Relay plug-in accepts messages from SMTP authenticated users even if their host is not defined in a Submission rule. This plug-in allows only SMTP authenticated users or those who are sending from a host named in a Submission rule to send email messages to outside destinations (those not named in a Delivery rule).

The Anti-Relay plug-in performs several operations:

Note. If you would like to see this plug-in in action, save and build the code in "Anti- Relay Plug-in Code." If you prefer, you can download a zip file, antireUN.zip, that contains the sample plug-in file, antirel.c, and the makefile for building the sample.


The Tracer Plug-in
Tracer is an SMTP tracing plug-in that creates a log entry for each non-blank line of each message as it comes in. You can use this plug-in as a template for writing a protocol level plug-in. To its basic log-keeping code, you can add any functionality your plug-in requires.

Note. If you would like to see this plug-in in action, save and build the code in "Tracer Plug-in Code." If you prefer, you download a zip file, tracerUN.zip, that contains the sample plug-in file, tracer.c, and the makefile for building the sample.

 

© Copyright 1999 Netscape Communications Corp., a subsidiary of America Online, Inc. All rights reserved.