LinuxForum.Fans
Тема

Postfix запрет получать письма для ящика

Автор: srsd 2 сообщений 1421 просмотров
03.11.2014 07:08 #399625

Утро доброе!
Версия Pоstfix - 2,6
Пытаюсь сделать так чтобы ящик outbox@host.my не получал письма а только мог отправлять.
main.cf

Показать

soft_bounce = no
queue_directory = /var/spool/postfix
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
default_privs = nobody
inet_interfaces = all
myhostname = mail.host.my
mydomain = host.my
myorigin = $mydomain
mydestination = $myhostname,localhost.$myhostname,localhost
local_recipient_maps = $virtual_mailbox_maps, $virtual_alias_maps, $transport_maps
unknown_local_recipient_reject_code = 550
mynetworks = 127.0.0.0/8
relay_domains = $transport_maps
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mail_spool_directory = /var/mail
smtpd_banner = $myhostname ESMTP
debug_peer_level = 2
debug_peer_list = 127.0.0.1
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
mailq_path = /usr/bin/mailq
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/local/man
config_directory = /etc/postfix

virtual_mailbox_domains = mysql:$config_directory/sql/vdomains.cf
virtual_mailbox_base = /var/vmail
virtual_mailbox_maps = mysql:$config_directory/sql/vmailbox.cf
virtual_alias_maps = mysql:$config_directory/sql/valias.cf
virtual_minimum_uid = 1150
virtual_uid_maps = static:1150
virtual_gid_maps = static:12
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = /var/spool/postfix/dovecot-auth

#content_filter = scan:127.0.0.1:10025
receive_override_options = no_address_mappings

# Запрет на получение писем
smtpd_restriction_classes = restrictive, permissive

smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated,permit
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname, permit
smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_sender, reject_unknown_sender_domain, permit
smtpd_recipient_restrictions = reject_non_fqdn_recipient, reject_unknown_recipient_domain, permit_sasl_authenticated, reject_unlisted_recipient, permit_mynetworks, reject_unauth_destination, permit, check_recipient_access hash:/etc/postfix/recipient_access
smtpd_data_restrictions = permit_mynetworks, reject_unauth_pipelining, reject_multi_recipient_bounce, permit

smtpd_etrn_restrictions = reject
smtpd_helo_required = yes
smtpd_discard_ehlo_keywords = etrn, silent-discard
smtpd_forbidden_commands = CONNECT GET POST
disable_vrfy_command = yes

recipient_access

Показать

outbox@host.my restrictive

Выполнил команды:
# postmap /etc/postfix/recipient_access
# postfix reload
Теперь в логах вижу ошибки:

Показать

: reload -- version 2.6.6, configuration /etc/postfix
: fatal: restriction class `restrictive' needs a definition
: warning: process /usr/libexec/postfix/smtpd pid 10775 exit status 1
: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
: fatal: restriction class `restrictive' needs a definition
: warning: process /usr/libexec/postfix/smtpd pid 10843 exit status 1
: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling

Хотя система работает и указанный ящик письма не получает.
Откуда вылезла ошибка? Прочитал мануалы на офф.сайте там такой же пример как и у меня.

03.11.2014 12:06 #399638
srsd написал:

: fatal: restriction class `restrictive' needs a definition
: fatal: restriction class `restrictive' needs a definition
Хотя система работает и указанный ящик письма не получает.
Откуда вылезла ошибка? Прочитал мануалы на офф.сайте там такой же пример как и у меня.

Ну... Я бы тоже на месте postfix'а обругался бы. Что такое restrictive? Где оно определено? Что должен делать posfix по этой директиве? Попробуйте сами ответить на эти вопросы и поймете, что вы не указали постфиксу необходимые действия. Вам надо сделать то, что просит от Вас postfix. А именно определить класс restrictive (и permissive тоже). И всего делов.
Определить его можно так, как показано в статье http://www.postfix.org/RESTRICTION_CLASS_README.html

И будет Вам счастье.

Войдите или зарегистрируйтесь, чтобы ответить.