How do I create a filter?

Discussion for developers using MailEnable.
Post Reply

How do I create a filter?

Post by ChrisDouglass » Fri Jan 21, 2005 2:22 pm

Hi, I have an application that creates distribution lists that contain dynamic memberships i.e. the members of any given list I create changes daily. I'd like to program MailEnable to allow me to intercept an email, look at the XML attachment my desktop application attached to the email and from that determine which list(s) I should broadcast the message to.

My thought is that since my membership for each list dynamic, I only want to query my database at the time the message is received. I then want to either:

a) change the list members for a MailEnable list and then let ME send the mail out to everyone


b) just build the recipient list myself and drop it into the outgoing SMTP queue for ME to process directly.

My "list" needs aren't really your typical "list server" needs where you have recipients replying to a message then having that digest broadcast to everyone in the list. My "lists" are one-way, mass mailing lists that must honor a dynamic membership for each "list".

Anyway, it seems like creating a filter is the way to go but I can't find any API/SDK info on how to create one and specifically on how MailEnable will notify my application when a message is received that needs to be broadcasted. I saw some info on creating a connector in the API guide and that seemed like a viable approach.

But, based on other things I'm reading here and there on this site it seems a "Filter" is really the best way to process messages as they are received.

Any help would be GREATLY appreciated!!!

Innovative Code & Design
Atlanta, GA DOT com


Some info...

Post by ChrisDouglass » Tue Jan 25, 2005 12:56 pm

I found the following interface in the MEAdminFiltering.DLL library. But, I have a feeling this is just a portion of the Admin UI interface for managing filters.

It seems I could use the pickup agent method to accomplish what I need. But, I'm really hoping to find a method that will cache my class/object and use a callback to notify of me incoming messages. The process creation/destruction overhead of executing a process per msg is terribly inefficient. But, it looks like this may be the only documented way of intercepting the message stream in ME.

Anyway, this is the interface I found. Definitely not what I hoped I would find but at least it's something. I emailed ME sales/support but haven't gotten a response yet.

interface _Filtering : IDispatch {
[in, out] BSTR* ItemKey,
[out, retval] VARIANT* );
[in, out] BSTR* ItemKey,
[out, retval] VARIANT* );

BTW, I know my app could be construed as a spam agent but it isn't. It's strictly for national, geographically distributed sales forces. This app is essentially a contact manager with advanced mailing and list management features.

I'm looking for SDK level info on ME. I want to know how to create my own agents/filters/etc and possibly implement my own pooled/cached agent mechanism to improve efficiency for message filtering. Anything on this level I develop I would share freely with the ME community.

Anyway, *any* input would be Greatly Appreciated. Thanks!



Writing a connector instead....

Post by ChrisDouglass » Tue Jan 25, 2005 2:22 pm

Ok, I'm going to try the connector route b/c I found some docs on how to do this. Seems like a reasonable solution too and won't incur the pickup agent overhead.

Using an address map it seems I can force the MTA to use my connector as the endpoint and let my connector fwd the msg to the SMTP service when ready. If so, then I should be able to achieve what I need.

If anyone is interested in the source I will post it... It will use the win32 directory/file notifications callback APIs to detect new files in the INBOUND queue/directory and then drop the command/msg files in the SMTP OUTBOUND delivery queues. The recipient list will be extracted dynamically from various data sources. Any comments/observations would be great. Anything I can make general enough to share I will...

I'll report back soon...


Posts: 279
Joined: Mon Feb 03, 2003 2:44 pm
Location: Chesapeake, VA

Post by Kiliman » Thu Jan 27, 2005 7:50 pm

A while back, I wrote a .NET wrapper around the Filter interface used by the Antivirus filter in ME Pro.

It basically works like the MTA Pickup event, but is loaded In Proc instead of being called as an out of process executable.

The wrapper allows you to create a filter as a .NET assembly or VB COM component. It also includes some helper functions that read and write message and command files.

It's written in C#. If you're interested in the code, email me and I'll send it to you.

It also includes a replacement AddressMap Provider that supports wildcard mapping at the SMTP level. That is, you can setup a mapping that says sales* -> mailbox instead of having a catchall.


See and

Posts: 3
Joined: Wed Feb 11, 2004 10:08 pm

Post by cslatt » Wed Apr 06, 2005 5:15 am

Can you send me a copy of the framework please?

Post Reply