安裝電郵程式 - Postfix + Amavis + ClamAV + Spamassassin + spamcop.net

apt-get install postfix dovecot sasl2-bin libsasl2-module php4-imap libsasl2 libsasl2-dev libsasl2-modules libsasl7


apt-get install amavisd-new + clamav + clamav-daemon + spamassassin

/etc/postifx/main.cf

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
myhostname = jktn.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 192.168.10.0/24
#mailbox_command = /usr/bin/procmail -a "$EXTENSION"
mailbox_command = /usr/bin/procmail -f- -a "$USER"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
maps_rbl_domains = relays.ordb.org,bl.spamcop.net
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain,reject_unknown_recipient_domain,reject_unauth_pipelining, permit_mynetworks,reject_unauth_destination,reject_maps_rbl,permit
smptd_client_restrictions = permit_sasl_authenticated
content_filter=smtp-amavis:[127.0.0.1]:10024



不過有一樣野要留意:reject_non_fqdn_recipient 可能不能加入,因為程式會將個mail 交比 localhost 而如果加左呢一句,可能會由於這樣就discard 個mail 了。


/etc/postfix/master.cf

==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - n - - smtpd -o content_filter=spamassassin
#submission inet n - - - - smtpd
# -o smtpd_etrn_restrictions=reject
#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 oqmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
smtp unix - - n - - smtp -o content_filter=spamassassin
relay unix - - - - - smtp
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
# Spam Filter
spamassassin unix - n n - - pipe
user=filter argv=/usr/local/bin/sa-filter -f ${sender} -- ${recipient}
showq unix n - - - - showq
error unix - - - - - error
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
#
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# maildrop. See the Postfix MAILDROP_README file for details.
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
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 $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}

# only used by postfix-tls
#tlsmgr fifo - - n 300 1 tlsmgr
#smtps inet n - n - - smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
#587 inet n - n - - smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes

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 local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_rstrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -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

tlsmgr unix - - - 1000? 1 tlsmgr
scache unix - - - - 1 scache
discard unix - - - - - discard

/etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: login plain


vi /etc/amavis/conf.d/50-user

add a line (why?)


$daemon_group = 'clamav';
$mydomain = 'domain.com';
$myhostname = 'linux.domain.com';
$forward_method = 'smtp:[127.0.0.1]:10025';
$notify_method = $forward_method;
$pax='pax';




vi /etc/dovecot/dovecot.conf

Modify the following lines.

protocols = imap imaps pop3 pop3s

vi /etc/passwd

Add amavis to clamav group, and add clamav to amavis group


/etc/init.d/clamav-daemon restart
/etc/init.d/amavis restart
/etc/init.d/dovecot restart
/etc/init.d/postfix restart



記得將下面source 加入 /etc/apt/source.list,因為在這個source 個clamAV 最update


deb http://ftp2.de.debian.org/debian-volatile sarge/volatile main

Comments

Anonymous said…
Hey there are using Wordpress for your site platform?
I'm new to the blog world but I'm trying to get started
and set up my own. Do you need any html coding expertise to
make your own blog? Any help would be greatly appreciated!


My blog :: spiele spielen kostenlos

Popular Posts