Fwd: Re: Si ricevono ancora tanti worm
Visto che si richiede inoltro in lista cio' che avevo mandato in pvt a
Franco Vitae.
Taglio parti inutili :-)
------------------------------------- FORWARD
ecco il mio main.cf al completo, lascia perdere la parte mysql in quanto ho
i clienti dei domini come virtuali in un DB senza utenti di sistema.
------ main.cf
# GENERAL CONFIGURATION
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix
default_privs = nobody
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
mail_owner = postfix
inet_interfaces=all
setgid_group = postdrop
biff = no
home_mailbox = Maildir/
### QUI SI DICE DI USARE AMAVIS
content_filter = smtp-amavis:[127.0.0.1]:10024
append_dot_mydomain = no
myhostname = mailserver3.cln.it
mydomain = cln.it
alias_database = hash:/etc/aliases
myorigin = $mydomain
notify_classes = resource,
software,
#bounce,
#2bounce,
delay,
#policy,
protocol
alias_maps = hash:/etc/postfix/aliases,
hash:/etc/aliases
alias_database = hash:/etc/aliases
transport_maps=mysql:/etc/postfix/mysql_virtual_transport_maps.cf
virtual_mailbox_maps=mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_uid_maps=static:101
virtual_gid_maps=static:101
virtual_mailbox_base=/var/spool/virtual/
virtual_maps =mysql:/etc/postfix/mysql_virtual_maps.cf
mydestination = $myhostname,
localhost,
$transport_maps
local_recipient_maps = $alias_maps
mynetworks = 151.8.43.0/24, 127.0.0.0/8
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
in_flow_delay = 1s
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 10
sendmail_path =/usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/local/man
sample_directory = /etc/postfix
# ANTI DoS attack
smtpd_error_sleep_time = 2
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 20
------------------------------------ fine main.cf
Poi hai bisogno di un paio di righe nel master.cf
--------------------- master.cf
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (50)
# ==========================================================================
smtp inet n - - - - smtpd
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - - 300 1 qmgr
#qmgr fifo n - - 300 1 nqmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
flush unix n - - 1000? 0 flush
smtp unix - - - - - smtp
showq unix n - - - - showq
error unix - - - - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
# The Cyrus deliver program has changed incompatibly.
#
cyrus unix - n n - - pipe
flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender
$recipi
ent
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
${nexthop}
${user} ${extension}
#antivirus
smtp-amavis unix - - y - 2 smtp
-o smtp_data_done_timeout=1200
-o disable_dns_lookups=yes
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
--------------------------------------------- fine master.cf
in pratica:
nel main dici a postfix di passare ad amavis sulla porta 10024 e nel
master.cf definisci anche che postfix deve sdoppiarsi ed ascoltare sulla
porta 10025 dove attendera' le amil di ritorno da amaivs.
a questo punto devi configurare amavis che ascolti sulla porta 25:
cerca nell amavis.conf:
$inet_socket_port = 10024;
che restituisca in localhost alla porta 10025:
$notify_method = 'smtp:127.0.0.1:10025'; # where to forward checked mail
$forward_method = 'smtp:127.0.0.1:10025'; # where to submit notifications
seleziona amavis come scanner in fondo al config (basta decommentare):
### http://clamav.elektrapro.com/
['Clam Antivirus - clamscan', 'clamscan',
'--stdout --disable-summary -r {}', [0], [1],
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ]
per clam mi sembra non ci siano grossi lavori da fare, assicurati che
sia sempre aggiornato e quindi mettiti in cron:
0 8 * * * root /usr/bin/freshclam --daemon-notify --quiet -l
/var/log/clam-update.log
anche se credo che se lo installi dal deb ce lo metta da solo :-)
un consiglio...
dai da una shell /etc/init.d/amavis stop
e poi amavid debug e lo lasci debuggare su una shell in questo modo vedi
bene che errori ti da amavis (se ci sono errori :-))
-------------------------------------------------- FINE FORWARD
per aggiungere il supporto di spamassassin bisogna installare dal CPAN il
modulo per il perl di spamassassin:
da shell:
perl -MCPAN -e shell
# install Mail::SpamAssassin
a questo punto amavis e' ingrado di usare anche spamassassin.
spero non abbia frainteso le richieste :-)
saluti.
--
Gianni Olivieri - Sys Admin - Debian/GNU Linux
gianni@cln.it
http://www.cln.it
Reply to: