Products Downloads Purchase Support Company
Home : Products : Anti-Spam Features

Anti-Spam Features

The war against spam has moved front and center in most organizations. Fighting spam consumes an inordinate amount of time and resources and there is no sign that things will get any better in the near future. Fortunately, ActiveUp.MailSystem supports two of the most effective and popular anti-spam methodologies.

Black list server support

Black list servers like SpamHaus store IP addresses of SMTP servers that were reported as spam gateways by users. Those databases can be accessed thought an ActiveUp.MailSystem interface. You can specify both the black list server and the IP address. ActiveUp.MailSystem supports predefined black list servers and provides an easy to use method that process the Message object and extracts the SMTP server IP for you. You simply lookup that IP address in your preferred black list provider’s database and take the appropriate action any time e-mail is received from a known spammer.

ShowShow C# code

RblServer rbl = new RblServer();

RblStatus status = rbl.GetRblStatus("rbl.example.com", "127.0.0.2");

if (status == RblStatus.NotListed)
   Console.WriteLine("Message is not listed.");

Full DomainKeys implementation

Most of the spammers use fake email addresses to send their content. As it is very easy to spoof the senders e-mail’s address, detection of spoofed addresses can be very difficult. E-mail validation routines fail because the chances are good that the spammer is using a valid e-mail address. It’s just not their address.

One solution that DomainKeys provides is the ability to add a signature to the e-mail message that can only be verified against the DNS server of the sender’s e-mail domain name. This key can be used automatically by ActiveUp.MailSystem to validate the address and therefore ensure that the e-mail is really coming from the sender’s domain name mail server.

ShowShow C# code

// We instantiate the pop3 client.
Pop3Client pop = new Pop3Client();

