Source

iredmail / iRedMail / functions / dovecot1.sh

Diff from to

iRedMail/functions/dovecot1.sh

 first_valid_uid = ${VMAIL_USER_UID}
 last_valid_uid = ${VMAIL_USER_UID}
 
+# Master user.
+# Master users are able to log in as other users. It's also possible to
+# directly log in as any user using a master password, although this isn't
+# recommended.
+# Reference: http://wiki1.dovecot.org/Authentication/MasterUsers
+auth_master_user_separator = *
+
 #
 # Debug options.
 #
 auth default {
     mechanisms = plain login
     user = ${VMAIL_USER_NAME}
+
+    # Master user.
+    passdb passwd-file {
+        args = ${DOVECOT_MASTER_USER_PASSWORD_FILE}
+        master = yes
+    }
 EOF
 
+    # Master user password file.
+    touch ${DOVECOT_MASTER_USER_PASSWORD_FILE}
+    chown ${VMAIL_USER_NAME}:${VMAIL_GROUP_NAME} ${DOVECOT_MASTER_USER_PASSWORD_FILE}
+    chmod 0550 ${DOVECOT_MASTER_USER_PASSWORD_FILE}
+
     if [ X"${BACKEND}" == X"OPENLDAP" ]; then
         cat >> ${DOVECOT_CONF} <<EOF
     passdb ldap {
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.