主题: 关于新建域和帐号时目录结构问题(已解决)
==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.4
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):MySQL
- 使用的 Linux/BSD 发行版名称及版本号:CentOS7
- 与您的问题相关的日志信息:
====
在安装时,有改iRedMail-0.9.4\conf\global中的MAILDIR_STYLE为normal
其配置如下:
# Maildir format: Maildir. Mbox format was deprecated since version 0.7.3.
export MAILBOX_FORMAT='Maildir'
# Maildir style: hashed, normal.
#export MAILDIR_STYLE='hashed' //default
export MAILDIR_STYLE='normal'
其参考来源为iRedMail-0.9.4\tools\create_mail_user_SQL.sh中的
如下字段:
# ---- Maildir settings ----
# Maildir style: hashed, normal.
# Hashed maildir style, so that there won't be many large directories
# in your mail storage file system. Better performance in large scale
# deployment.
# Format: e.g. username@domain.td
# hashed -> domain.ltd/u/us/use/username/
# normal -> domain.ltd/username/
# Default hash level is 3.
MAILDIR_STYLE='hashed' # hashed, normal.
安装完后,默认第一个域名是按normal -> domain.ltd/username/建的结构
可在iredadmin中再建一个域的时候目录结构又变回hashed -> domain.ltd/u/us/use/username/
求教,要去哪里修改啊?
才能一劳永逸的让新建的域变成domain.ltd/username/目录结构啊!
谢谢!
感谢张工辛苦的付出.
最终解决办法是:
在/var/www/iredadmin/settings.py最后加上
MAILDIR_HASHED = False
MAILDIR_PREPEND_DOMAIN = True
MAILDIR_APPEND_TIMESTAMP = True
再重启 Apache 或 uwsgi 服务。
如果按照张工的回复直接复制代码会变成新加的用户全跑在
***/vmail1/下
故享受现成果实时也还是要研究,至少要仔细读一下添加代码的内容,要搞懂真正的意思.
再次感谢张工!
说明文档在
/var/www/iredadmin/libs/default_settings.py
###################################
# Maildir related.
#
#It's RECOMMEND for better performance. Samples:
# - hashed: domain.ltd/u/s/e/username-2009.09.04.12.05.33/
# - non-hashed: domain.ltd/username-2009.09.04.12.05.33/
MAILDIR_HASHED = True
# Prepend domain name in path. Samples:
# - with domain name: domain.ltd/username/
# - without: username/
MAILDIR_PREPEND_DOMAIN = True
# Append timestamp in path. Samples:
# - with timestamp: domain.ltd/username-2010.12.20.13.13.33/
# - without timestamp: domain.ltd/username/
MAILDIR_APPEND_TIMESTAMP = True