// Connect to the pop3 client
pop.Connect("mail.example.com", "user1
@example.com", "userpassword");

// Get the full message (note that this is not zero based index in POP3)
Message message = pop.RetrieveMessageObject(1);

if (message.HasDomainKeySignature)
{
   bool signatureValid = message.Signatures.DomainKeys.Verify();

   if (signatureValid)
   {
      Console.WriteLine("The domain key signature is valid.");
   }
   else
   {

      Console.WriteLine("The domain key signature is invalid.");
   }
}
else
{
   Console.WriteLine("The message hasn't domain key signature.");
}

Commtouch® anti-spam technology support

Commtouch®'s OEM Anti-Spam Solution delivers the highest accuracy/detection results, together with real-time blocking of spam in any language or format, including image-based spam.

Given the phenomenal distribution rates of today’s spam, the importance of real-time protection cannot be overestimated. A vulnerability gap of just 10 minutes can significantly reduce performance – so detection speed is essential. Commtouch® achieves consistently superior performance thanks to its unique ability to detect spam outbreaks as soon as they emerge, and to block all associated messages in real time.

ActiveUp.MailSystem fully support the protocol and provide you with the necessary classes to use the technology.

ShowShow C# code

File reference method:

// Select the message to test from a file
string fileReference = "c:\\emails\\e9f3fee801c79d6e000000bf.eml";

// Query the server
CtchResponse response = CtchClient.QueryServer("localhost", 8088, fileReference);

// Output the spam classification.
// Possible values (enumeration): Confirmed, Bulk, Suspected, Unknown, NonSpam
Console.Write("Spam Classification: {0}", response.SpamClassification);


// Output the vod classification (virus).
// Possible values (enumeration): Virus, High, Medium, Unknown, NonVirus
Console.Write("Spam Classification: {0}", response.SpamClassification);

Inline (embedded) method:

// Get the message object (we create it here, but it can be any existing instance of the Message object
// Typically, you use objects that you retrieve via POP3 or IMAP4
Message message = new Message(); 

// Query the server
CtchResponse response = CtchClient.QueryServer("localhost", 8088, messageObject);

// Output the spam classification.
// Possible values (enumeration): Confirmed, Bulk, Suspected, Unknown, NonSpam
Console.Write("Spam Classification: {0}", response.SpamClassification);

// Output the vod classification (virus).
// Possible values (enumeration): Virus, High, Medium, Unknown, NonVirus
Console.Write("Spam Classification: {0}", response.SpamClassification);

Black list server support

Black list servers like SpamHaus store IP addresses of SMTP servers that were reported as spam gateways by users. Those databases can be accessed thought an ActiveUp.MailSystem interface. You can specify both the black list server and the IP address. ActiveUp.MailSystem supports predefined black list servers and provides an easy to use method that process the Message object and extracts the SMTP server IP for you. You simply lookup that IP address in your preferred black list provider’s database and take the appropriate action any time e-mail is received from a known spammer.

ShowShow C# code

RblServer rbl = new RblServer();

RblStatus status = rbl.GetRblStatus("rbl.example.com", "127.0.0.2");

if (status == RblStatus.NotListed)
   Console.WriteLine("Message is not listed.");

Learning Bayesian filter

Bayesian Spam Filtering is one of the most popular spam filtering method and is probably the most effective technique. Based on statistical data that the users fills by their behavior (marking messages as spam or not spam), the word database grows and the filter become more and more effective.

ActiveUp.MailSystem bayesian spam filter is easy to use and provide all the features you need to start using it in your application. It supports spam word list, ham word list (legitimate words) and ignore word list (words such as "the", "or", etc).

The concept is simple: when a message arrive, you check it against the spam filter and its words databases. Based on the result, you mark it as spam or not. You can even combine other anti spam techniques and create your own e-mail check flow. To improve the effectiveness of the filter, you should provide your users with a button to mark explicitly a message as spam and another one to mark a message as not spam. Behind those buttons, the logic to populate the words database with the new data.

ShowShow C# code

// We instantiate the pop3 client.
Pop3Client pop = new Pop3Client();

// Connect to the pop3 client
pop.Connect("mail.example.com", "user1
@example.com", "userpassword");

// Get the full message (note that this is not zero based index in POP3)
Message message = pop.RetrieveMessageObject(1);

if (BayesianFilter.AnalyzeMessage(message))
{
   Console.WriteLine("According the filter, the message is a spam");
}
else
{
   Console.WriteLine("According the filter, the message is not a spam");
}

To teach the Bayesian filter:

ShowShow C# code

private void isSpamButton_Click(object sender, EventArgs e)
{
   BayesianFilter.BayesianFilter(_message, "spam.txt");
}

private void notSpamButton_Click(object sender, EventArgs e)
{
   BayesianFilter.BayesianFilter(_message, "ham.txt");
}

Email Addresses Validation Using MX Record Caching

If you maintain an e-mail database, you are probably familiar with the problems that result from users entering invalid e-mail addresses.

ActiveUp.MailSystem provides two different methods to validate e-mail addresses. The first one is ValidateSyntax, which checks if the e-mail format is valid. The Validate method checks the syntax of the e-mail address, then it actually connects to the e-mail mail server (MX) and tests the server (using both VRFY and RCPT methods) to validate that the e-mail account exists.

This method is used to verify a single e-mail address, and is an excellent tool to use on forms when users submit their e-mail address because the user can be notified immediately to resubmit a valid address. This reduces data entry errors and increases your list’s deliverability.

ActiveUp.MailSystem also provides a method that allows you to scan your entire database of e-mail addresses in one easy step. The GetInvalidAddresses method returns an AddressCollection object filled with all of the invalid e-mail addresses.  This allows your application to ‘clean’ the e-mail list before sending e-mails.

ActiveUp.MailSystem also provides the same MX caching functionality as Direct Send, which causes the e-mail validation process to be very fast.

ShowShow C# code

if (Validator.Validate("test@example.com"))

    Console.WriteLine("Valid Email address");
}
else
{
    Console.WriteLine("Invalid Email address");
}


 

Copyright © 2000-2007 Active Up - All Rights Reserved - Privacy Policy