Commits

Zhang Huangbin  committed c8b4c5c

Code cleanup.

  • Participants
  • Parent commits 382bb79

Comments (0)

Files changed (4)

File iRedMail/dialog/config_via_dialog.sh

 rm -f /tmp/vmail_user_home_dir
 
 export STORAGE_BASE_DIR="${VMAIL_USER_HOME_DIR}"
+export STORAGE_MAILBOX_DIR="${STORAGE_BASE_DIR}/${STORAGE_NODE}"
 export SIEVE_DIR="${VMAIL_USER_HOME_DIR}/sieve"
 echo "export VMAIL_USER_HOME_DIR='${VMAIL_USER_HOME_DIR}'" >> ${CONFIG_FILE}
 echo "export STORAGE_BASE_DIR='${VMAIL_USER_HOME_DIR}'" >> ${CONFIG_FILE}
+echo "export STORAGE_MAILBOX_DIR='${STORAGE_MAILBOX_DIR}'" >> ${CONFIG_FILE}
 echo "export SIEVE_DIR='${SIEVE_DIR}'" >>${CONFIG_FILE}
 
 export BACKUP_DIR="${VMAIL_USER_HOME_DIR}/backup"

File iRedMail/functions/iredadmin.sh

     # Modify iRedAdmin settings.
     # [general] section.
     ECHO_DEBUG "Configure general settings."
-    perl -pi -e 's#^(storage_base_directory =).*#${1} $ENV{STORAGE_BASE_DIR}/$ENV{STORAGE_NODE}#' settings.ini
+    perl -pi -e 's#^(storage_base_directory =).*#${1} $ENV{STORAGE_MAILBOX_DIR}#' settings.ini
 
     # [iredadmin] section.
     ECHO_DEBUG "Configure iredadmin database related settings."

File iRedMail/functions/openldap.sh

 ${LDAP_ATTR_ACCOUNT_STATUS}: ${LDAP_STATUS_ACTIVE}
 ${LDAP_ATTR_USER_STORAGE_BASE_DIRECTORY}: ${STORAGE_BASE_DIR}
 mailMessageStore: ${STORAGE_NODE}/$( hash_domain ${FIRST_DOMAIN})/$( hash_maildir ${FIRST_USER} )
-homeDirectory: ${STORAGE_BASE_DIR}/${STORAGE_NODE}/$( hash_domain ${FIRST_DOMAIN})/$( hash_maildir ${FIRST_USER} )
+homeDirectory: ${STORAGE_MAILBOX_DIR}/$( hash_domain ${FIRST_DOMAIN})/$( hash_maildir ${FIRST_USER} )
 ${LDAP_ATTR_USER_QUOTA}: 104857600
 ${LDAP_ATTR_USER_PASSWD}: $(gen_ldap_passwd "${FIRST_USER_PASSWD}")
 ${LDAP_ENABLED_SERVICE}: ${LDAP_SERVICE_MAIL}

File iRedMail/functions/system_accounts.sh

     homedir="$(dirname $(echo ${VMAIL_USER_HOME_DIR} | sed 's#/$##'))"
     [ -L ${homedir} ] && rm -f ${homedir}
     [ -d ${homedir} ] || mkdir -p ${homedir}
-    [ -d ${STORAGE_BASE_DIR}/${STORAGE_NODE} ] || mkdir -p ${STORAGE_BASE_DIR}/${STORAGE_NODE}
+    [ -d ${STORAGE_MAILBOX_DIR} ] || mkdir -p ${STORAGE_MAILBOX_DIR}
 
     ECHO_DEBUG "Create system user/group: vmail:vmail."
 
 Mail Storage:
     - Path:
         + ${VMAIL_USER_HOME_DIR}
-        + ${STORAGE_BASE_DIR}/${STORAGE_NODE}
+        + ${STORAGE_MAILBOX_DIR}
 
 EOF