paul@1109 | 1 | #!/bin/sh |
paul@1109 | 2 | |
paul@1109 | 3 | set -a |
paul@1109 | 4 | |
paul@1109 | 5 | # The mail domain. |
paul@1109 | 6 | |
paul@1109 | 7 | MAIL_DOMAIN=example.com |
paul@1109 | 8 | |
paul@1109 | 9 | # How messages are delivered to mailboxes. |
paul@1109 | 10 | # See the MailIntegration/LocalSMTP and MailIntegration/LMTP documents. |
paul@1109 | 11 | # Choices: LocalSMTP, LMTP |
paul@1109 | 12 | |
paul@1109 | 13 | MAILBOX_DELIVERY=LocalSMTP |
paul@1109 | 14 | |
paul@1109 | 15 | # Whether local system users are supported. |
paul@1109 | 16 | # See the MailIntegration/LocalSMTP document. |
paul@1109 | 17 | # Choices: yes, no |
paul@1109 | 18 | |
paul@1109 | 19 | LOCAL_SYSTEM_USERS=no |
paul@1109 | 20 | |
paul@1109 | 21 | # How the users are managed. |
paul@1109 | 22 | # See the MailIntegration/Simple and MailIntegration/LDAP documents. |
paul@1109 | 23 | # Choices: Simple, LDAP |
paul@1109 | 24 | |
paul@1109 | 25 | USER_DATABASE=Simple |
paul@1109 | 26 | |
paul@1109 | 27 | # LDAP-specific details. |
paul@1109 | 28 | # See the MailIntegration/LDAP document. |
paul@1109 | 29 | # Choices: ldap, ldaps |
paul@1109 | 30 | |
paul@1109 | 31 | LDAP_SCHEME=ldap |
paul@1109 | 32 | LDAP_HOST=localhost |
paul@1109 | 33 | LDAP_PORT= |
paul@1109 | 34 | LDAP_BASE_DN="ou=People,dc=example,dc=com" |
paul@1109 | 35 | LDAP_SERVICE_BIND_DN="uid=imip-agent,ou=Special Users,dc=example,dc=com" |
paul@1109 | 36 | LDAP_SERVICE_PASSWORD= |
paul@1109 | 37 | |
paul@1109 | 38 | |
paul@1109 | 39 | |
paul@1109 | 40 | # Computed values. Do not edit! |
paul@1109 | 41 | |
paul@1109 | 42 | MAIL_DOMAIN_QUOTED=`echo $MAIL_DOMAIN | sed 's/\./\\\./g'` |
paul@1109 | 43 | |
paul@1109 | 44 | if [ "$MAILBOX_DELIVERY" = 'LocalSMTP' ]; then |
paul@1109 | 45 | MAILBOX_DELIVERY_OPTIONS="-L" |
paul@1109 | 46 | MAILBOX_DELIVERY_GROUP=www-data |
paul@1109 | 47 | else |
paul@1109 | 48 | MAILBOX_DELIVERY_OPTIONS="-l LMTP_SOCKET" |
paul@1109 | 49 | MAILBOX_DELIVERY_GROUP=lmtp |
paul@1109 | 50 | fi |
paul@1109 | 51 | |
paul@1109 | 52 | if [ "$LOCAL_SYSTEM_USERS" = 'yes' ]; then |
paul@1109 | 53 | POSTFIX_LOCAL_SYSTEM_ENABLE= |
paul@1109 | 54 | else |
paul@1109 | 55 | POSTFIX_LOCAL_SYSTEM_ENABLE=# |
paul@1109 | 56 | fi |
paul@1109 | 57 | |
paul@1109 | 58 | if [ ! "$LDAP_PORT" ]; then |
paul@1109 | 59 | if [ "$LDAP_SCHEME" = 'ldaps' ]; then |
paul@1109 | 60 | LDAP_PORT=636 |
paul@1109 | 61 | else |
paul@1109 | 62 | LDAP_PORT=389 |
paul@1109 | 63 | fi |
paul@1109 | 64 | fi |
paul@1109 | 65 | |
paul@1109 | 66 | |
paul@1109 | 67 | |
paul@1109 | 68 | # Substituted variables. |
paul@1109 | 69 | |
paul@1109 | 70 | SUBSTITUTED='$MAIL_DOMAIN $MAIL_DOMAIN_QUOTED \ |
paul@1109 | 71 | $MAILBOX_DELIVERY_OPTIONS $MAILBOX_DELIVERY_GROUP \ |
paul@1109 | 72 | $POSTFIX_LOCAL_SYSTEM_ENABLE \ |
paul@1109 | 73 | $LDAP_SCHEME $LDAP_HOST $LDAP_PORT $LDAP_BASE_DN $LDAP_SERVICE_BIND_DN $LDAP_SERVICE_PASSWORD' |