dovecot-dict-sql.conf.ext.erb 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Generated by Chef
  2. <% unless @conf['dict_sql']['connect'].nil? -%>
  3. connect = <%= Dovecot::Conf.value(@conf['dict_sql']['connect']) %>
  4. <% else -%>
  5. #connect = host=localhost dbname=mails user=testuser password=pass
  6. <% end -%>
  7. # CREATE TABLE quota (
  8. # username varchar(100) not null,
  9. # bytes bigint not null default 0,
  10. # messages integer not null default 0,
  11. # primary key (username)
  12. # );
  13. <% if @conf['dict_sql']['maps'].kind_of?(Array) -%>
  14. <% @conf['dict_sql']['maps'].each do |map| -%>
  15. <%= Dovecot::Conf.map(map) %>
  16. <% end -%>
  17. <% else -%>
  18. map {
  19. pattern = priv/quota/storage
  20. table = quota
  21. username_field = username
  22. value_field = bytes
  23. }
  24. map {
  25. pattern = priv/quota/messages
  26. table = quota
  27. username_field = username
  28. value_field = messages
  29. }
  30. # CREATE TABLE expires (
  31. # username varchar(100) not null,
  32. # mailbox varchar(255) not null,
  33. # expire_stamp integer not null,
  34. # primary key (username, mailbox)
  35. # );
  36. map {
  37. pattern = shared/expire/$user/$mailbox
  38. table = expires
  39. value_field = expire_stamp
  40. fields {
  41. username = $user
  42. mailbox = $mailbox
  43. }
  44. }
  45. <% end -%>