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

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