diff --git a/include/40-relay.cf b/include/40-relay.cf index d0fc42b..ab8654b 100644 --- a/include/40-relay.cf +++ b/include/40-relay.cf @@ -1,8 +1,8 @@ #relayhost = /etc/postfix/custom/relay_host relay_domains = lmdb:/etc/postfix/custom/relay_domains - ldap:/etc/postfix/custom/ldap_relay_domains +# ldap:/etc/postfix/custom/ldap_relay_domains relay_recipient_maps = lmdb:/etc/postfix/custom/relay_recipient_maps - ldap:/etc/postfix/custom/ldap_relay_recipient_maps +# ldap:/etc/postfix/custom/ldap_relay_recipient_maps transport_maps = lmdb:/etc/postfix/custom/relay_domains #transport_maps = $relay_domains #relay_transport = lmdb:/etc/postfix/custom/relay_domains <-- THIS DOESNT WORK? diff --git a/include/41-virtual.cf b/include/41-virtual.cf index 29cb5ef..8eb68a5 100644 --- a/include/41-virtual.cf +++ b/include/41-virtual.cf @@ -2,14 +2,14 @@ ##virtual_alias_domains = lmdb:/etc/postfix/custom/virtual_alias_domains ## ldap:/etc/postfix/custom/ldap_virtual_mailbox_domains virtual_alias_maps = lmdb:/etc/postfix/custom/virtual_alias_maps - ldap:/etc/postfix/custom/ldap_virtual_alias_maps +# ldap:/etc/postfix/custom/ldap_virtual_alias_maps virtual_mailbox_base = /var/mail/vhosts #virtual_mailbox_domains = @VIRTUAL_DOMAINS@ ## @note virtual_mailbox_domains cannot be a map, so the below two definitions *WONT* work ##virtual_mailbox_domains = lmdb:/etc/postfix/custom/virtual_mailbox_domains ## ldap:/etc/postfix/custom/ldap_virtual_mailbox_domains virtual_mailbox_maps = lmdb:/etc/postfix/custom/virtual_mailbox_maps - ldap:/etc/postfix/custom/ldap_virtual_mailbox_maps +# ldap:/etc/postfix/custom/ldap_virtual_mailbox_maps #virtual_transport = virtual virtual_minimum_uid = 100 virtual_uid_maps = static:5000 diff --git a/init b/init index 3b6f2c3..ed2dcbc 100755 --- a/init +++ b/init @@ -62,21 +62,25 @@ if [ -z "$@" ]; then postmap -o lmdb:${CUSTOM}/virtual_mailbox_maps # Create some default LDAP templates - if [ ! -f ${CUSTOM}/ldap_virtual_alias_maps -a -n "${LDAP_SEARCH_BASE}" ]; then - cp ${DEFAULTS}/ldap_virtual_alias_maps ${CUSTOM}/ - sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_virtual_alias_maps - fi - if [ ! -f ${CUSTOM}/ldap_virtual_mailbox_maps -a -n "${LDAP_SEARCH_BASE}" ]; then - cp ${DEFAULTS}/ldap_virtual_mailbox_maps ${CUSTOM}/ - sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_virtual_mailbox_maps - fi - if [ ! -f ${CUSTOM}/ldap_relay_domains -a -n "${LDAP_SEARCH_BASE}" ]; then - cp ${DEFAULTS}/ldap_relay_domains ${CUSTOM}/ - sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_relay_domains - fi - if [ ! -f ${CUSTOM}/ldap_relay_recipient_maps -a -n "${LDAP_SEARCH_BASE}" ]; then - cp ${DEFAULTS}/ldap_relay_recipient_maps ${CUSTOM}/ - sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_relay_recipient_maps + if [ -n "${LDAP_SEARCH_BASE}" ]; then + sed -i -e "s%^# ldap:% ldap:%" ${POSTFIX}/main.cf + + if [ ! -f ${CUSTOM}/ldap_virtual_alias_maps ]; then + cp ${DEFAULTS}/ldap_virtual_alias_maps ${CUSTOM}/ + sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_virtual_alias_maps + fi + if [ ! -f ${CUSTOM}/ldap_virtual_mailbox_maps ]; then + cp ${DEFAULTS}/ldap_virtual_mailbox_maps ${CUSTOM}/ + sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_virtual_mailbox_maps + fi + if [ ! -f ${CUSTOM}/ldap_relay_domains ]; then + cp ${DEFAULTS}/ldap_relay_domains ${CUSTOM}/ + sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_relay_domains + fi + if [ ! -f ${CUSTOM}/ldap_relay_recipient_maps ]; then + cp ${DEFAULTS}/ldap_relay_recipient_maps ${CUSTOM}/ + sed -i -e "s%@THIS_HOST@%${HOSTNAME}%" -e "s%@LDAP_SEARCH_BASE@%${LDAP_SEARCH_BASE}%" ${CUSTOM}/ldap_relay_recipient_maps + fi fi newaliases