How to install Postfix, Amavisd-new, SpamAssassin, Pyzor, Razor, DCC, and ClamAV on Fedora Core 4 - v2.1.7

By RoNNY Nussbaum

 

 

Greetings!

 

This document describes how to install Postfix, Amavisd-new, SpamAssassin, Pyzor, Razor, and DCC on one box running Fedora Core 4. The installation assumes that Postfix will not be the final destination of incoming mail. Also, no e-mail is sent through it to the outside world. It is a simple MTA that receives e-mail, scans it, and moves it to another MTA for processing.

 

You need to know some Linux to use this guide. At the minimum you need to know how to work with vi (see Appendix B). Also, I’m not a Linux expert, so some of you gurus out there may find some better ways to do things. That’s fine. Feel free to give me feedback. It’s important to keep this document updated, your input is invaluable, and will help make this document better. For all questions or comments, please e-mail me at ronnynussbaum [at] gmail [dot] com.

 

Use this document at your own risk. I take absolutely no responsibility for any losses or damages incurred as a result of using this installation, but it does work…really!

 

This document was inspired by the original document written by Scott L. Henderson, however, it’s a document that I wrote on my own, and has some more settings, tweaks, and tricks that I learned about from my own experience, and from the good people in the mailing lists. I tried to be very clear, and explain each setting. If you find something to be confusing, please let me know.

 

I’d like to also mention the great document by mr88talent. His document describes a similar installation, but on a Debian rather than Fedora. You can find his document here: http://www200.pair.com/mecham/spam/, and I have found it to contain some valuable resources that are good for Fedora as well, and were used in this document.

 

I will start by installing Postfix, which will be our mail server in this case. Postfix uses amavisd-new to communicate with content filters, such as SpamAssassin, and ClamAV. SpamAssassin is using its own anti-spam techniques, as well as communicating with third-party services, such as Razor, Pyzor, and DCC, to detect if a message is spam or not. In this document, I will refer to amavis-new as Amavisd, and sometimes amavisd. In any case, I’m talking about amavisd-new, which can be found here: http://www.ijs.si/software/amavisd/.

 

You will also see situation where I claim that something will happen if we set a specific variable to a specific value.

Please keep in mind that this doesn’t necessarily means that in all cases, and all configurations, you will get the same results.

The setting may be true for this configuration only.

 

This document works best if you view it at a resolution of 1024x768. If you have a lower resolution browser window, make sure to pay careful attention to the commands that you type. Spaces tend to disappear when your browser wraps the lines. Also, some people reported printing the document, and that some underscores disappeared in the process. Please double-check every command that you type against the web version of the document.

 

One final note: this installation is for Fedora Core 4, but this document started its life as the installation manual for Fedora Core 3. With proper adjustment, it can be easily used on FC3. In fact, I think that the only thing that’s a little different is the installation part. If you chose to install FC3 instead of FC4, I suggest that you’ll simply ignore the differences that you see during install. It should work fine.

 

Enjoy building the server.

 

-RoNNY

 

Table of Contents

How to install Postfix, Amavisd-new, SpamAssassin, Pyzor, Razor, DCC, and ClamAV on Fedora Core 4 - v2.1.6. 1

Table of Contents. 2

Conventions Used In This Manual 4

Installing Fedora Core 4. 6

Errors During Boot 8

After the Initial Reboot 8

Login to the System for the First Time. 8

Firewall Protection. 9

PuTTY.. 9

WinSCP. 9

Disabling Some Unneeded Daemons (Services) 10

Updating the System.. 10

Changing the Language Preferences. 11

Make vi Show Files in Color (use vim) 11

Optional: Configuring ls. 11

Downloading the Required Software. 12

Set the System to Boot into Text Mode. 12

Creating Some Required Users. 12

Installing Postfix. 13

Configuring Postfix. 14

A Word About DNS and MX Records. 14

The master.cf File. 16

The main.cf File. 16

Postfix’s Own Anti-Spam Filters. 19

The virtual File. 22

The transport File. 23

The client_access File. 23

The helo_access File. 24

The sender_access File. 25

The recipient_access File. 25

Asynchronous Logging. 26

Testing Postfix. 26

Searching the Log. 27

Testing Incoming Mail 28

Setting Postfix to Start Automatically at System Boot 29

Saving Postfix’s Configuration. 29

Address Verification. 30

Installing SpamAssassin. 31

The Trusted Path Problem.. 33

Installing Amavisd-New.. 34

An Overview of Amavis’ Quarantine, Notifications, and Actions. 34

Configuring Amavisd-New.. 37

A Few Words About Tags. 37

Creating Some Directories for Amavisd. 42

Installing Some Prerequisites for Amavisd. 42

About Sender Policy Framework (SPF) 43

Creating White-List and Black-List files. 44

Testing Amavisd. 44

Setting Postfix to Use Amavisd. 45

Setting Amavisd to Start Automatically at System Boot 46

Amavis’ Little Children. 46

Installing Razor 47

Configuring Razor 48

Installing Pyzor 49

Installing DCC.. 50

More SpamAssassin Configuration. 52

Testing the Server 54

Reminder Regarding Configuration Changes. 56

Installing ClamAV.. 57

Configuring ClamAV.. 58

Testing ClamAV.. 59