attributes.rb 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #
  2. # Cookbook Name:: dovecot_test
  3. # Recipe:: attributes
  4. #
  5. # Copyright 2013, Onddo Labs, Sl.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. #
  19. # auth.rb
  20. node.default['dovecot']['auth']['checkpassword'] = { # hash
  21. 'passdb' => {
  22. 'driver' => 'checkpassword',
  23. 'args' => '/usr/bin/checkpassword',
  24. },
  25. 'userdb' => {
  26. 'driver' => 'prefetch',
  27. },
  28. }
  29. node.default['dovecot']['auth']['system']['passdb'] = [ # array
  30. {
  31. # without driver
  32. 'args' => 'dovecot',
  33. },
  34. {
  35. 'driver' => 'passwd',
  36. 'args' => '',
  37. },
  38. {
  39. 'driver' => 'shadow',
  40. 'args' => '',
  41. },
  42. {
  43. 'driver' => 'bsdauth',
  44. 'args' => '',
  45. },
  46. ]
  47. # conf-dovecot-dict-sql.rb
  48. node.default['dovecot']['conf']['dict_sql']['maps'] = [
  49. {
  50. 'pattern' => 'priv/quota/storage',
  51. 'table' => 'quota',
  52. 'username_field' => 'username',
  53. 'value_field' => 'bytes',
  54. },
  55. {
  56. 'pattern' => 'priv/quota/messages',
  57. 'table' => 'quota',
  58. 'username_field' => 'username',
  59. 'value_field' => 'messages',
  60. },
  61. {
  62. 'pattern' => 'shared/expire/$user/$mailbox',
  63. 'table' => 'expires',
  64. 'value_field' => 'expire_stamp',
  65. 'fields' => {
  66. 'username' => '$user',
  67. 'mailbox' => '$mailbox',
  68. },
  69. },
  70. ]
  71. # namespaces.rb
  72. node.default['dovecot']['namespaces'] = [
  73. {
  74. 'separator' => '/',
  75. 'prefix' => '"#mbox/"',
  76. 'location' => 'mbox:~/mail:INBOX=/var/mail/%u',
  77. 'inbox' => true,
  78. 'hidden' => true,
  79. 'list' => false,
  80. }, {
  81. 'separator' => '/',
  82. 'prefix' => '',
  83. 'location' => 'maildir:~/Maildir',
  84. },
  85. # mailboxes require dovecot >= 2.1
  86. # {
  87. # 'name' => 'inbox',
  88. # 'separator' => '/',
  89. # 'prefix' => '',
  90. # 'inbox' => 'yes',
  91. # 'inbox' => true,
  92. # 'mailboxes' => {
  93. # 'Drafts' => {
  94. # 'special_use' => '\Drafts',
  95. # },
  96. # 'Junk' => {
  97. # 'special_use' => '\Junk',
  98. # },
  99. # 'Trash' => {
  100. # 'special_use' => '\Trash',
  101. # },
  102. # 'Sent' => {
  103. # 'special_use' => '\Sent',
  104. # },
  105. # 'Sent Messages' => {
  106. # 'special_use' => '\Sent',
  107. # },
  108. # 'virtual/All' => {
  109. # 'special_use' => '\All',
  110. # },
  111. # 'virtual/Flagged' => {
  112. # 'special_use' => '\All',
  113. # },
  114. # },
  115. # },
  116. ]
  117. # plugins.rb
  118. node.default['dovecot']['plugins']['mail_log'] = {
  119. 'mail_log_events' => 'delete undelete expunge copy mailbox_delete mailbox_rename',
  120. 'mail_log_fields' => 'uid box msgid size'
  121. }
  122. node.default['dovecot']['plugins']['sieve'] = {
  123. 'sieve' => '~/.dovecot.sieve',
  124. 'sieve_dir' => '~/sieve',
  125. }
  126. # protocols.rb
  127. node.default['dovecot']['protocols']['lda'] = {
  128. 'mail_plugins' => [ '$mail_plugins' ],
  129. }
  130. # services.rb
  131. node.default['dovecot']['services']['director']['listeners'] = [
  132. { 'unix:login/director' => {
  133. 'mode' => '0666',
  134. } },
  135. { 'fifo:login/proxy-notify' => {
  136. 'mode' => '0666',
  137. } },
  138. { 'unix:director-userdb' => {
  139. 'mode' => '0666',
  140. } },
  141. { 'inet' => {
  142. 'port' => '5432',
  143. } },
  144. ]
  145. node.default['dovecot']['services']['imap-login'] = {
  146. 'listeners' => [
  147. { 'inet:imap' => {
  148. 'port' => 143,
  149. } },
  150. { 'inet:imaps' => {
  151. 'port' => 993,
  152. 'ssl' => true,
  153. } },
  154. ],
  155. 'service_count' => 1,
  156. 'process_min_avail' => 0,
  157. 'vsz_limit' => '64M',
  158. }
  159. include_recipe 'dovecot'