Solved

Block cyrillic emails in sendmail

Posted on 2009-07-13
3
828 Views
Last Modified: 2013-12-18
Hi,
I have a linux mailserver (CentOS 5.3) with sendmail, I use DNS blacklisting for filtering spam and clamav-milter for viruses. The level of spam is ok with the exception of a few users that receive around 50-100 spam messages/day and all of them in koi8-r encoding (it's cyrillic characters). I need a simple method of blocking or rejecting emails written in cyrillic characters if possible without applying other antispam rules.

Thank you
0
Comment
Question by:aligigi
3 Comments
 
LVL 26

Accepted Solution

by:
jar3817 earned 500 total points
Comment Utility
Without applying other antispam rules? I don't think so. The only thing I can think of is to use a milter like mimedefang (http://mimedefang.org) and test for the encoding of the body in the filter() section.

This site has an example using the subject instead of the body:
http://lists.roaringpenguin.com/pipermail/mimedefang/2009-April/034698.html

This is not for the faint-of-heart and you really need to know some perl, or be able to figure it out.
0
 
LVL 76

Expert Comment

by:Alan Hardisty
Comment Utility
Not sure about how to do this with sendmail, but if you had Vamsoft ORF (www.vamsoft.com), then you could do this easily.  I use this amongst it's other features and so far in 19 days, have had Zero spam.
It is very well priced too and I am now recommending this to all my customers.
0
 
LVL 3

Author Comment

by:aligigi
Comment Utility
Hi,
I finally resolved it, I tried simpler solutions, none worked so in the end I used mimedefang. I installed mimedefang using yum, I added the following line to sendmail.mc:
INPUT_MAIL_FILTER(`mimedefang', `S=unix:/var/spool/MIMEDefang/mimedefang.sock, F=T, T=C:30m;S:30m;R:30m;E:30m')
and I added this to mimedefang-filte in the filter procedurer:
    $head = $entity->head;
    $charset = $head->mime_attr("content-type.charset");
    if (defined($charset)) {
      $charset =~ tr/A-Z/a-z/;
      if ($charset eq "koi8-r" or
          $charset eq "euc-kr" or
          $charset eq "koi8-u" or
          $charset eq "3deu-kr" or
          $charset eq "windows-1251") {
          syslog('alert',"MIMEDefang rejected an E-Mail using charset $charset");
         
          return action_bounce("CONTENT VIOLATION: Mail using character set $charset not accepted here");
          }
    }
I had some problems with mimedefang not finding the antivirus (I use clamav) so I commented out that part of the code since I use clamav-milter directly in sendmail.mc.
Thanks for the help.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Nearly six years ago I was hired by a company to be their senior server engineer. One of my first projects was to implement Exchange Server 2007 on a Windows Server 2008 Single Copy Cluster for high availability. That was the easy part; read on to l…
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now