RE: Ubuntu 14.04 | Install and Configure Postfix + Amavisd-new + ClamAV + Spamassassin
03-27-2015, 06:34 PM
(03-27-2015, 06:19 PM)Me.B Wrote:(03-27-2015, 03:21 PM)Good One Wrote: I am not able to access Rounde Cube after following this....
Error: Failed to connect server storage
Expose here the changes you made step by step, so we can help you.
M B
I followed the guide from that given link above... Step by step... It was working ,
Code:
To begin, install (see InstallingSoftware) the following packages:
sudo apt-get install amavisd-new spamassassin clamav-daemon
Install the optional packages for better spam detection (who does not want better spam detection?):
sudo apt-get install libnet-dns-perl libmail-spf-query-perl pyzor razor
Note: Replace libmail-spf-query-perl with libmail-spf-perl
Install these optional packages to enable better scanning of attached archive files:
sudo apt-get install arj bzip2 cabextract cpio file gzip lha nomarch pax rar unrar unzip unzoo zip zoo
Configuration
Clamav
The default behaviour of Clamav will fit our needs. A daemon is launched (clamd) and signatures are fetched every day. For more Clamav configuration options, check the configuration files in /etc/clamav.
Add clamav user to the amavis group and vice versa in order for Clamav to have access to scan files:
sudo adduser clamav amavis
sudo adduser amavis clamav
Spamassassin
Spamasssassin autodetects optional components and will use them if they are present. This means that there is no need to configure dcc-client, pyzor and razor.
The fine tuning of Spamassassin rules is beyond the scope of this guide. Please refer to the Spamassassin page.
Edit /etc/default/spamassassin to activate the Spamassassin daemon change ENABLED=0 to:
ENABLED=1
and to enable automatic rule updates change CRON=0 at the bottom to:
CRON=1
Now start Spamassassin:
sudo /etc/init.d/spamassassin start
Amavis
First, activate spam and antivirus detection in Amavis by editing /etc/amavis/conf.d/15-content_filter_mode:
use strict;
# You can modify this file to re-enable SPAM checking through spamassassin
# and to re-enable antivirus checking.
#
# Default antivirus checking mode
# Uncomment the two lines below to enable it
#
@bypass_virus_checks_maps = (
\%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);
#
# Default SPAM checking mode
# Uncomment the two lines below to enable it
#
@bypass_spam_checks_maps = (
\%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);
1; # insure a defined return
After configuration Amavis needs to be restarted:
sudo /etc/init.d/amavis restart
Postfix integration
For postfix integration, you need to add the content_filter configuration variable to the Postfix configuration file /etc/postfix/main.cf. This instructs postfix to pass messages to amavis at a given IP address and port:
content_filter = smtp-amavis:[127.0.0.1]:10024
The following postconf command, run as root because of the preceding sudo command, adds the content_filter specification line above to main.cf:
sudo postconf -e "content_filter = smtp-amavis:[127.0.0.1]:10024"
Alternatively, you can manually edit main.cf yourself to add the content_filter line.
Next edit /etc/postfix/master.cf and add the following to the end of the file:
smtp-amavis unix - - - - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - - - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions=reject_unauth_pipelining
-o smtpd_end_of_data_restrictions=
-o mynetworks=127.0.0.0/8
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
Also add the following two lines immediately below the "pickup" transport service:
-o content_filter=
-o receive_override_options=no_header_body_checks
This will prevent messages that are generated to report on spam from being classified as spam.
More information can be found from "README.postfix from amavisd-new" and "D.J.Fan"
Reload postfix:
sudo /etc/init.d/postfix reload
Now content filtering with spam and virus detection is enabled.
I even passed the Test step. But after I go inside sentora and try to access webmail (roundcube) , I get that error.
Also in Service Status. I see IMAP and POP3 Port Closed.
But my server have this port opens by default.