?
Solved

Block cyrillic emails in sendmail

Posted on 2009-07-13
3
Medium Priority
?
891 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 26

Accepted Solution

by:
jar3817 earned 2000 total points
ID: 24961430
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
ID: 25374021
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
ID: 25435650
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
To show how to generate a certificate request 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 Servers >> Certificates…
Suggested Courses

719 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