Cover

Configuration of Postfix Mail Server Supporting Anti Spam and Anti Virus

Configuration of Postfix Mail Server Supporting Anti Spam and Anti Virus

 

 

 

 

 

 

 

 

 

 

 

By

Dr. Hedaya Mahmood Alasooly

Hedaya_alasooly@yahoo.com

 

1. Introduction:

1. Introduction:

 

This work provides starting guide for simple Postfix mail server configuration. Then I configured the Postfix mail server to support Anti-Spam and Anti-Virus, using two methods.

  • Method 1: With Postfix, SpamAssassin, ClamAV and Amavis-new
  • Method 2: With Postfix, SpamAssassin, ClamAV and Procmail

 

The report includes the following sections

1. How Postfix receives mail:

2. How Postfix delivers mail

3. Starting guide for quick Postfix configuration

4. Postfix mail server and Dovecot configuration

5. Installing ClamAV and SpamAssassin

6. Installing and configuring Squirrelmail:

7. Method 1 to support Antivirus and Antispam: Using Postfix, Amavis-new, ClamAV, SpamAssassin

8. Method 2 to support Antivirus and Antispam: Using Postfix, Procmail, ClamAV, SpamAssassin

 


3. How Postfix delivers mail

2. How Postfix receives mail:

 

When a message enters the Postfix mail system, the first stop on the inside is the incoming queue. The figure below shows the main processes that are involved with new mail. Names followed by a number are Postfix commands or server programs, while unnumbered names inside shaded areas represent Postfix queues.

 

  • Network mail enters Postfix via the smtpd(8) or qmqpd(8) servers. These servers remove the SMTP or QMQP protocol encapsulation, enforce some sanity checks to protect Postfix, and give the sender, recipients and message content to the cleanup(8) server. The smtpd(8) server can be configured to block unwanted mail, as described in the SMTPD_ACCESS_README document.

 

  • Local submissions are received with the Postfix sendmail(1) compatibility command, and are queued in the maildrop queue by the privileged postdrop(1) command. This arrangement even works while the Postfix mail system is not running. The local pickup(8) server picks up local submissions, enforces some sanity checks to protect Postfix, and gives the sender, recipients and message content to the cleanup(8) server.

 

  • Mail from internal sources is given directly to the cleanup(8) server. These sources are not shown in the figure, and include: mail that is forwarded by the local(8) delivery agent (see next section), messages that are returned to the sender by the bounce(8) server (see second-next section), and postmaster notifications about problems with Postfix.

 

  • The cleanup(8) server implements the final processing stage before mail is queued. It adds missing From: and other message headers, transforms addresses as described in the ADDRESS_REWRITING_README document. Optionally, the cleanup(8) server can be configured to do light-weight content inspection with regular expressions as described in the BUILTIN_FILTER_README document. The cleanup(8) server places the result as a single file into the incoming queue, and notifies the queue manager (see next section) of the arrival of new mail.

 

 

  • The trivial-rewrite(8) server rewrites addresses to the standard "user@fully.qualified.domain" form, as described in the ADDRESS_REWRITING_README document. Postfix currently does not implement a rewriting language, but a lot can be done via table lookups and, if need be, regular expressions


4. Starting guide for Postfix configuration:

3. How Postfix delivers mail

 

Once a message has reached the incoming queue the next step is to deliver it. The figure shows the main components of the Postfix mail delivery apparatus. Names followed by a number are Postfix commands or server programs, while unnumbered names inside shaded areas represent Postfix queues.

 

 

The queue manager (the qmgr(8) server process in the figure) is the heart of Postfix mail

Imprint

Publisher: BookRix GmbH & Co. KG

Publication Date: 04-13-2021
ISBN: 978-3-7487-8027-4

All Rights Reserved

Next Page
Page 1 /