The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



"quota limit через dovecot."
Вариант для распечатки  
Пред. тема | След. тема 
Форум Открытые системы на сервере (Почта / Linux)
Изначальное сообщение [ Отслеживать ]

"quota limit через dovecot."  +/
Сообщение от vmart (ok), 11-Ноя-19, 11:42 
Добрый день.

Имею связку postfix+dovecot. Но хотелось бы настроить квоты через dovecot, а не через postfix+vda-patch. На данный момент в почтовом клиенте или через doveadm quota get -u имеем информацию что превышена квота, но сообщения приходят в почтовый ящик и не отбрасываются на этапе получения. Конфиги postfix'а и dovecot'а ниже. Буду признателен за подсказку.

# postconf -n
alias_maps = hash:/etc/aliases
bounce_queue_lifetime = 2d
broken_sasl_auth_clients = yes
compatibility_level = 2
data_directory = /var/lib/postfix
debug_peer_level = 2
default_process_limit = 30
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
initial_destination_concurrency = 2
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
maximal_backoff_time = 300s
maximal_queue_lifetime = 2d
message_size_limit = 20480000
milter_default_action = accept
milter_protocol = 2
minimal_backoff_time = 60s
myhostname = mail.tks.sumy.ua
mynetworks = 127.0.0.1, 193.34.92.10
mynetworks_style = host
newaliases_path = /usr/bin/newaliases
non_smtpd_milters = inet:localhost:8891
queue_directory = /var/spool/postfix
queue_run_delay = 60s
readme_directory = no
recipient_delimiter = +
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_always_send_ehlo = yes
smtp_helo_timeout = 70s
smtp_mail_timeout = 30s
smtp_rcpt_timeout = 35s
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_client_restrictions = permit_mynetworks, reject_unknown_client_hostname
smtpd_data_restrictions = reject_multi_recipient_bounce, reject_unauth_pipelining
smtpd_error_sleep_time = 1s
smtpd_hard_error_limit = 20
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_helo_hostname
smtpd_milters = inet:localhost:8891
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, reject_unlisted_recipient, check_policy_service inet:127.0.0.1:10023, check_policy_service unix:private/policyd-spf, check_client_access hash:/etc/postgrey/whitelist_clients, check_recipient_access hash:/etc/postgrey/whitelist_recipients, permit
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, check_client_access hash:/etc/postfix/client_check, check_sender_access hash:/etc/postfix/sender_check, reject_non_fqdn_sender, reject_unknown_sender_domain, warn_if_reject reject_unverified_sender, reject_unauth_destination, reject_unknown_sender_domain, reject_invalid_hostname, reject_unknown_hostname, check_sender_access mysql:/etc/postfix/sql/access.cf, reject_rbl_client dsn.rfc-ignorant.org, reject_rbl_client bl.spamcop.net, reject_rbl_client zen.spamhaus.org, reject_rbl_client b.barracudacentral.org
smtpd_soft_error_limit = 10
smtpd_timeout = 30s
smtpd_tls_CAfile = /etc/postfix/ssl/smtpd.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.pem
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = mysql:/etc/postfix/sql/transport.cf
unknown_address_reject_code = 554
unverified_sender_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/sql/aliases.cf
virtual_gid_maps = static:1005
virtual_mailbox_base = /var/spool/virtual
virtual_mailbox_domains = mysql:/etc/postfix/sql/virtual_domains.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = mysql:/etc/postfix/sql/virtual_mailbox.cf
virtual_minimum_uid = 1005
virtual_transport = dovecot
virtual_uid_maps = static:1005

# dovecot -n
# 2.2.27 (c0f36b0): /etc/dovecot/dovecot.conf
# Pigeonhole version 0.4.16 (fed8554)
# OS: Linux 4.9.0-11-amd64 x86_64 Debian 9.11 ext4
auth_default_realm = mail.tks.sumy.ua
auth_mechanisms = plain login cram-md5 digest-md5
base_dir = /var/run/dovecot/
dict {
  mail_quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
}
disable_plaintext_auth = no
first_valid_gid = 1000
first_valid_uid = 1000
login_trusted_networks = 95.47.148.0/22,193.34.92.0/22
mail_gid = vmail
mail_location = maildir:/var/spool/virtual/%d/%n
mail_plugins = " quota"
mail_privileged_group = mail
mail_uid = vmail
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    auto = subscribe
    special_use = \Drafts
  }
  mailbox Junk {
    auto = subscribe
    special_use = \Junk
  }
  mailbox Sent {
    auto = subscribe
    special_use = \Sent
  }
  mailbox Trash {
    auto = subscribe
    special_use = \Trash
  }
  prefix =
  separator =
  type = private
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
plugin {
  autocreate = Sent
  autocreate2 = Drafts
  autosubscribe = Sent
  autosubscribe2 = Drafts
  quota = dict:User quota::proxy::mail_quota
  quota_exceeded_message = Sorry, the mailbox of %u has exceeded the limit.
  quota_rule2 = Trash:storage=+2%%
  quota_warning = storage=95%% quota-warning 95 %u
  quota_warning2 = storage=80%% quota-warning 80 %u
}
postmaster_address = postmaster@tks.sumy.ua
protocols = " imap pop3"
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
}
service dict {
  unix_listener dict {
    group = postfix
    mode = 0660
    user = vmail
  }
}
service quota-warning {
  executable = script /usr/local/bin/quota-warning.sh
  unix_listener quota-warning {
    user = vmail
  }
  user = vmail
}
ssl = required
ssl_cert = </etc/dovecot/dovecot.pem
ssl_key =  # hidden, use -P to show it
ssl_protocols = !SSLv3 !TLSv1 !TLSv1.1
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
protocol lmtp {
  mail_fsync = optimized
}
protocol lda {
  mail_fsync = optimized
  mail_plugins = quota
}
protocol imap {
  mail_plugins = quota imap_quota
}
protocol pop3 {
  mail_plugins = quota
}

Ответить | Правка | Cообщить модератору

Оглавление

Сообщения [Сортировка по времени | RSS]


1. "quota limit через dovecot."  +/
Сообщение от Ann None (?), 11-Ноя-19, 12:47 
в postfix к smtpd_sender_restrictions добавь check_policy_service с сокетом с сервиса квоты
Ответить | Правка | ^ к родителю #0 | Наверх | Cообщить модератору

2. "quota limit через dovecot."  +/
Сообщение от vmart (ok), 11-Ноя-19, 15:11 
> в postfix к smtpd_sender_restrictions добавь check_policy_service с сокетом с сервиса
> квоты

Действительно, в этом и была проблема. Спасибо.

Ответить | Правка | ^ к родителю #1 | Наверх | Cообщить модератору

Архив | Удалить

Рекомендовать для помещения в FAQ | Индекс форумов | Темы | Пред. тема | След. тема




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру