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: (
bool ShouldProcessAttachment(
	string account,
	string ruleName,
	string attachmentFilename,
	string uniqueID,
	MailMessage message


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

Return Value

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