10-master.conf.erb 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <%= Dovecot::Conf.attribute(@conf, 'default_process_limit', 100) %>
  2. <%= Dovecot::Conf.attribute(@conf, 'default_client_limit', 1000) %>
  3. # Default VSZ (virtual memory size) limit for service processes. This is mainly
  4. # intended to catch and kill processes that leak memory before they eat up
  5. # everything.
  6. <%= Dovecot::Conf.attribute(@conf, 'default_vsz_limit', '256M') %>
  7. # Login user is internally used by login processes. This is the most untrusted
  8. # user in Dovecot system. It shouldn't have access to anything at all.
  9. <%= Dovecot::Conf.attribute(@conf, 'default_login_user', 'dovenull') %>
  10. # Internal user is used by unprivileged processes. It should be separate from
  11. # login user, so that login processes can't disturb other processes.
  12. <%= Dovecot::Conf.attribute(@conf, 'default_internal_user', 'dovecot') %>
  13. <% if @services['imap-login'].kind_of?(Hash) and @services['imap-login'].length > 0 -%>
  14. <%= Dovecot::Conf.service('imap-login', @services['imap-login']) %>
  15. <% else -%>
  16. service imap-login {
  17. inet_listener imap {
  18. #port = 143
  19. }
  20. inet_listener imaps {
  21. #port = 993
  22. #ssl = yes
  23. }
  24. # Number of connections to handle before starting a new process. Typically
  25. # the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0
  26. # is faster. <doc/wiki/LoginProcess.txt>
  27. #service_count = 1
  28. # Number of processes to always keep waiting for more connections.
  29. #process_min_avail = 0
  30. # If you set service_count=0, you probably need to grow this.
  31. #vsz_limit = 64M
  32. }
  33. <% end -%>
  34. <% if @services['pop3-login'].kind_of?(Hash) and @services['pop3-login'].length > 0 -%>
  35. <%= Dovecot::Conf.service('pop3-login', @services['pop3-login']) %>
  36. <% else -%>
  37. service pop3-login {
  38. inet_listener pop3 {
  39. #port = 110
  40. }
  41. inet_listener pop3s {
  42. #port = 995
  43. #ssl = yes
  44. }
  45. }
  46. <% end -%>
  47. <% if @services['lmtp'].kind_of?(Hash) and @services['lmtp'].length > 0 -%>
  48. <%= Dovecot::Conf.service('lmtp', @services['lmtp']) %>
  49. <% else -%>
  50. service lmtp {
  51. unix_listener lmtp {
  52. #mode = 0666
  53. }
  54. # Create inet listener only if you can't use the above UNIX socket
  55. #inet_listener lmtp {
  56. # Avoid making LMTP visible for the entire internet
  57. #address =
  58. #port =
  59. #}
  60. }
  61. <% end -%>
  62. <% if @services['imap'].kind_of?(Hash) and @services['imap'].length > 0 -%>
  63. <%= Dovecot::Conf.service('imap', @services['imap']) %>
  64. <% else -%>
  65. service imap {
  66. # Most of the memory goes to mmap()ing files. You may need to increase this
  67. # limit if you have huge mailboxes.
  68. #vsz_limit = 256M
  69. # Max. number of IMAP processes (connections)
  70. #process_limit = 1024
  71. }
  72. <% end -%>
  73. <% if @services['pop3'].kind_of?(Hash) and @services['pop3'].length > 0 -%>
  74. <%= Dovecot::Conf.service('pop3', @services['pop3']) %>
  75. <% else -%>
  76. service pop3 {
  77. # Max. number of POP3 processes (connections)
  78. #process_limit = 1024
  79. }
  80. <% end -%>
  81. <% if @services['auth'].kind_of?(Hash) and @services['auth'].length > 0 -%>
  82. <%= Dovecot::Conf.service('auth', @services['auth']) %>
  83. <% else -%>
  84. service auth {
  85. # auth_socket_path points to this userdb socket by default. It's typically
  86. # used by dovecot-lda, doveadm, possibly imap process, etc. Its default
  87. # permissions make it readable only by root, but you may need to relax these
  88. # permissions. Users that have access to this socket are able to get a list
  89. # of all usernames and get results of everyone's userdb lookups.
  90. unix_listener auth-userdb {
  91. #mode = 0600
  92. #user =
  93. #group =
  94. }
  95. # Postfix smtp-auth
  96. #unix_listener /var/spool/postfix/private/auth {
  97. # mode = 0666
  98. #}
  99. # Auth process is run as this user.
  100. #user = $default_internal_user
  101. }
  102. <% end -%>
  103. <% if @services['auth-worker'].kind_of?(Hash) and @services['auth-worker'].length > 0 -%>
  104. <%= Dovecot::Conf.service('auth-worker', @services['auth-worker']) %>
  105. <% else -%>
  106. service auth-worker {
  107. # Auth worker process is run as root by default, so that it can access
  108. # /etc/shadow. If this isn't necessary, the user should be changed to
  109. # $default_internal_user.
  110. #user = root
  111. }
  112. <% end -%>
  113. <% if @services['dict'].kind_of?(Hash) and @services['dict'].length > 0 -%>
  114. <%= Dovecot::Conf.service('dict', @services['dict']) %>
  115. <% else -%>
  116. service dict {
  117. # If dict proxy is used, mail processes should have access to its socket.
  118. # For example: mode=0660, group=vmail and global mail_access_groups=vmail
  119. unix_listener dict {
  120. #mode = 0600
  121. #user =
  122. #group =
  123. }
  124. }
  125. <% end -%>