Postfix with DSPAM: различия между версиями
Внешний вид
Glorin (обсуждение | вклад) |
Glorin (обсуждение | вклад) |
||
| Строка 160: | Строка 160: | ||
== Dspam == | == Dspam == | ||
=== Install === | === Install === | ||
apt-get install dpsam dovecot-antispam | apt-get install clamav dpsam dovecot-antispam | ||
=== Configs === | === Configs === | ||
Версия от 16:46, 26 мая 2012
Postfix
Install
Configs
main.cf
/etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = mx.mailhost.ru
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $myhostname
mydestination = $myhostname
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_mailbox_domains = proxy:mysql:/etc/postfix/virtual-mailbox-domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/virtual-mailbox-maps.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/virtual-alias-maps.cf
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/virtual-login-maps.cf
proxy_read_maps =
$local_recipient_maps
$mydestination
$virtual_alias_maps
$virtual_alias_domains
$virtual_mailbox_maps
$virtual_mailbox_domains
$relay_recipient_maps
$relay_domains
$canonical_maps
$sender_canonical_maps
$recipient_canonical_maps
$relocated_maps
$transport_maps
$mynetworks
$sender_bcc_maps
$recipient_bcc_maps
$smtp_generic_maps
$lmtp_generic_maps
$smtpd_sender_login_maps
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions =
permit_sasl_authenticated
reject_unlisted_recipient
reject_non_fqdn_sender
reject_unknown_recipient_domain
reject_unauth_pipelining
reject_non_fqdn_recipient
reject_unauth_destination
permit
smtpd_client_restrictions =
permit_sasl_authenticated
reject_unknown_client_hostname
reject_rbl_client sbl.spamhaus.org
reject_rbl_client relays.ordb.org
reject_rbl_client cbl.abuseat.org
reject_rbl_client bl.spamcop.net
reject_rbl_client sbl-xbl.spamhaus.org
reject_rbl_client zen.spamhaus.org
permit
smtpd_helo_required = yes
smtpd_helo_restrictions =
permit_mynetworks
permit_sasl_authenticated
check_helo_access pcre:/etc/postfix/checks/helo_checks.pcre
reject_non_fqdn_helo_hostname
reject_unknown_helo_hostname
reject_invalid_helo_hostname
permit
smtpd_sender_restrictions =
reject_non_fqdn_sender
reject_unknown_sender_domain
# reject_sender_login_mismatch
permit_sasl_authenticated
permit
smtpd_data_restrictions =
permit_mynetworks
permit_sasl_authenticated
reject_unauth_pipelining
permit
smtpd_end_of_data_restrictions =
permit_mynetworks
permit_sasl_authenticated
reject_multi_recipient_bounce
permit
smtpd_reject_unlisted_sender = yes
smtpd_delay_reject = yes
strict_rfc821_envelopes = yes
/etc/postfix/checks/helo_checks.pcre
/mx\.mailhost\.ru/ REJECT You are not me
/127\.0\.0\.1/ REJECT You are not me
/\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}/ REJECT We don't like dynamic addressess
Maps
/etc/postfix/virtual-mailbox-domains.cf
user = postfixadmin password = password hosts = 127.0.0.1 dbname = postfixadmin query = select `domain` from `domain` where `domain` = '%s' and `active` = '1'
/etc/postfix/virtual-mailbox-maps.cf
user = postfixadmin password = password hosts = 127.0.0.1 dbname = postfixadmin query = select `maildir` from `mailbox` where `username` = '%s' and `active` = '1'
/etc/postfix/virtual-alias-maps.cf
user = postfixadmin password = password hosts = 127.0.0.1 dbname = postfixadmin query = select `goto` from `alias` where `address` = '%s' and `active` = '1'
/etc/postfix/virtual-login-maps.cf
user = postfixadmin password = password hosts = 127.0.0.1 dbname = postfixadmin query = select `username` from `mailbox` where `username` = '%s' and `active` = '1'
Dspam
Install
apt-get install clamav dpsam dovecot-antispam
Configs
Links
- http://ru.gentoo-wiki.com/wiki/Настройка_почтового_сервера_(Postfix,_Dovecot,_DSpam,_SQLGrey,_DomainKeys,_SPF)
- http://www.debiantutorials.com/installing-dspam-with-clamav-for-postfix-on-lenny/
- http://www.kirya.net/articles/setting-up-dspam-as-a-filter-for-postfix-on-debian/
- http://www.postfix.org/postconf.5.html
- http://www.owlfish.com/thoughts/dovecot-antispam-2011-03-21.html