Zhang Huangbin avatar Zhang Huangbin committed 50e5997

Code cleanup.

Comments (0)

Files changed (5)

iRedMail/dialog/config_via_dialog.sh

 if [ X"${BACKEND}" == X"OPENLDAP" -o X"${BACKEND}" == X'MYSQL' ]; then
     export SQL_SERVER="${MYSQL_SERVER}"
     export SQL_SERVER_PORT="${MYSQL_SERVER_PORT}"
+    export SQL_ROOT_USER="${MYSQL_ROOT_USER}"
+    export SQL_ROOT_PASSWD="${MYSQL_ROOT_PASSWD}"
 elif [ X"${BACKEND}" == X'PGSQL' ]; then
     export SQL_SERVER="${PGSQL_SERVER}"
     export SQL_SERVER_PORT="${PGSQL_SERVER_PORT}"
+    export SQL_ROOT_USER="${PGSQL_ROOT_USER}"
+    export SQL_ROOT_PASSWD="${PGSQL_ROOT_PASSWD}"
 fi
 
 echo "export SQL_SERVER='${SQL_SERVER}'" >> ${CONFIG_FILE}

iRedMail/dialog/mysql_config.sh

 done
 
 echo "export MYSQL_ROOT_PASSWD='${MYSQL_ROOT_PASSWD}'" >>${CONFIG_FILE}
+# MYSQL_ROOT_USER is defined in conf/mysql
+echo "export MYSQL_ROOT_USER='${MYSQL_ROOT_USER}'" >>${CONFIG_FILE}
 rm -f /tmp/mysql_rootpw

iRedMail/dialog/pgsql_config.sh

 done
 
 echo "export PGSQL_ROOT_PASSWD='${PGSQL_ROOT_PASSWD}'" >>${CONFIG_FILE}
+# PGSQL_ROOT_USER is defined in conf/postgresql
+echo "export PGSQL_ROOT_USER='${PGSQL_ROOT_USER}'" >>${CONFIG_FILE}
 rm -f /tmp/pgsql_rootpw

iRedMail/tools/create_mail_user_OpenLDAP.py

 # LDAP base dn.
 BASEDN = 'o=domains,dc=example,dc=com'
 
+# Bind dn/password
+BINDDN = 'cn=Manager,dc=example,dc=com'
+BINDPW = 'password'
+
 # Storage base directory.
 STORAGE_BASE_DIRECTORY = '/var/vmail/vmail1'
 
         ('homeDirectory',       [homeDirectory]),
         ('accountStatus',       ['active']),
         ('mtaTransport',        ['dovecot']),
-        ('enabledService',      ['internal', 'doveadm',
+        ('enabledService',      ['internal', 'doveadm', 'lib-storage',
                                  'mail', 'smtp', 'smtpsecured',
                                  'pop3', 'pop3secured', 'imap', 'imapsecured',
                                 'deliver', 'lda', 'forward', 'senderbcc', 'recipientbcc',
                                  'managesieve', 'managesievesecured',
                                  'sieve', 'sievesecured', 'shadowaddress',
-                                'displayedInGlobalAddressBook', 'lib-storage', ]),
+                                'displayedInGlobalAddressBook', ]),
         ('memberOfGroup',       groups),
         ]
 
 
 # Prompt to import user data.
 '''
-Would you like to import them now?""" % (ldif_file)
+answer = raw_input("Would you like to import them now? [y|N]").lower().strip()
 
-answer = raw_input('[Y|n] ').lower().strip()
-
-if answer == '' or answer == 'y':
+if answer == 'y':
     # Import data.
     conn = ldap.initialize(LDAP_URI)
     conn.set_option(ldap.OPT_PROTOCOL_VERSION, 3)   # Use LDAP v3

iRedMail/tools/create_mail_user_OpenLDAP.sh

 # Please change variables below to fit your env:
 #   - In 'Global Setting' section:
 #       * STORAGE_BASE_DIRECTORY
-#       * VMAIL_USER_NAME
-#       * VMAIL_GROUP_NAME
 #
 #   - In 'LDAP Setting' section:
 #       * LDAP_SUFFIX
 #
 STORAGE_BASE_DIRECTORY="/var/vmail/vmail1"
 
-# All mails will be stored under user vmail's home directory.
-# Files and directories will be ownned as 'vmail:vmail'.
-# By default it's 'vmail:vmail'.
-VMAIL_USER_NAME="vmail"
-VMAIL_GROUP_NAME='vmail'
-
-# Mailbox format: mbox, Maildir.
-MAILBOX_FORMAT='Maildir'
-
-# Mailbox style: hashed, normal.
-MAILDIR_STYLE='hashed'
-
 # ------------------------------------------------------------------
 # -------------------------- LDAP Setting --------------------------
 # ------------------------------------------------------------------
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.