Spam Filter Idea...

This forum contains features that has been archived. This section contains implemented features, duplicate requests, and requests which we have decided not to implement.
Post Reply
aceinc
Normal user
Normal user
Posts: 110
Joined: 2004-04-01 04:37
Location: Ft. Lauderdale, Florida, USA

Spam Filter Idea...

Post by aceinc » 2004-04-15 05:49

I know that ASSP is the best thing since sliced bread and all that but how about something like the following;

hmailserver could be configured to call a routine such as an active-x component (or a standard dll) passing a user identifier such as xxx@yyy.com and either the entire message, the ID of a DB record which contains the entire message, or a file name which contains the entire message. The routine then passes back either a true or false.

True would indicate reject the message, and false to accept the message (or vice versa). If it was a reject the mailserver would then delete the message and reply to the relaying server a delivery error.

A stub routine which always returns false is provided with hmailserver so that no mail is rejected out of the box. A separate project which interfaces with squirrel mail, iloha mail or any other mail client could be written to handle spam.

I have written in VB/mysql as an active-x component a bayesian spam filter that works with a web based mail client I use. It is called by the windows service that pops mail to do the initial classification. The Client (ASP) then allows reclassification which updates the corpus (a corpus per user) by calling the same component.

I would envision the same type of interface where the routine is called by hmailserver, and then the mail client maintains the corpus with an intuitive interface.

Other enhancements might include;

instead of passing back a true/false pass back a folder ID for IMAP or a prefix for the subject for pop3.

make the routine called and/or calling method configurable...

Comments?

If you wish to throw tomatoes, I prefer the little grape ones, they taste better, and don't hurt so much. :o

Paul

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2004-04-15 10:07

I was thinking about letting the server be a COM Service which sends events. So when a message is delivered the event OnMessageDelievered(oMessage as hMailServer.Message)...
And then the plugin can do like oMessage.Recipients.Count and so on...

This would require the plugin to be an active-x-EXE running on the server all the time.

The advantage with letting it run as a COM service is that you can utilitize "real" COM events. Intellisense will work with vb. (you can select the event you are interessted in from a drop down etc). And you can do like

function OnMessageReceived(oApplication as hMailServer.Application, oMessage as HMailServer.Message)
oMessage.Delete
oApplication.AddToLog "Message deleted"
end function

What do you think about this idea?

aceinc
Normal user
Normal user
Posts: 110
Joined: 2004-04-01 04:37
Location: Ft. Lauderdale, Florida, USA

Spam Filter Idea...

Post by aceinc » 2004-04-15 17:18

Martin:

Will this allow me to check the message prior to hmailserver accepting it?

By having hmailserver call the routine prior to ack'ing the recipt of the message it would allow hmailserver to nak the message. This would hopefully cause the sender to remove the recepient from its list.

I see the method that you suggest as allowing the spam filter to process messages as they are received, but it doesn't seem to allow direct intervention prior to accepting the message. Of course I'm not an active-X guru, and I might be missing something.

Paul

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2004-04-15 18:20

The OnMessageDelivered was just an example. If I fix so that the server is an COM server, I can add enough events to make it possible for the Active-X-EXE to deny incoming emails if they like.:
OnSMTPConnectionAccepted(IP as string), OnMessageReceived(oMessage as hmailserver.message), OnPOP3UserLoggedOn(oUser as hMailServer.User) and so on. (The active-x-exe can decide which events to listen on - it does not have to subscribe on all the events)

aceinc
Normal user
Normal user
Posts: 110
Joined: 2004-04-01 04:37
Location: Ft. Lauderdale, Florida, USA

Spam Filter Idea...

Post by aceinc » 2004-04-16 17:16

Martin:

Pardon my ignorance, but;

How does the active-x exe let hmailserver know that it needs to wait for an ack or nak before finishing the processing of a message? If the active-x exe does not exist hmailserver must know that it can accept every message as well. It would also be good to do this in the case of a timeout condition.

Paul

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2004-04-17 01:17

Hi.

If the active-x-exe exists, it can implement the OnMessageReceived event and do something like this:

Public Function OnMessageReceived(oApplication as hMailServer.Application, oMessage as hMailServer.Message) as long
oApplication.SMTPDeliverer.CancelMessageDelivery(oMessage)
End Sub

... or just somethink like that.. If the active-x-exe does not exist, no one will tell the smtp deliverer to cancel the message delivery and the message will be delivered.

Post Reply