3

In my application(C#) i need to filter emails based on their content. If an email is a double-opt in need to send it to a specified email address if it's a normal email i should send it to another email address.

I looked at the emails that come in and made a list of common words that appear in the subject for the double opt-in emails(10 - 20 words max). For each email that came in i checked if the subject contained some of the words and if they where more than 2-3 depending on the subject length i decided that was an opt-in. Problem was that this basic version didn't worked well.

I read about spam filters(basically what i want to do is similar.) and after searching for some examples on the web i found some based on Bayesian Networks. The problem with this solution is that i needed to feed in a lot of training material which i don't have yet.

How could i filter these emails based on content+subject or just subject without needing a lot of training material?

EDIT: i want to do the filtering at the email server level.

Sorin Antohi
  • 6,145
  • 9
  • 45
  • 71

2 Answers2

2

I think you should use MailSystem.NET, which will make email parsing very easy.

MailSystem is a suite of .NET components that provide users with an extensive set of email tools. MailSystem provides full support for SMTP, POP3, IMAP4, NNTP, MIME, S/MIME, OpenPGP, DNS, vCard, vCalendar, Anti-Spam (Bayesian , RBL, DomainKeys), Queueing, Mail Merge and WhoIs

You have to provide configuration details, like mail server name, username and password. Then read each mail and it's subject.

Sandeep Kumar M
  • 3,841
  • 3
  • 38
  • 59
0

It depends on the mail client you are using. Gmail provides such capabilities as many other modern mail clients.

Luixv
  • 8,590
  • 21
  • 84
  • 121
  • hi Luixv, i want to do the filtering at the email server level before the emails being saved into the boxes. I updated my question. – Sorin Antohi Nov 11 '10 at 08:40