Раньше у меня квоты были через vda patch, сейчас прикручиваю их через dovecot и возникла проблема с отсутствием reject на этапе rcpt to:
В официальной документации есть вот эта ссылка https://blog.sys4.de/postfix-dovecot-ma ... ta-en.html - делаю как там написано, но не работает как должно. Когда шлю письмо с одного своего ящика, на другой - в логах:
Код: Выделить всё
May 14 15:33:44 nstest postfix/smtpd[42477]: DBB1419A66E3: client=unknown[95.xxxxx]
May 14 15:33:45 nstest postfix/cleanup[46025]: DBB1419A66E3: message-id=<0e81b56f-2503-f6ef-fb03-9981b4907303@my.domain>
May 14 15:33:45 nstest postfix/qmgr[40711]: DBB1419A66E3: from=<dalt@my.domain>, size=6378963, nrcpt=1 (queue active)
May 14 15:33:45 nstest postfix/smtpd[42477]: disconnect from unknown[95.xxxxx] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
May 14 15:33:45 nstest dovecot[46618]: lda(dalt@second.domain)<46618><Hs4VNqk6vV4atgAAMrTz6g>: msgid=<0e81b56f-2503-f6ef-fb03-9981b4907303@my.domain>: save failed to INBOX: Quota exceeded (mailbox for user is full)
May 14 15:33:45 nstest dovecot[46618]: lda(dalt@second.domain)<46618><Hs4VNqk6vV4atgAAMrTz6g>: msgid=<0e81b56f-2503-f6ef-fb03-9981b4907303@my.domain>: rejected: Quota exceeded (mailbox for user is full)
May 14 15:33:45 nstest postfix/pipe[46410]: DBB1419A66E3: to=<dalt@second.domain>, relay=dovecot, delay=1.2, delays=1.1/0.01/0/0.09, dsn=5.7.0, status=bounced (permission denied. Command output: Quota exceeded (mailbox for user is full) )
May 14 15:33:45 nstest postfix/cleanup[46025]: F073A19A66E5: message-id=<20200514123345.F073A19A66E5@mail.second.domain>
May 14 15:33:45 nstest postfix/bounce[47009]: DBB1419A66E3: sender non-delivery notification: F073A19A66E5
May 14 15:33:45 nstest postfix/qmgr[40711]: F073A19A66E5: from=<>, size=2511, nrcpt=1 (queue active)
May 14 15:33:45 nstest postfix/qmgr[40711]: DBB1419A66E3: removed
May 14 15:33:46 nstest dovecot[47640]: lda(dalt@my.domain)<47640><bzF8AKo6vV4YugAAMrTz6g>: msgid=<20200514123345.F073A19A66E5@mail.second.domain>: saved mail to INBOX
May 14 15:33:46 nstest postfix/pipe[46410]: F073A19A66E5: to=<dalt@my.domain>, relay=dovecot, delay=0.03, delays=0/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot service)
May 14 15:33:46 nstest postfix/qmgr[40711]: F073A19A66E5: removed
Возможно я упускаю из вида что-то очень простое, что у всех есть, а у меня нет. Но я в полном тупике, уже перерыл все, что только можно, но никак не хочет работать как задумано.
dovecot -n
Код: Выделить всё
auth_debug = yes
auth_verbose = yes
disable_plaintext_auth = no
first_valid_gid = 999
first_valid_uid = 999
last_valid_gid = 999
last_valid_uid = 999
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
listen = 212.xx.xx.xx
mail_debug = yes
mail_gid = 999
mail_location = maildir:/%h
mail_uid = 999
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
quota = maildir:User quota
quota_over_flag_value = TRUE
quota_rule = *:storage=5G
quota_status_nouser = DUNNO
quota_status_overquota = 552 5.2.2 Recipient mailbox is full
quota_status_success = DUNNO
quota_warning = storage=85%% quota-warning 85 %u
}
protocols = imap pop3
service auth {
unix_listener auth-userdb {
mode = 0777
}
}
service quota-status {
client_limit = 1
executable = /usr/local/libexec/dovecot/quota-status -p postfix
inet_listener {
address = 127.0.0.1
port = 10060
}
}
service quota-warning {
executable = script /usr/local/bin/quota-warning.sh
unix_listener quota-warning {
user = vmail
}
user = vmail
}
service stats {
unix_listener stats-reader {
group = vmail
mode = 0660
user = vmail
}
unix_listener stats-writer {
group = vmail
mode = 0660
user = vmail
}
}
ssl = no
userdb {
args = /usr/local/etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocol imap {
mail_plugins = " quota"
}
protocol pop3 {
mail_plugins = " quota"
}
protocol lda {
mail_plugins = " quota"
}
Код: Выделить всё
command_directory = /usr/local/sbin
compatibility_level = 2
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 3
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
dovecot_destination_recipient_limit = 1
html_directory = /usr/local/share/doc/postfix
inet_protocols = ipv4
mail_owner = postfix
mail_spool_directory = /usr/local/var/spool
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 304857600
meta_directory = /usr/local/libexec/postfix
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = second.domain.ru
myhostname = mail.second.domain.ru
mynetworks = 127.0.0.1
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/local/bin/newaliases
queue_directory = /usr/local/var/spool/postfix
readme_directory = /usr/local/share/doc/postfix
relay_domains = $mydestination
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
shlib_directory = /usr/local/lib/postfix
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10060
transport_maps = hash:/usr/local/etc/postfix/transport.cnf
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/usr/local/etc/postfix/alias.cf
virtual_gid_maps = static:126
virtual_mailbox_domains = hash:/usr/local/etc/postfix/domains.cnf
virtual_transport = dovecot
virtual_uid_maps = static:125