Starting Guide for Postfix Mail Server Configuration Supporting Anti Spam and Anti Virus
eBook - ePub

Starting Guide for Postfix Mail Server Configuration Supporting Anti Spam and Anti Virus

  1. 32 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Starting Guide for Postfix Mail Server Configuration Supporting Anti Spam and Anti Virus

About this book

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 ProcmailThe report includes the following sections1. How Postfix receives mail: 2. How Postfix delivers mail3. Starting guide for quick Postfix configuration4. Postfix mail server and Dovecot configuration5. Installing ClamAV and SpamAssassin6. Installing and configuring Squirrelmail: 7. Method 1 to support Antivirus and Antispam: Using Postfix, Amavis-new, ClamAV, SpamAssassin8. Method 2 to support Antivirus and Antispam: Using Postfix, Procmail, ClamAV, SpamAssassin

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Starting Guide for Postfix Mail Server Configuration Supporting Anti Spam and Anti Virus by Dr. Hidaia Mahmood Alassouli in PDF and/or ePUB format, as well as other popular books in Computer Science & System Administration. We have over one million books available in our catalogue for you to explore.

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

This is just example to support the Antivirus and Antispam on the Postfix server. You must change the IP and domain names to your desired IPs and domain names:
1- Configure the Postfix with general configuration options. I wrote a previous report in Postfix, so no need to repeat.
In /etc/postfix/main.cf
myhostname = linux1.localdomain.msft
mydomain = localdomain.msft
myorigin = $myhostnam
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain $mydomain
mynetworks_style = subnet
content_filter = smtp-amavis:[127.0.0.1]:10024
transport_maps = hash:/etc/postfix/transport
relay_domains = $transport_maps, $mydestination
In /etc/postfix/master.cf, add
smtp-amavis unix - - - - 2 smtp -o smtp_data_done_timeout=1200 -o disable_dns_lookups=yes
localhost:10025 inet n - - - - smtpd -o content_filter=
In /etc/postfix/transport
.localdomain.msft local:
2- Then, make
# postmap transport
# service postfix restart
# service postfix reload
3- Download amavis-new-2.4.0 from www.ijs.si/software/amavisd, and extract it
4- Fellow the installation requirements in the help files,
  • 4.1- Install the following webmin modules using the webmin (go to Others, then Perl Modules)
Archive::Tar (Archive-Tar-x.xx)
Archive::Zip (Archive-Zip-x.xx) (1.14 or later should be used!)
Compress::Zlib (Compress-Zlib-x.xx) (1.35 or later)
Convert::TNEF (Convert-TNEF-x.xx)
Convert::UUlib (Convert-UUlib-x.xxx) (1.05 or later, stick to new versions!)
MIME::Base64 (MIME-Base64-x.xx)
MIME::Parser (MIME-Tools-x.xxxx) (latest version from CPAN - currently
5.417)
Mail::Internet (MailTools-1.58 or later have workarounds for Perl 5.8.0 bugs)
Net::Server (Net-Server-x.xx) (version 0.88 finally does setuid right)
Net::SMTP (libnet-x.xx, ports/net/p5-Net) (>= libnet-1.16 for performance)
Digest::MD5 (Digest-MD5-x.xx) (2.22 or later)
IO::Stringy (IO-stringy-x.xxx)
Time::HiRes (Time-HiRes-x.xx) (use 1.49 or later, older can cause problems)
Unix::Syslog (Unix-Syslog-x.xxx)
BerkeleyDB with bdb library 3.2 or later (4.2 or later preferred)
Optional Perl modules:
Mail::SpamAssassin for doing spam scanning (2.64 or 3.0.4 or >=3.1)
DBI with appropriate DBD::* if using SQL lookups
Net::LDAP if using LDAP lookups
Authen::SASL authenticating on mail forwarding and on submitting DSN
Mail::ClamAV Perl module interface to ClamAV library
SAVI Perl module interface to Sophos library (0.30 or later)
  • 4.2- Create a user and group amavis, the home directory /var/amavis. Create its home directory, unless account creation procedure already did it:
# mkdir /var/amavis
Create the following subdirectories:
# mkdir /var/amavis/tmp /var/amavis/var /var/amavis/db /var/amavis/home
Do
# chown -R amavis:amavis /var/amavis
# chmod -R 750 /var/amavis
  • 4.4- Do
# cp amavisd /usr/local/sbin/ (from the amavis directory)
# chown root /usr/local/sbin/amavisd
# chmod 755 /usr/local/sbin/amavisd
  • 4.5- Copy file amavisd.conf to wherever you want it to reside such as /etc, and make sure it is not writable by non-privileged users;
# cp amavisd.conf /etc/
# chown root /etc/amavisd.conf
# chmod 644 /etc/amavisd.conf
  • 4.6- Create a directory (e.g. /var/virusmails) to be used by amavisd-new as a quarantine area (if a virus or spam quarantine is desired).
# mkdir /var/virusmails
# chown amavis:amavis /var/virusmails
# chmod 750 /var/virusmails
  • 4.7- Make the following
# chown root /var/amavis
# chown -R amavis:amavis /var/amavis/var
# chmod 750 /var/amavis /var/amavis/var
  • 4.8- Make the following inside the amaisd-new directory to restart the amavisd service at boot time.
# cp amavisd_init.sh /etc/rc.d/init.d/amavisd
# chmod 755 /etc/rc.d/init.d/amavisd
# chkconfig --level 2345 amavisd on
and change the amavisd_init.sh , so
prog="/usr/local/sbin/amavisd"
  • 4.9- Edit file /etc/amavisd.conf , you need to go through the help for proper configuration of the file, as an example:
$max_servers = 2;
$daemon_user = 'amavis';
$daemon_group = 'amavis';
$mydomain = 'localdomain.msft';
$MYHOME = '/var/amavis';
$TEMPBASE = "$MYHOME/tmp";
$ENV{TMPDIR} = $TEMPBASE;
$QUARANTINEDIR = '/var/virusmails';
$db_home = "$MYHOME/db";
$helpers_home = "$MYHOME/var";
$pid_file = "$MYHOME/var/amavisd.pid";
$lock_file = "$MYHOME/var/amavisd.lock";
$myhostname = 'linux1.localdomain.msft'; # must be a fully-qualified domain name!
$notify_method = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025'; # set to undef with milter!
$inet_socket_port = 10024;
$final_virus_destiny = D_BOUNCE;
$final_banned_destiny = D_BOUNCE;
$final_spam_destiny = D_BOUNCE;
$final_bad_header_destiny = D_PASS;
$inet_socket_bind = '127.0.0.1'; # limit socket bind to loopback interface
# (default is '127.0.0.1')
@inet_acl = qw(127.0.0.1 [:...

Table of contents

  1. Starting Guide for Postfix Mail Server Configuration Supporting Anti Spam and Anti Virus
  2. 2. How Postfix receives mail:
  3. 3. How Postfix delivers mail
  4. 4. Starting guide for Postfix configuration:
  5. 5. Postfix mail server and Dovecot configuration:
  6. 6. Installing and configuring Squirrelmail:
  7. 7. Installing ClamAV and SpamAssassin
  8. 8. Method 1 to support Antivirus and Antispam: Using Postfix, Amavis-new, ClamAV, SpamAssassin
  9. 9. Method 2 to support Antivirus and Antispam : Using Postfix, Procmail, ClamAV, SpamAssassin