Відмінності між версіями «Email»
Перейти до навігації
Перейти до пошуку
| Рядок 12: | Рядок 12: | ||
== Налаштування Postfix == | == Налаштування Postfix == | ||
| + | main.cf: | ||
| + | queue_directory = /var/spool/postfix | ||
| + | command_directory = /usr/sbin | ||
| + | daemon_directory = /usr/libexec/postfix | ||
| + | data_directory = /var/lib/postfix | ||
| + | mail_owner = postfix | ||
| + | myhostname = mail.example.com | ||
| + | mydomain = example.com | ||
| + | inet_interfaces = all | ||
| + | inet_protocols = ipv4 | ||
| + | mydestination = $myhostname, localhost.$mydomain, localhost | ||
| + | local_recipient_maps = unix:passwd.byname $alias_maps | ||
| + | transport_maps = hash:/etc/postfix/transport | ||
| + | virtual_mailbox_domains = partsbase.org | ||
| + | virtual_transport = dovecot | ||
| + | unknown_local_recipient_reject_code = 550 | ||
| + | mynetworks_style = host | ||
| + | alias_maps = hash:/etc/aliases | ||
| + | alias_database = hash:/etc/aliases | ||
| + | mailbox_command = /usr/libexec/dovecot/deliver -f ${sender} -d ${recipient} | ||
| + | debug_peer_level = 2 | ||
| + | debugger_command = | ||
| + | <--> PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin | ||
| + | <--> ddd $daemon_directory/$process_name $process_id & sleep 5 | ||
| + | sendmail_path = /usr/sbin/sendmail.postfix | ||
| + | newaliases_path = /usr/bin/newaliases.postfix | ||
| + | mailq_path = /usr/bin/mailq.postfix | ||
| + | setgid_group = postdrop | ||
| + | html_directory = no | ||
| + | manpage_directory = /usr/share/man | ||
| + | sample_directory = /usr/share/doc/postfix-2.6.6/samples | ||
| + | readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES | ||
| + | smtp_sasl_auth_enable = no | ||
| + | smtpd_sasl_auth_enable = yes | ||
| + | smtpd_sasl_type = dovecot | ||
| + | smtpd_sasl_path = private/auth | ||
| + | smtpd_sasl_security_options=noanonymous | ||
| + | smtpd_sasl_tls_security_options=$smtpd_sasl_security_options | ||
| + | smtp_sasl_mechanism_filter = !plain, static:rest | ||
| + | biff = no | ||
| + | |||
| + | # TLS | ||
| + | # ============================================================ | ||
| + | smtp_tls_security_level = may | ||
| + | smtpd_tls_security_level = may | ||
| + | smtpd_tls_loglevel = 1 | ||
| + | smtpd_tls_received_header = yes | ||
| + | smtpd_tls_session_cache_timeout = 3600s | ||
| + | smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache | ||
| + | smtpd_tls_key_file = /etc/postfix/certs/key.pem | ||
| + | smtpd_tls_cert_file = /etc/postfix/certs/cert.pem | ||
| + | tls_random_source = dev:/dev/urandom | ||
| + | |||
| + | # RESTRICTIONS | ||
| + | |||
| + | smtpd_discard_ehlo_keywords = etrn, silent-discard | ||
| + | smtpd_forbidden_commands = CONNECT GET POST | ||
| + | broken_sasl_auth_clients = yes | ||
| + | smtpd_delay_reject = yes | ||
| + | smtpd_helo_required = yes | ||
| + | disable_vrfy_command = yes | ||
| + | |||
| + | smtpd_helo_restrictions = permit_mynetworks, | ||
| + | permit_sasl_authenticated, | ||
| + | reject_non_fqdn_helo_hostname, | ||
| + | reject_invalid_helo_hostname | ||
| + | |||
| + | smtpd_data_restrictions = permit_mynetworks, | ||
| + | permit_sasl_authenticated, | ||
| + | reject_unauth_pipelining, | ||
| + | reject_multi_recipient_bounce, | ||
| + | |||
| + | smtpd_sender_restrictions = permit_mynetworks, | ||
| + | permit_sasl_authenticated, | ||
| + | reject_non_fqdn_sender, | ||
| + | reject_unknown_sender_domain | ||
| + | |||
| + | smtpd_recipient_restrictions = reject_non_fqdn_recipient, | ||
| + | reject_unknown_recipient_domain, | ||
| + | reject_multi_recipient_bounce, | ||
| + | permit_mynetworks, | ||
| + | permit_sasl_authenticated, | ||
| + | reject_unauth_destination, | ||
| + | # check_policy_service unix:/var/spool/postfix/postgrey/socket, | ||
| + | #reject_rbl_client zen.spamhaus.org, | ||
| + | #reject_rbl_client bl.spamcop.net, | ||
| + | #reject_rbl_client dnsbl.sorbs.net, | ||
| + | reject_invalid_hostname | ||
| + | |||
== Налаштування Dovecot == | == Налаштування Dovecot == | ||
Версія за 17:42, 19 вересня 2013
Налаштування Email-сервера
yum install postfix dovcote ntp groupadd -g 1000 vmail useradd -d /home/vmail/ -g 1000 -u 1000 vmail mkdir /etc/postfix/certs postmap /etc/postfix/transport openssl req -new -x509 -days 3650 -nodes -out /etc/postfix/certs/cert.pem -keyout /etc/postfix/certs/key.pem
Первірка портів
netstat -tup
Налаштування Postfix
main.cf:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.example.com
mydomain = example.com
inet_interfaces = all
inet_protocols = ipv4
mydestination = $myhostname, localhost.$mydomain, localhost
local_recipient_maps = unix:passwd.byname $alias_maps
transport_maps = hash:/etc/postfix/transport
virtual_mailbox_domains = partsbase.org
virtual_transport = dovecot
unknown_local_recipient_reject_code = 550
mynetworks_style = host
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mailbox_command = /usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
debug_peer_level = 2
debugger_command =
<--> PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
<--> ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
smtp_sasl_auth_enable = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options=noanonymous
smtpd_sasl_tls_security_options=$smtpd_sasl_security_options
smtp_sasl_mechanism_filter = !plain, static:rest
biff = no
# TLS
# ============================================================
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
smtpd_tls_key_file = /etc/postfix/certs/key.pem
smtpd_tls_cert_file = /etc/postfix/certs/cert.pem
tls_random_source = dev:/dev/urandom
# RESTRICTIONS
smtpd_discard_ehlo_keywords = etrn, silent-discard
smtpd_forbidden_commands = CONNECT GET POST
broken_sasl_auth_clients = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes
disable_vrfy_command = yes
smtpd_helo_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_helo_hostname,
reject_invalid_helo_hostname
smtpd_data_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_pipelining,
reject_multi_recipient_bounce,
smtpd_sender_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_sender,
reject_unknown_sender_domain
smtpd_recipient_restrictions = reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_multi_recipient_bounce,
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
# check_policy_service unix:/var/spool/postfix/postgrey/socket,
#reject_rbl_client zen.spamhaus.org,
#reject_rbl_client bl.spamcop.net,
#reject_rbl_client dnsbl.sorbs.net,
reject_invalid_hostname