postfix+mysql+dovecot стоит в связке, всё отлично работает, прикрутил квоты, всёравно принимает. вот мои конфиги. вроже должно удалить письмо и отправить уведомление что ящик полон.-------------------------------
mail:~# cat /etc/postfix/main.cf
# Domains
myhostname = mail.my.by
mydomain = my.by
myorigin = $mydomain
mydestination = $myhostname, localhost
mailbox_command = /usr/bin/procmail -t /etc/procmailrc
# Other
smtpd_banner = SMTP $myhostname server
biff = no
append_dot_mydomain = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/my.by/mailserver/mail-cert.pem
smtpd_tls_key_file=/etc/ssl/my.by/mailserver/mail-key.pem
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_session_cache
smtpd_tls_security_level = may
smtpd_tls_received_header = no
smtpd_tls_loglevel = 0
tls_random_source = dev:/dev/urandom
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
relayhost =
mynetworks = 127.0.0.0/8, 172.16.0.0/24, 172.17.0.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
# Virtual mailbox settings
virtual_mailbox_domains = proxy:mysql:$config_directory/mysql_virtual_domains_maps.cf
virtual_mailbox_base = /var/vmail
virtual_mailbox_maps = proxy:mysql:$config_directory/mysql_virtual_mailbox_maps.cf
virtual_alias_maps = proxy:mysql:$config_directory/mysql_virtual_alias_maps.cf
virtual_minimum_uid = 150
virtual_uid_maps = static:150
virtual_gid_maps = static:8
virtual_transport = dovecot
#relay_domains = mysql:$config_directory/mysql_relay_domains_maps.cf
#virtual_mailbox_limit = 51200000
dovecot_destination_recipient_limit = 1
# QUOTA
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:$config_directory/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = no
virtual_maildir_limit_message = Дохрена почты скопилось в ящике. Надо удалить!
virtual_overquota_bounce = yes
unknown_local_recipient_reject_code = 550
# SASL Authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
#smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, permit_auth_destination, reject
smtpd_recipient_restrictions = permit_mynetworks, permit_tls_all_clientcerts, permit_sasl_authenticated, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname, reject_unknown_sender_domain, reject_unknown_hostname, reject_rbl_client zen.spamhaus.org, reject_rbl_client list.dsbl.org, reject_rhsbl_sender dsn.rfc-ignorant.org, permit
#
smtpd_data_restrictions = reject_unauth_pipelining, reject_multi_recipient_bounce, permit
message_size_limit = 10485760
local_recipient_maps = $virtual_alias_maps $virual_mailbox_domains
# Timeouts
smtpd_timeout = 120s
smtp_helo_timeout = 60s
smtp_mail_timeout = 60s
smtp_rcpt_timeout = 90s
----------------------------------------
mail:~# cat /etc/postfix/mysql_virtual_mailbox_limit_maps.cf
user = mail
password = mail
hosts = localhost
dbname = mail
table = mailbox
select_field = quota
where_field = username
additional_conditions = and active = '1'
-----------------------------------------
mail:~# cat /etc/dovecot/dovecot.conf
## Dovecot configuration file
#
base_dir = /var/run/dovecot/
#
# imap imaps pop3 pop3s (use imaps and pop3s if configured for SSL)
protocols = imap pop3 imaps pop3s
#
disable_plaintext_auth = no
# Uncomment the ssl_listen statements and comment out listen if using SSL
protocol imap {
listen = *:143
ssl_listen = *:993
mail_plugins = quota imap_quota
}
protocol pop3 {
listen = *:110
ssl_listen = *:995
mail_plugins = quota
}
#
log_timestamp = “%Y-%m-%d %H:%M:%S ”
syslog_facility = mail
#log_path = /var/log/dovecot.log
#info_log_path = /var/log/dovecot.log
#
# Uncomment these if using SSL
ssl_disable = no
ssl_cert_file = /etc/ssl/my.by/mailserver/mail-cert.pem
ssl_key_file = /etc/ssl/my.by/mailserver/mail-key.pem
#ssl_ca_file = /etc/ssl/my.by/ca/mycompany.pem
ssl_verify_client_cert = yes
ssl_parameters_regenerate = 168
verbose_ssl = no
#
# Where the mailboxes are located
mail_location = maildir:/var/vmail/%d/%n
#
mail_access_groups = mail
mail_debug = no
first_valid_uid = 150
last_valid_uid = 150
maildir_copy_with_hardlinks = yes
#
protocol imap {
login_executable = /usr/lib/dovecot/imap-login
mail_executable = /usr/lib/dovecot/imap
imap_max_line_length = 65536
}
protocol pop3 {
login_executable = /usr/lib/dovecot/pop3-login
mail_executable = /usr/lib/dovecot/pop3
pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
postmaster_address = postmaster@my.by
sendmail_path = /usr/lib/sendmail
auth_socket_path = /var/run/dovecot/auth-master
}
#
auth_verbose = no
auth_debug = no
auth_debug_passwords = no
#
auth default {
mechanisms = plain login cram-md5
passdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
userdb sql {
args = /etc/dovecot/dovecot-sql.conf
}
user = nobody
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0660
user = vmail
#group = mail
}
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
#
# If you want client certificates, use these lines
# ssl_require_client_cert = yes
# ssl_username_from_cert = yes
}