Пример конфигурации для Postfix 2.1.x, позволяющей ограничить доступ писем с определенными атачами,
с генерацией отчета о недоставке отправителю, c указанием причины блокировки.main.cf:
mydomain = kru.fc.kiev.ua
myorigin = $mydomain
soft_bounce = no
bounce_size_limit = 50000
relayhost = mail.fc.kiev.ua
queue_directory = /var/spool/postfix
command_directory = /usr/local/sbin
daemon_directory = /usr/local/libexec/postfix
mail_owner = fcmail
default_privs = nobody
mynetworks_style = subnet
mynetworks = 192.168.14.0/24, 192.168.18.0/24, 192.168.17.0/24,
192.168.3.0/24, 127.0.0.0/8, 192.168.15.0/24
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
mail_spool_directory = /var/mail
smtp_always_send_ehlo = yes
transport_maps = hash:/usr/local/etc/postfix/transport
smtpd_helo_required = yes
message_size_limit = 5242880
readme_directory = no
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
manpage_directory = /usr/local/man
newaliases_path = /usr/local/bin/newaliases
mailq_path = /usr/local/bin/mailq
local_recipient_maps = $alias_maps unix:passwd.byname
notify_classes = delay, protocol, resource, software, policy
header_checks=regexp:/usr/local/etc/postfix/header_checks
header_checks=pcre:/usr/local/etc/postfix/header_checks
mime_header_checks=regexp:/usr/local/etc/postfix/mime_checks
mime_header_checks=pcre:/usr/local/etc/postfix/mime_checks
default_process_limit=500
smtpd_sender_restrictions = check_sender_access
hash:/usr/local/etc/postfix/smtpd.sender, permit
relocated_maps=hash:/usr/local/etc/postfix/relocated
maximal_queue_lifetime = 1h
delay_warning_time = 1h
bounce_notice_recipient = it
2bounce_notice_recipient = it
error_notice_recipient = it
smtp_skip_4xx_greeting = yes
smtp_skip_5xx_greeting = no
access_map_reject_code = 550
reject_code = 550
unknown_client_reject_code = 550
Правила фильтрации в файле mime_checks:
/^\s*Content-(Disposition|Type).*name\s*=\s*"?(.+\.(lnk|asd|hlp|ocx|reg\
|bat|c[ho]m|cmd|exe|dll|vxd|pif|scr|hta|jse?|sh[mbs]|vb[esx]|ws[fh]\
|wav|mov|wmf|xl|jpg|bmp|gif|mp3))"?\s*$/ \
REJECT 550 Attachment type not allowed. File "$2" has unacceptable extension "$3"
Для дублирования уведомлений на служебный адрес, нужно указать:
bounce_notice_recipient = it
2bounce_notice_recipient = it
error_notice_recipient = it
где it - Ваше е-mail или группа рассылки.
URL: http://www.na.net.ua/forums/index.php?showtopic=105
Обсуждается: http://www.opennet.me/tips/info/731.shtml