Merhaba, Benim size onerecegim, mimedefang + spamassassin ve clamav uclusunu kullanmanizdir. Simdiye kadar kurdugum cogu yerde hic sorunla karsilasilmadan kullanilabilen hizli ve etkili bir sistem.. Size bu programin nasil kurulacagini gosteren asagidaki ingilizce dokumani verebilirim.. iyi calismalar. Murat Ustuntas ===================== Mail Server Filteringby Michael W. Lucas04/01/2004 Most of what arrives at my mail servers is unwanted: viruses, spam, and executable garbage. Even if you're running something other than Windows on the desktop, the sudden appearance of a new virus can overwhelm your inbox. If you're an administrator, your users likely aren't as reliable about not clicking on attachments as we'd all like. Combined with the flood of spam and random garbage, putting a mail server on the Internet without filtering is like covering yourself with barbecue sauce and breaking into the Charity Home for Badgers with Rabies. Decent spam and virus protection measures can save you a lot of time and effort. While the systems I use for this article are FreeBSD, the tools and techniques will work on any UNIX-like operating system running modern Sendmail. Many commercial vendors provide garbage mail protection for Sendmail, but if I go around buying software then I'm never going to be able to afford that 17" laptop. Instead, I use MIMEDefang for generic content handling, SpamAssassin to identify unwanted bulk mail, and ClamAV to reject viruses. This combination eliminates almost all unwanted mail, while letting the good stuff through. Sendmail(8) provides a Install the ClamAV Antivirus ScannerInstall ClamAV from /usr/ports/security/clamav by running Start
The Now, let's configure ClamAV to cooperate with MIMEDefang. The main
configuration file is /usr/local/etc/clamav.conf. Many of the
settings are tweakable as you desire. See the
By changing this setting, you also need to change the permissions on the various directories to which ClamAV writes.
Now that you have a basic virus scanner, you can update your virus
definitions. Virus definitions are maintained by volunteers from around
the
world. When a major new virus hits, you can expect to see a definition
available within hours. As I write this, the ClamAV database has
signatures
for 10,131 popular viruses. First, run Once you know the update process works, enable the
The next time you reboot, the system will start the ClamAV virus
scanner and
updater. You might need to Integrating ClamAV with MIMEDefangBy default, ClamAV puts its UNIX socket in
/var/run/clamav/clamd. MIMEDefang expects to find it in
/var/spool/MIMEDefang/clamd.sock. One or the other must change.
If you do not change the socket, you will see errors in the mail log
where
MIMEDefang cannot communicate with the virus scanner. I consistently
change
ClamAV to use the MIMEDefang location, simply because it doesn't make
any
difference to the programs, but it's easier for me to remember. Change
this in
the clamav.conf file under the Once you change this in the configuration, however, ClamAV will not run until you've installed MIMEDefang. Despite advances in computing technology, placing sockets in nonexistent directories still presents difficulties. Install SpamAssassinSpamAssassin is perhaps the most celebrated piece of anti-spam software. It's a Perl package that uses pattern-matching to assign each piece of email a score. Key phrases, such as "Make money fast" and "Work from home," will increase the mail's score, as will bogus headers and an origination IP of a known spam source. You can set your mail client to delete or filter mail that has a score above your preferred limit. Install SpamAssassin from /usr/ports/mail/p5-Mail-SpamAssassin. As SpamAssassin is managed as part of MIMEDefang, we don't need to configure SpamAssassin itself; its configuration has been assimilated into MIMEDefang. Proceed directly to installing MIMEDefang. Install MIMEDefangMIMEDefang can add the common legalese found at the bottom of some email messages, provide very fine-grained access control, and alter emails in almost any other way desired. Our main interest is in using MIMEDefang to strip out unwanted attachment types and coordinate ClamAV and SpamAssassin activities. MIMEDefang's port lives under /usr/ports/mail/mimedefang. Like SpamAssassin, it's written in Perl. Like ClamAV, it runs in daemon mode, so that the system can avoid the massive overhead of starting up a Perl program for every email that passes through the system. When you install MIMEDefang, the configure script will automatically detect that you have both ClamAV and SpamAssassin and will build itself appropriately. MIMEDefang's configuration file, /usr/local/etc/mimedefang/mimedefang-filter, contains fragments of Perl code that integrate with the main MIMEDefang daemon. If you are not comfortable with Perl, don't worry; just be certain that you implement new functions exactly as they are shown and you won't have any trouble. (I also highly recommend that you spend a few hours with an introductory Perl text; even though I'm a systems administrator and not a programmer, Perl is far too useful in my day-to-day work.) You should set a few variables in
MIMEDefang will occasionally send an email about an action it has
taken.
Set the
Everything else in this file is strictly optional. Take a look at some of the settings, however, as you might find them useful in your network. There are examples of blocking emails with too many MIME parts, as well as configuring where MIMEDefang will place its alerts. The default includes antispam and antivirus functions, as well as mail quarantine. Personally, I find that MIMEDefang's mail quarantine functions are reliable enough that I'm comfortable simply rejecting viral emails. There's a comment in the mimedefang-filter file much like this:
By commenting out the line beginning with Finally, the variable To make MIMEDefang start at boot time, go into /usr/local/etc/rc.d
and copy mimedefang.sh-dist to mimedefang.sh. By
default, this program does not start when the
system boots. You must have Configuring SpamAssassin for MIMEDefangMIMEDefang includes a configuration file for its SpamAssassin calls: /usr/local/etc/mimedefang/spamassassin/sa-mimedefang.cf. If you want to make any changes to the global SpamAssassin settings, change this file. Editing other SpamAssassin configuration files will have no effect whatsoever on SpamAssassin. You can configure SpamAssassin in almost endless ways; we'll cover only the bare bones. Adjust the sensitivity of the filter with the Another important feature is the whitelist, which allows you
to list email
addresses that should never be considered spam sources. For example, my
sister
sends HTML-laden, image-heavy email from a known spam sewer. By listing
her
email address on a Making Filtering EasierOne surprise for users familiar with SpamAssassin is that MIMEDefang does not allow SpamAssassin to alter the email in any way. Instead, SpamAssassin reports a score back to MIMEDefang and lets MIMEDefang change the message. The MIMEDefang FAQ includes several suggestions for editing the filter configuration so as to display SpamAssassin information as desired. By default, MIMEDefang displays a single header that contains the SpamAssassin score and a series of asterisks, much as the example below shows.
Many email clients have difficulty filtering on this header; their filtering rules will not let them compare the numerical score. By making one minor change in how MIMEDefang marks spam email, you can make life much easier for these users. In /usr/local/etc/mimedefang/mimedefang-filter, you'll see a line like this:
If you exchange the
Your email header will then look something like this:
You can write a rule that searches the X-Spam-Score header for a certain number of asterisks and filters those messages away. With this header setup, users can easily adjust their own spam tolerances; you can be harsh on spam detection on the server, knowing that all you're really doing is adding a header. If a user decides to set his sensitivity to two asterisks and loses some vital email, that's not your fault. Integrating with SendmailNow that you have a working MIMEDefang/SpamAssassin/ClamAV
installation, how
do you tie all this into Sendmail's
Whenever you rebuild your system, this tells
Stay in the /etc/mail directory and run ConclusionIf you ===================== aybike wrote:
--------------------------------------------------------------------- Cikmak icin, e-mail: [EMAIL PROTECTED] Liste arsivi: http://lists.enderunix.org ve http://www.mail-archive.com/freebsd@lists.enderunix.org Turkiye'nin ilk FreeBSD kitabi: http://www.acikkod.com/freebsd.php |