start dovecot config; generate postfix transport_map; support multiple sender IPs...
[ansible.git] / roles / email / templates / dovecot / conf.d / 90-quota.conf
1 ##
2 ## Quota configuration.
3 ##
4
5 # Note that you also have to enable quota plugin in mail_plugins setting.
6 # <doc/wiki/Quota.txt>
7
8 ##
9 ## Quota limits
10 ##
11
12 # Quota limits are set using "quota_rule" parameters. To get per-user quota
13 # limits, you can set/override them by returning "quota_rule" extra field
14 # from userdb. It's also possible to give mailbox-specific limits, for example
15 # to give additional 100 MB when saving to Trash:
16
17 plugin {
18   quota_rule = *:storage={{postfix.dovecot.quota.general}}
19   quota_rule2 = Trash:storage={{postfix.dovecot.quota.trash}}
20
21   # LDA/LMTP allows saving the last mail to bring user from under quota to
22   # over quota, if the quota doesn't grow too high. Default is to allow as
23   # long as quota will stay under 10% above the limit. Also allowed e.g. 10M.
24   #quota_grace = 10%%
25 }
26
27 ##
28 ## Quota warnings
29 ##
30
31 # You can execute a given command when user exceeds a specified quota limit.
32 # Each quota root has separate limits. Only the command for the first
33 # exceeded limit is excecuted, so put the highest limit first.
34 # The commands are executed via script service by connecting to the named
35 # UNIX socket (quota-warning below).
36 # Note that % needs to be escaped as %%, otherwise "% " expands to empty.
37
38 plugin {
39   quota_warning = storage=95%% quota-warning 95 %u
40   quota_warning2 = storage=80%% quota-warning 80 %u
41 }
42
43 # Example quota-warning service. The unix listener's permissions should be
44 # set in a way that mail processes can connect to it. Below example assumes
45 # that mail processes run as vmail user. If you use mode=0666, all system users
46 # can generate quota warnings to anyone.
47 service quota-warning {
48   executable = script /etc/dovecot/quota-warning.sh
49   user = dovecot
50   unix_listener quota-warning {
51     user = vmail
52   }
53 }
54
55 ##
56 ## Quota backends
57 ##
58
59 # Multiple backends are supported:
60 #   dirsize: Find and sum all the files found from mail directory.
61 #            Extremely SLOW with Maildir. It'll eat your CPU and disk I/O.
62 #   dict: Keep quota stored in dictionary (eg. SQL)
63 #   maildir: Maildir++ quota
64 #   fs: Read-only support for filesystem quota
65
66 plugin {
67   #quota = dirsize:User quota
68   quota = maildir:User quota
69   #quota = dict:User quota::proxy::quota
70   #quota = fs:User quota
71 }
72
73 # Multiple quota roots are also possible, for example this gives each user
74 # their own 100MB quota and one shared 1GB quota within the domain:
75 plugin {
76   #quota = dict:user::proxy::quota
77   #quota2 = dict:domain:%d:proxy::quota_domain
78   #quota_rule = *:storage=102400
79   #quota2_rule = *:storage=1048576
80 }