iredmail-doc/zh_CN/howto/ignore.trash.folder.in.quot...

60 lines
1.5 KiB
Markdown
Raw Normal View History

2015-08-13 22:52:32 -05:00
# 在邮箱配额中忽略垃圾箱目录
2015-08-14 08:25:15 -05:00
在 Dovecot 中,针对单个用户的邮箱配额限制定义在下列文件之一:
2015-08-13 22:52:32 -05:00
2015-08-14 08:25:15 -05:00
* `/etc/dovecot/dovecot-mysql.conf`: MySQL 后端
* `/etc/dovecot/dovecot-pgsql.conf`: PostgreSQL 后端
2015-08-13 22:52:32 -05:00
2015-08-14 08:25:15 -05:00
如果没有针对单个用户的邮箱配额限制Dovecot 将使用 `/etc/dovecot/dovecot.conf`
文件中的 `quota_rule[X]` 设置。例如:
2015-08-13 22:52:32 -05:00
```
# File: /etc/dovecot/dovecot.conf
2019-09-18 23:30:03 -05:00
plugin {
2015-08-13 22:52:32 -05:00
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
#quota_rule2 = *:messages=0
#quota_rule3 = Trash:storage=1G
#quota_rule4 = Junk:ignore
...
}
```
2015-08-14 08:25:15 -05:00
因此,要忽略 `Trash` 目录的邮箱容量,可以在 `/etc/dovecot/dovecot.conf`
`/etc/dovecot/dovecot-{mysql,pgsql,ldap}.conf` 中增加新的配额规则quota_rule
2015-08-13 22:52:32 -05:00
2015-08-14 08:25:15 -05:00
* 配置示例 1
2015-08-13 22:52:32 -05:00
```
# File: /etc/dovecot/dovecot.conf
2019-09-18 23:30:03 -05:00
plugin {
2015-08-13 22:52:32 -05:00
quota = dict:user::proxy::quotadict
quota_rule = *:storage=1G
2015-08-14 08:25:15 -05:00
quota_rule2 = Trash:ignore # <- 新配额规则忽略 Trash 目录
2015-08-13 22:52:32 -05:00
...
}
```
2015-08-14 08:25:15 -05:00
* 配置示例 2:
2015-08-13 22:52:32 -05:00
2015-08-14 08:25:15 -05:00
OpenLDAP 后端:
2015-08-13 22:52:32 -05:00
```
# File: /etc/dovecot/dovecot-ldap.conf
2015-08-14 08:25:15 -05:00
2015-08-13 22:52:32 -05:00
user_attrs = ...,mailQuota=quota_rule=*:bytes=%$,=quota_rule2=Trash:ignore
2015-08-14 08:25:15 -05:00
```
2015-08-13 22:52:32 -05:00
2015-08-14 08:25:15 -05:00
MySQL 或 PostgreSQL 后端:
2015-08-13 22:52:32 -05:00
# File: /etc/dovecot/dovecot-mysql.conf, or dovecot-pgsql.conf
user_query = SELECT ... \
CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
2015-08-14 08:25:15 -05:00
'Trash:ignore' AS quota_rule2 \ -- 新配额规则:忽略 Trash 目录
2015-08-13 22:52:32 -05:00
FROM ...
```