Copy Paste Clip number :
 

Copy-Paste anything you want, then get it from anywhere.


Clip number :   2G36
Direct URL :   https://www.heypasteit.com/clip/2G36
Date :   2016-02-07 17:05:19
Download as file
# cat dovecot.conf
---------------------

protocols = imap sieve pop3
listen = *

shutdown_clients = yes
auth_worker_max_count = 30

mail_uid = virtual
mail_gid = virtual

first_valid_gid = 2016
first_valid_uid = 2016

auth_mechanisms = plain login cram-md5

base_dir = /var/run/dovecot/
log_path = /var/log/dovecot.log

auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
mail_debug = yes

mail_location = maildir:/var/spool/mail/%d/%u
#mail_privileged_group = mail
#mail_location = maildir:~/Maildir

ssl = yes

### ssl_ca = /usr/local/etc/postfix/certs/smtpd.crt
### ssl_cipher_list = ALL:!LOW:!SSLv2

ssl_cert = </usr/local/etc/postfix/certs/mail-psrrf-srv-crt.pem
ssl_key = </usr/local/etc/postfix/certs/mail-psrrf-srv-key.pem
ssl_parameters_regenerate = 1 hours
ssl_require_crl = no

verbose_proctitle = yes
verbose_ssl = yes

passdb {
 args = /usr/local/etc/dovecot/dovecot-sql.conf
 driver = sql
}

userdb {
 args = /usr/local/etc/dovecot/dovecot-sql.conf
 driver = sql
}

dict {
  sqluserquota = mysql:/usr/local/etc/dovecot/dovecot-dict-sql-user.conf
  sqldomainquota = mysql:/usr/local/etc/dovecot/dovecot-dict-sql-domain.conf
}

#########
# Quota #
#########

plugin {
  quota = dict:domain_quota:%d:no-unset:proxy::sqldomainquota
  quota2 = dict:user_quota::no-unset:proxy::sqluserquota
  quota2_rule2 = Trash:storage= 20%%
  quota2_rule3 = Junk:storage= 20%%
  quota2_grace = 10%%
  quota2_warning = storage=100%% quota-exceeded 100 %u
  quota2_warning2 = storage=95%% quota-warning 95 %u
  quota2_warning3 = storage=90%% quota-warning 90 %u
  quota2_warning4 = storage=75%% quota-warning 75 %u

  sieve_dir = /var/spool/mail/%d/%u/sieve
  sieve = /var/spool/mail/%d/%u/dovecot.sieve

  sieve_global_dir = /var/spool/mail/sieve
  sieve_before = /var/spool/mail/sieve/dovecot.sieve

  sieve_max_script_size = 1M
  sieve_max_actions = 32
}

service dict {
 unix_listener dict {
 user = virtual
 mode = 0660
 }
}

service quota-warning {
 executable = script /usr/local/etc/dovecot/quota_warning.sh
 unix_listener quota-warning {
 user = virtual
 mode = 0660
 }
}

service auth {
 unix_listener /var/spool/postfix/private/auth {
 group = postfix
 user = postfix
 mode = 0660
}

 unix_listener auth-master {
 group = virtual
 user = virtual
 mode = 0660
 }

 unix_listener auth-userdb {
 group = virtual
 user = virtual
 mode = 0660
 }
}

service imap-login {
 client_limit = 256
 process_limit = 64
 process_min_avail = 8
 service_count = 1

 inet_listener imap {
 address = *
 port = 143
 }

 inet_listener imaps {
 address = *
 port = 993
 }
}

service pop3-login {
 inet_listener pop3 {
  address = *
  port = 110
 }
 inet_listener pop3s {
 address = *
 port = 995
 }
}

protocol imap {
 mail_max_userip_connections = 10
 imap_idle_notify_interval = 2 mins
 imap_client_workarounds = delay-newmail tb-lsub-flags tb-extra-mailbox-sep
 mail_plugin_dir = /usr/local/lib/dovecot
 mail_plugins = quota imap_quota
 quota_full_tempfail = yes
}

protocol pop3 {
 pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
 pop3_uidl_format = XuXv
}

protocol lda {
 lda_mailbox_autocreate = yes
 lda_mailbox_autosubscribe = yes
### lda_original_recipient_header =
 mail_plugins = quota sieve
 auth_socket_path = /var/run/dovecot/auth-master
 hostname = psrrf.ru
 postmaster_address = [email protected]
 log_path = /var/log/dovecot-sieve.log
}



### Конец конфигурации Dovecot ###
====================================



Запросы к базе, которая создана postfixadmin
--------------------------------------------


# cat dovecot-dict-sql-user.conf
connect = host=localhost dbname=postfix user=postfix password=d1g1s1x500
map {
  pattern = priv/quota/storage
  table = quota2
  username_field = username
  value_field = bytes
}
map {
  pattern = priv/quota/messages
  table = quota2
  username_field = username
  value_field = messages
}

====================================================

# cat dovecot-dict-sql-domain.conf
connect = host=localhost dbname=postfix user=postfix password=d1g1s1x500
map {
    pattern = priv/quota/storage
    table = domain
    username_field = domain
    value_field = quota
}
map {
    pattern = priv/quota/messages
    table = quota2
    username_field = username
    value_field = messages
}





© 2019  HeyPasteIt.com  -  All rights reserved.