Click or drag to resize
IEmailFilteringShouldProcessAttachment Method
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");
}

Namespace: MailAttachmentDownloaderPluginAPI
Assembly: MailAttachmentDownloaderPluginAPI (in MailAttachmentDownloaderPluginAPI.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
bool ShouldProcessAttachment(
	string account,
	string ruleName,
	string attachmentFilename,
	string uniqueID,
	MailMessage message
)

Parameters

account
Type: SystemString
The email account that is being used to download this attachment.
ruleName
Type: SystemString
The matching rule name.
attachmentFilename
Type: SystemString
The attachment filename without the path.
uniqueID
Type: SystemString
The uniqueID for the email.
message
Type: System.Net.MailMailMessage
The email message.

Return Value

Type: Boolean
true if download attachment, false if not
See Also