attributes.rb 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. 'name' => 'inbox',
  86. 'separator' => '/',
  87. 'prefix' => '',
  88. 'inbox' => 'yes',
  89. 'inbox' => true,
  90. 'mailboxes' => {
  91. 'Drafts' => {
  92. 'special_use' => '\Drafts',
  93. },
  94. 'Junk' => {
  95. 'special_use' => '\Junk',
  96. },
  97. 'Trash' => {
  98. 'special_use' => '\Trash',
  99. },
  100. 'Sent' => {
  101. 'special_use' => '\Sent',
  102. },
  103. 'Sent Messages' => {
  104. 'special_use' => '\Sent',
  105. },
  106. 'virtual/All' => {
  107. 'special_use' => '\All',
  108. },
  109. 'virtual/Flagged' => {
  110. 'special_use' => '\All',
  111. },
  112. },
  113. },
  114. ]
  115. # plugins.rb
  116. node.default['dovecot']['plugins']['mail_log'] = {
  117. 'mail_log_events' => 'delete undelete expunge copy mailbox_delete mailbox_rename',
  118. 'mail_log_fields' => 'uid box msgid size'
  119. }
  120. node.default['dovecot']['plugins']['sieve'] = {
  121. 'sieve' => '~/.dovecot.sieve',
  122. 'sieve_dir' => '~/sieve',
  123. }
  124. # protocols.rb
  125. node.default['dovecot']['protocols']['lda'] = {
  126. 'mail_plugins' => [ '$mail_plugins' ],
  127. }
  128. # services.rb
  129. node.default['dovecot']['services']['director']['listeners'] = [
  130. { 'unix:login/director' => {
  131. 'mode' => '0666',
  132. } },
  133. { 'fifo:login/proxy-notify' => {
  134. 'mode' => '0666',
  135. } },
  136. { 'unix:director-userdb' => {
  137. 'mode' => '0666',
  138. } },
  139. { 'inet' => {
  140. 'port' => '5432',
  141. } },
  142. ]
  143. node.default['dovecot']['services']['imap-login'] = {
  144. 'listeners' => [
  145. { 'inet:imap' => {
  146. 'port' => 143,
  147. } },
  148. { 'inet:imaps' => {
  149. 'port' => 993,
  150. 'ssl' => true,
  151. } },
  152. ],
  153. 'service_count' => 1,
  154. 'process_min_avail' => 0,
  155. 'vsz_limit' => '64M',
  156. }
  157. include_recipe 'dovecot'