Browse Source

Added Amavis configuration

old-stable
gau1991 11 years ago
parent
commit
f3bdc92413
  1. 9
      src/modules/stack/install/mail/ee_mod_install_amavis.sh
  2. 16
      src/modules/stack/install/mail/ee_mod_setup_amavis.sh
  3. 24
      templates/mail/amavis-master.cf

9
src/modules/stack/install/mail/ee_mod_install_amavis.sh

@ -0,0 +1,9 @@
# Install Amavis package
function ee_mod_install_dovecot()
{
# Install Amavis
ee_lib_echo "Installing Amavis, please wait..."
$EE_APT_GET amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \
|| ee_lib_error "Unable to install Amavis, exit status = " $?
}

16
src/modules/stack/install/mail/ee_mod_setup_amavis.sh

@ -0,0 +1,16 @@
# Setup Amavis
function ee_mod_setup_amavis()
{
# Confiure Amavis
sed -i "s'#@'@'" /etc/amavis/conf.d/15-content_filter_mode
sed -i "s'# ' '" /etc/amavis/conf.d/15-content_filter_mode
# Add mail filtering rules
sed -i "s/use strict;/use strict;\n\$sa_spam_subject_tag = undef;\n\$spam_quarantine_to = undef;\n\$sa_tag_level_deflt = undef;\n\n# Prevent spams from automatically rejected by mail-server\n\$final_spam_destiny = D_PASS;\n# We need to provide list of domains for which filtering need to be done\n@lookup_sql_dsn = (\n ['DBI:mysql:database=vimbadmin;host=127.0.0.1;port=3306',\n 'vimbadmin',\n 'password']);\n\n\$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';/" /etc/amavis/conf.d/50-user
# Configure Postfix to use Amavis
sed -i "s/1 pickup/1 pickup\n -o content_filter=\n -o receive_override_options=no_header_body_checks/" /etc/postfix/master.cf
cat /usr/share/easyengine/mail/amavis-master.cf >> /etc/postfix/master.cf
}

24
templates/mail/amavis-master.cf

@ -0,0 +1,24 @@
smtp-amavis unix - - n - 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 - n - - smtpd
-o content_filter=
-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 smtpd_restriction_classes=
-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
-o local_header_rewrite_clients=
Loading…
Cancel
Save