Click or drag to resize
IEmailFiltering Interface
Filtering plugin interface that offers functions that you can use to influence which emails or attachments are downloaded.

Functions specified in this interface may be invoked from multiple threads simultaneously for different emails for parallel processing. You must make sure that the implementation is thread-safe. For a given email, this will typically only be invoked from a single thread except in the case of an error where a retry may invoke it from another thread.

Namespace: MailAttachmentDownloaderPluginAPI
Assembly: MailAttachmentDownloaderPluginAPI (in MailAttachmentDownloaderPluginAPI.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public interface IEmailFiltering

The IEmailFiltering type exposes the following members.

Methods
  NameDescription
Public methodShouldProcessAttachment
Implement this function and return true if the attachment should be downloaded and false if not. Note that returning true would still require other filters defined as part of the rule to match. Returning false will always prevent the file from being downloaded.

This function may be invoked from multiple threads simultaneously for different emails for parallel processing.

Example below shows how you can only have PDF files downloaded programmatically.

public bool ShouldProcessAttachment(string account, string ruleName, string attachmentFilename, string uniqueID, MailMessage message)
{
    return attachmentFilename.ToLowerInvariant().Contains(".pdf");
}
Top
See Also