# HG changeset patch # User Paul Boddie # Date 1460929639 -7200 # Node ID cfbb32370151770464c3a220c87e0f294006ee84 # Parent eb488ac16e1b1b2d48568fe5dd8e065fad23d7ab# Parent 692c89e110bb82ba15a8c676dea2d45f09a4f195 Merged changes from the default branch. diff -r eb488ac16e1b -r cfbb32370151 conf/apache/imip-agent.conf --- a/conf/apache/imip-agent.conf Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/apache/imip-agent.conf Sun Apr 17 23:47:19 2016 +0200 @@ -10,7 +10,7 @@ # LDAP authentication... ##AuthBasicProvider ldap - ##AuthLDAPUrl "ldap://localhost/ou=People,dc=example,dc=com?mail?sub" + ##AuthLDAPUrl "$LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub" # Simple file-based authentication... ##AuthUserFile /var/www/imip-agent/users diff -r eb488ac16e1b -r cfbb32370151 conf/apache/imip-manager.conf --- a/conf/apache/imip-manager.conf Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/apache/imip-manager.conf Sun Apr 17 23:47:19 2016 +0200 @@ -9,7 +9,7 @@ # LDAP authentication... #AuthBasicProvider ldap - #AuthLDAPUrl "ldap://localhost/ou=People,dc=example,dc=com?mail?sub" + #AuthLDAPUrl "$LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub" # Simple file-based authentication... AuthUserFile /var/www/imip-agent/users diff -r eb488ac16e1b -r cfbb32370151 conf/configure.example --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/configure.example Sun Apr 17 23:47:19 2016 +0200 @@ -0,0 +1,88 @@ +#!/bin/sh + +set -a + +# The mail domain. + +MAIL_DOMAIN=example.com + +# How messages are delivered to mailboxes. +# See the MailIntegration/LocalSMTP and MailIntegration/LMTP documents. +# Choices: LocalSMTP, LMTP + +MAILBOX_DELIVERY=LocalSMTP + +# Whether a special lmtp group will be used even with local SMTP. +# See the SystemUsers document. +# Choices: yes, no + +MAILBOX_DELIVERY_LMTP_GROUP=no + +# The location of the LMTP socket used to communicate with a mail +# storage solution. + +LMTP_SOCKET=/var/run/cyrus/socket/lmtp + +# Whether local system users are supported. +# See the MailIntegration/LocalSMTP document. +# Choices: yes, no + +LOCAL_SYSTEM_USERS=no + +# How the users are managed. +# See the MailIntegration/Simple and MailIntegration/LDAP documents. +# Choices: Simple, LDAP + +USER_DATABASE=Simple + +# LDAP-specific details. +# See the MailIntegration/LDAP document. +# Choices: ldap, ldaps + +LDAP_SCHEME=ldap +LDAP_HOST=localhost +LDAP_PORT= +LDAP_BASE_DN="dc=example,dc=com" +LDAP_SERVICE_BIND_DN="uid=imip-agent,ou=Special Users,dc=example,dc=com" +LDAP_SERVICE_PASSWORD= + + + +# Computed values. Do not edit! + +MAIL_DOMAIN_QUOTED=`echo $MAIL_DOMAIN | sed 's/\./\\\./g'` + +if [ "$MAILBOX_DELIVERY" = 'LocalSMTP' ]; then + MAILBOX_DELIVERY_OPTIONS="-L" + if [ "$MAILBOX_DELIVERY_LMTP_GROUP" = 'yes' ]; then + MAILBOX_DELIVERY_GROUP=lmtp + else + MAILBOX_DELIVERY_GROUP=www-data + fi +else + MAILBOX_DELIVERY_OPTIONS="-l $LMTP_SOCKET" + MAILBOX_DELIVERY_GROUP=lmtp +fi + +if [ "$LOCAL_SYSTEM_USERS" = 'yes' ]; then + POSTFIX_LOCAL_SYSTEM_ENABLE= +else + POSTFIX_LOCAL_SYSTEM_ENABLE=# +fi + +if [ ! "$LDAP_PORT" ]; then + if [ "$LDAP_SCHEME" = 'ldaps' ]; then + LDAP_PORT=636 + else + LDAP_PORT=389 + fi +fi + + + +# Substituted variables. + +SUBSTITUTED='$MAIL_DOMAIN $MAIL_DOMAIN_QUOTED \ + $MAILBOX_DELIVERY_OPTIONS $MAILBOX_DELIVERY_GROUP \ + $POSTFIX_LOCAL_SYSTEM_ENABLE \ + $LDAP_SCHEME $LDAP_HOST $LDAP_PORT $LDAP_BASE_DN $LDAP_SERVICE_BIND_DN $LDAP_SERVICE_PASSWORD' diff -r eb488ac16e1b -r cfbb32370151 conf/exim/30_exim4-config_people --- a/conf/exim/30_exim4-config_people Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/30_exim4-config_people Sun Apr 17 23:47:19 2016 +0200 @@ -1,8 +1,6 @@ -# Replace "-l LMTP_SOCKET" with "-L" for local SMTP delivery. - people_transport: debug_print = "T: people_transport for $local_part@$domain" driver = pipe - command = /var/lib/imip-agent/imip_person.py -l LMTP_SOCKET -o $pipe_addresses + command = /var/lib/imip-agent/imip_person.py $MAILBOX_DELIVERY_OPTIONS -o $pipe_addresses user = imip-agent initgroups = true diff -r eb488ac16e1b -r cfbb32370151 conf/exim/ldap/010_exim4-config_ldap_people_outgoing --- a/conf/exim/ldap/010_exim4-config_ldap_people_outgoing Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/ldap/010_exim4-config_ldap_people_outgoing Sun Apr 17 23:47:19 2016 +0200 @@ -9,8 +9,8 @@ no_expn no_verify condition = ${if eq {}{${lookup ldap{ \ - user="LDAP_SERVICE_BIND_DN" \ - pass=LDAP_SERVICE_PASSWORD \ - ldap://LDAP_HOST:LDAP_PORT/LDAP_BASE_DN?mail?sub?LDAP_PERSON_OUTGOING_QUERY} \ + user="$LDAP_SERVICE_BIND_DN" \ + pass=$LDAP_SERVICE_PASSWORD \ + $LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub?LDAP_PERSON_OUTGOING_QUERY} \ }}{no}{yes}} transport = people_outgoing_transport diff -r eb488ac16e1b -r cfbb32370151 conf/exim/ldap/020_exim4-config_ldap_people --- a/conf/exim/ldap/020_exim4-config_ldap_people Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/ldap/020_exim4-config_ldap_people Sun Apr 17 23:47:19 2016 +0200 @@ -6,9 +6,9 @@ debug_print = "R: ldap_person for $local_part@$domain" driver = accept condition = ${if eq {}{${lookup ldap{ \ - user="LDAP_SERVICE_BIND_DN" \ - pass=LDAP_SERVICE_PASSWORD \ - ldap://LDAP_HOST:LDAP_PORT/LDAP_BASE_DN?mail?sub?LDAP_PERSON_QUERY} \ + user="$LDAP_SERVICE_BIND_DN" \ + pass=$LDAP_SERVICE_PASSWORD \ + $LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub?LDAP_PERSON_QUERY} \ }}{no}{yes}} transport = people_transport cannot_route_message = Unknown user diff -r eb488ac16e1b -r cfbb32370151 conf/exim/ldap/020_exim4-config_ldap_people_local_system --- a/conf/exim/ldap/020_exim4-config_ldap_people_local_system Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/ldap/020_exim4-config_ldap_people_local_system Sun Apr 17 23:47:19 2016 +0200 @@ -7,8 +7,8 @@ driver = redirect local_part_prefix = local+ data = ${lookup ldap{ \ - user="LDAP_SERVICE_BIND_DN" \ - pass=LDAP_SERVICE_PASSWORD \ - ldap://LDAP_HOST:LDAP_PORT/LDAP_BASE_DN?uid?sub?LDAP_LOCAL_PERSON_SYSTEM_QUERY} \ + user="$LDAP_SERVICE_BIND_DN" \ + pass=$LDAP_SERVICE_PASSWORD \ + $LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?uid?sub?LDAP_LOCAL_PERSON_SYSTEM_QUERY} \ } cannot_route_message = Unknown user diff -r eb488ac16e1b -r cfbb32370151 conf/exim/ldap/020_exim4-config_ldap_people_outgoing_recipients --- a/conf/exim/ldap/020_exim4-config_ldap_people_outgoing_recipients Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/ldap/020_exim4-config_ldap_people_outgoing_recipients Sun Apr 17 23:47:19 2016 +0200 @@ -8,8 +8,8 @@ local_part_prefix = people-outgoing+ condition = ${if !eq {} \ {${lookup ldap{ \ - user="LDAP_SERVICE_BIND_DN" \ - pass=LDAP_SERVICE_PASSWORD \ - ldap://LDAP_HOST:LDAP_PORT/LDAP_BASE_DN?mail?sub?LDAP_PERSON_OUTGOING_RECIPIENT_QUERY}}} \ + user="$LDAP_SERVICE_BIND_DN" \ + pass=$LDAP_SERVICE_PASSWORD \ + $LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub?LDAP_PERSON_OUTGOING_RECIPIENT_QUERY}}} \ } transport = people_outgoing_transport diff -r eb488ac16e1b -r cfbb32370151 conf/exim/ldap/020_exim4-config_ldap_resources --- a/conf/exim/ldap/020_exim4-config_ldap_resources Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/ldap/020_exim4-config_ldap_resources Sun Apr 17 23:47:19 2016 +0200 @@ -6,9 +6,9 @@ debug_print = "R: ldap_resource for $local_part@$domain" driver = accept condition = ${if eq {}{${lookup ldap{ \ - user="LDAP_SERVICE_BIND_DN" \ - pass=LDAP_SERVICE_PASSWORD \ - ldap://LDAP_HOST:LDAP_PORT/LDAP_BASE_DN?mail?sub?LDAP_RESOURCE_QUERY} \ + user="$LDAP_SERVICE_BIND_DN" \ + pass=$LDAP_SERVICE_PASSWORD \ + $LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub?LDAP_RESOURCE_QUERY} \ }}{no}{yes}} transport = resources_transport cannot_route_message = Unknown user diff -r eb488ac16e1b -r cfbb32370151 conf/exim/ldap/890_exim4-config_cyrus_lmtp_local_lmtp --- a/conf/exim/ldap/890_exim4-config_cyrus_lmtp_local_lmtp Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/ldap/890_exim4-config_cyrus_lmtp_local_lmtp Sun Apr 17 23:47:19 2016 +0200 @@ -8,9 +8,9 @@ local_part_prefix = local+ condition = ${if !eq {} \ {${lookup ldap{ \ - user="LDAP_SERVICE_BIND_DN" \ - pass=LDAP_SERVICE_PASSWORD \ - ldap://LDAP_HOST:LDAP_PORT/LDAP_BASE_DN?mail?sub?LDAP_LOCAL_LMTP_QUERY}}} \ + user="$LDAP_SERVICE_BIND_DN" \ + pass=$LDAP_SERVICE_PASSWORD \ + $LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub?LDAP_LOCAL_LMTP_QUERY}}} \ } transport = cyrus_lmtp cannot_route_message = Unknown user diff -r eb488ac16e1b -r cfbb32370151 conf/exim/ldap/890_exim4-config_dovecot_lmtp_local_lmtp --- a/conf/exim/ldap/890_exim4-config_dovecot_lmtp_local_lmtp Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/ldap/890_exim4-config_dovecot_lmtp_local_lmtp Sun Apr 17 23:47:19 2016 +0200 @@ -8,9 +8,9 @@ local_part_prefix = local+ condition = ${if !eq {} \ {${lookup ldap{ \ - user="LDAP_SERVICE_BIND_DN" \ - pass=LDAP_SERVICE_PASSWORD \ - ldap://LDAP_HOST:LDAP_PORT/LDAP_BASE_DN?mail?sub?LDAP_LOCAL_LMTP_QUERY}}} \ + user="$LDAP_SERVICE_BIND_DN" \ + pass=$LDAP_SERVICE_PASSWORD \ + $LDAP_SCHEME://$LDAP_HOST:$LDAP_PORT/$LDAP_BASE_DN?mail?sub?LDAP_LOCAL_LMTP_QUERY}}} \ } transport = dovecot_lmtp cannot_route_message = Unknown user diff -r eb488ac16e1b -r cfbb32370151 conf/exim/simple/virtual_domains --- a/conf/exim/simple/virtual_domains Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/exim/simple/virtual_domains Sun Apr 17 23:47:19 2016 +0200 @@ -1,1 +1,1 @@ -example.com: +${MAIL_DOMAIN}: diff -r eb488ac16e1b -r cfbb32370151 conf/ldap/example.ldif --- a/conf/ldap/example.ldif Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/ldap/example.ldif Sun Apr 17 23:47:19 2016 +0200 @@ -21,6 +21,11 @@ objectClass: organizationalUnit ou: Resources +dn: ou=Special Users,dc=example,dc=com +objectClass: top +objectClass: organizationalUnit +ou: Special Users + # People: dn: uid=paulb,ou=People,dc=example,dc=com @@ -74,3 +79,13 @@ cn: Sauna mail: resource-room-sauna@example.com calFBURL: http://www.example.com/freebusy/mailto:resource-room-sauna@example.com/freebusy + +# Special Users: + +dn: uid=imip-agent,ou=Special Users,dc=example,dc=com +objectClass: top +objectClass: person +objectClass: inetOrgPerson +objectClass: organizationalPerson +uid: imip-agent +cn: imip-agent diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/ldap/virtual_alias_maps_people.cf --- a/conf/postfix/ldap/virtual_alias_maps_people.cf Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/ldap/virtual_alias_maps_people.cf Sun Apr 17 23:47:19 2016 +0200 @@ -1,11 +1,11 @@ -server_host = LDAP_HOST -server_port = LDAP_PORT +server_host = $LDAP_HOST +server_port = $LDAP_PORT version = 3 -search_base = LDAP_BASE_DN +search_base = $LDAP_BASE_DN scope = sub -bind_dn = LDAP_SERVICE_BIND_DN -bind_pw = LDAP_SERVICE_PASSWORD +bind_dn = $LDAP_SERVICE_BIND_DN +bind_pw = $LDAP_SERVICE_PASSWORD query_filter = (&(|(mail=%s)(alias=%s))(objectclass=inetorgperson)) result_attribute = mail diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/ldap/virtual_alias_maps_people_outgoing.cf --- a/conf/postfix/ldap/virtual_alias_maps_people_outgoing.cf Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/ldap/virtual_alias_maps_people_outgoing.cf Sun Apr 17 23:47:19 2016 +0200 @@ -1,11 +1,11 @@ -server_host = LDAP_HOST -server_port = LDAP_PORT +server_host = $LDAP_HOST +server_port = $LDAP_PORT version = 3 -search_base = LDAP_BASE_DN +search_base = $LDAP_BASE_DN scope = sub -bind_dn = LDAP_SERVICE_BIND_DN -bind_pw = LDAP_SERVICE_PASSWORD +bind_dn = $LDAP_SERVICE_BIND_DN +bind_pw = $LDAP_SERVICE_PASSWORD query_filter = (&(|(mail=%s)(alias=%s))(objectclass=inetorgperson)) result_attribute = mail diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/ldap/virtual_alias_maps_resources.cf --- a/conf/postfix/ldap/virtual_alias_maps_resources.cf Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/ldap/virtual_alias_maps_resources.cf Sun Apr 17 23:47:19 2016 +0200 @@ -1,11 +1,11 @@ -server_host = LDAP_HOST -server_port = LDAP_PORT +server_host = $LDAP_HOST +server_port = $LDAP_PORT version = 3 -search_base = LDAP_BASE_DN +search_base = $LDAP_BASE_DN scope = sub -bind_dn = LDAP_SERVICE_BIND_DN -bind_pw = LDAP_SERVICE_PASSWORD +bind_dn = $LDAP_SERVICE_BIND_DN +bind_pw = $LDAP_SERVICE_PASSWORD query_filter = (&(|(mail=%s)(alias=%s))(&(!(objectclass=inetOrgPerson))(objectclass=mailRecipient))) result_attribute = mail diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/lmtp/lmtp_generic --- a/conf/postfix/lmtp/lmtp_generic Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/lmtp/lmtp_generic Sun Apr 17 23:47:19 2016 +0200 @@ -1,1 +1,1 @@ -/^local+(.*)@example\.com$/ ${1}@example.com +/^local+(.*)@${MAIL_DOMAIN_QUOTED}$/ ${1}@${MAIL_DOMAIN} diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/lmtp/transport.items --- a/conf/postfix/lmtp/transport.items Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/lmtp/transport.items Sun Apr 17 23:47:19 2016 +0200 @@ -1,4 +1,4 @@ # Local delivery to Cyrus: -#local@example.com lmtp:unix:/var/run/cyrus/socket/lmtp +#local@$MAIL_DOMAIN lmtp:unix:/var/run/cyrus/socket/lmtp # Local delivery to Dovecot: -#local@example.com lmtp:unix:/var/run/dovecot/lmtp +#local@$MAIL_DOMAIN lmtp:unix:/var/run/dovecot/lmtp diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/master.cf.items --- a/conf/postfix/master.cf.items Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/master.cf.items Sun Apr 17 23:47:19 2016 +0200 @@ -1,14 +1,10 @@ -# Replace lmtp with www-data if operating in local SMTP mode. - imip_resources unix - n n - - pipe - flags=FR user=imip-agent:lmtp argv=/var/lib/imip-agent/imip_resource.py + flags=FR user=imip-agent:$MAILBOX_DELIVERY_GROUP argv=/var/lib/imip-agent/imip_resource.py -o ${original_recipient} -# Replace "-l LMTP_SOCKET" with "-L" for local SMTP delivery. - imip_people unix - n n - - pipe - flags=FR user=imip-agent:lmtp argv=/var/lib/imip-agent/imip_person.py - -o ${original_recipient} -l LMTP_SOCKET + flags=FR user=imip-agent:$MAILBOX_DELIVERY_GROUP argv=/var/lib/imip-agent/imip_person.py + -o ${original_recipient} $MAILBOX_DELIVERY_OPTIONS imip_people_outgoing unix - n n - - pipe - flags=FR user=imip-agent:lmtp argv=/var/lib/imip-agent/imip_person_outgoing.py + flags=FR user=imip-agent:$MAILBOX_DELIVERY_GROUP argv=/var/lib/imip-agent/imip_person_outgoing.py diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/simple/main.cf.example --- a/conf/postfix/simple/main.cf.example Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/simple/main.cf.example Sun Apr 17 23:47:19 2016 +0200 @@ -3,6 +3,6 @@ virtual_alias_maps = $alias_maps, hash:/etc/postfix/virtual, hash:/etc/postfix/simple/virtual_alias_maps - #, hash:/etc/postfix/simple/virtual_alias_maps_local_system + $POSTFIX_LOCAL_SYSTEM_ENABLE, hash:/etc/postfix/simple/virtual_alias_maps_local_system sender_bcc_maps = hash:/etc/postfix/simple/virtual_alias_maps_people_outgoing diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/simple/virtual_alias_maps --- a/conf/postfix/simple/virtual_alias_maps Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/simple/virtual_alias_maps Sun Apr 17 23:47:19 2016 +0200 @@ -1,5 +1,5 @@ -paul.boddie@example.com people+paul.boddie@example.com -vincent.vole@example.com people+vincent.vole@example.com -resource-car-porsche911@example.com resources+resource-car-porsche911@example.com -resource-room-confroom@example.com resources+resource-room-confroom@example.com -resource-room-sauna@example.com resources+resource-room-sauna@example.com +paul.boddie@$MAIL_DOMAIN people+paul.boddie@$MAIL_DOMAIN +vincent.vole@$MAIL_DOMAIN people+vincent.vole@$MAIL_DOMAIN +resource-car-porsche911@$MAIL_DOMAIN resources+resource-car-porsche911@$MAIL_DOMAIN +resource-room-confroom@$MAIL_DOMAIN resources+resource-room-confroom@$MAIL_DOMAIN +resource-room-sauna@$MAIL_DOMAIN resources+resource-room-sauna@$MAIL_DOMAIN diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/simple/virtual_alias_maps_local_system --- a/conf/postfix/simple/virtual_alias_maps_local_system Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/simple/virtual_alias_maps_local_system Sun Apr 17 23:47:19 2016 +0200 @@ -1,2 +1,2 @@ -local+paul.boddie@example.com paulb -local+vincent.vole@example.com vole +local+paul.boddie@$MAIL_DOMAIN paulb +local+vincent.vole@$MAIL_DOMAIN vole diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/simple/virtual_alias_maps_people_outgoing --- a/conf/postfix/simple/virtual_alias_maps_people_outgoing Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/simple/virtual_alias_maps_people_outgoing Sun Apr 17 23:47:19 2016 +0200 @@ -1,2 +1,2 @@ -paul.boddie@example.com people-outgoing+paul.boddie@example.com -vincent.vole@example.com people-outgoing+vincent.vole@example.com +paul.boddie@$MAIL_DOMAIN people-outgoing+paul.boddie@$MAIL_DOMAIN +vincent.vole@$MAIL_DOMAIN people-outgoing+vincent.vole@$MAIL_DOMAIN diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/transport --- a/conf/postfix/transport Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/transport Sun Apr 17 23:47:19 2016 +0200 @@ -1,6 +1,6 @@ -# iMIP content handling for example.com via the resources address: -resources@example.com imip_resources: -# iMIP content handling for example.com via the people address: -people@example.com imip_people: -# iMIP content handling for example.com via the people-outgoing address: -people-outgoing@example.com imip_people_outgoing: +# iMIP content handling for $MAIL_DOMAIN via the resources address: +resources@$MAIL_DOMAIN imip_resources: +# iMIP content handling for $MAIL_DOMAIN via the people address: +people@$MAIL_DOMAIN imip_people: +# iMIP content handling for $MAIL_DOMAIN via the people-outgoing address: +people-outgoing@$MAIL_DOMAIN imip_people_outgoing: diff -r eb488ac16e1b -r cfbb32370151 conf/postfix/virtual --- a/conf/postfix/virtual Sun Apr 10 02:34:00 2016 +0200 +++ b/conf/postfix/virtual Sun Apr 17 23:47:19 2016 +0200 @@ -1,1 +1,1 @@ -people-outgoing@example.com people-outgoing@example.com +people-outgoing@$MAIL_DOMAIN people-outgoing@$MAIL_DOMAIN diff -r eb488ac16e1b -r cfbb32370151 conf/tools/configure.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/tools/configure.sh Sun Apr 17 23:47:19 2016 +0200 @@ -0,0 +1,69 @@ +#!/bin/sh + +DIRNAME=`dirname "$0"` +PROGNAME=`basename "$0"` + +if [ "$1" = '--help' ] || [ ! "$1" ] || [ ! "$2" ]; then + cat 1>&2 < [ ] + +Produce files to configure imip-agent using the definitions in the specified +file, storing the configuration files in the given output directory. This +utility is intended to make the customisation of the example configuration files +easier. + +Once the files have been generated, they may be reviewed and copied into the +appropriate locations. +EOF + exit 1 +fi + +DEFSFILE=$1 +OUTDIR=$2 +CONF=${3:-"conf"} + +if [ ! -e "$DEFSFILE" ]; then + cat 1>&2 <&2 < "$OUTDIR/$FILENAME" + done +done + +# Copy other files. + +cp "$CONF/aliases.example" "$OUTDIR/$CONF/aliases" diff -r eb488ac16e1b -r cfbb32370151 docs/wiki/Configuration --- a/docs/wiki/Configuration Sun Apr 10 02:34:00 2016 +0200 +++ b/docs/wiki/Configuration Sun Apr 17 23:47:19 2016 +0200 @@ -1,5 +1,89 @@ = Configuration = +When deploying imip-agent, configuration of the way it integrates with +other software components must be performed. Once this has been done, +certain details are then carried forward into the configuration of imip-agent +itself. + +== Configuring the Integration == + +The `conf` directory provides a selection of template configuration files +for different software components that may integrate with imip-agent. To +simplify the process of customising these files, a helper tool is provided +to apply configuration choices and to generate configuration files that may +then be deployed within the configuration of these other components. + +Taking an example set of choices, the tool is run as follows: + +{{{ +conf/tools/configure.sh conf/configure.example outconf +}}} + +This will generate parameterised versions of several files within `conf` +and place them in a similar directory structure within the newly-created +directory `outconf`, using the settings found in `conf/configure.example`. + +It is recommended that the example definitions file be copied and edited, +and that each definition or choice in the new definitions file be adjusted +according to the specific needs of the deployment. A summary of the choices +are given below. + +{{{#!table +'''Choice''' || '''Example Value''' || '''Description''' +== +`MAIL_DOMAIN` || `example.com` +|| The mail domain for which imip-agent will be handling messages +== +`MAILBOX_DELIVERY` || `LocalSMTP` +|| How messages are delivered to mailboxes, either using `LocalSMTP` +.. ([[../MailIntegration/LocalSMTP|local SMTP]]) or `LMTP` +.. ([[../MailIntegration/LMTP|LMTP]]) mechanisms +== +`MAILBOX_DELIVERY_LMTP_GROUP` || `no` +|| Whether a special lmtp group will be used even with local SMTP, +.. as discussed in the [[../SystemUsers|system users and groups]] +.. documentation +== +`LMTP_SOCKET` || `/var/run/cyrus/socket/lmtp` +|| The location of the LMTP socket used to communicate with a mail +.. storage solution (if LMTP is employed) +== +`LOCAL_SYSTEM_USERS` || `no` +|| Whether local system users are supported, as described in the +.. [[../MailIntegration/LocalSMTP|local SMTP]] documentation. +== +`USER_DATABASE` || `Simple` +|| How the database of calendar users is managed, either using `Simple` +.. ([[../MailIntegration/Simple|simple]]) or `LDAP` +.. ([[../MailIntegration/LDAP|LDAP]]) mechanisms +== + ''LDAP-specific choices (for when calendar users are managed +using [[../MailIntegration/LDAP|LDAP]])'' +== +`LDAP_SCHEME` || `ldap` +|| LDAP access mechanism, either using `ldap` or `ldaps` +== +`LDAP_HOST` || `localhost` +|| LDAP server connection details, with the port being omitted +.. unless a non-standard port has been chosen +== +`LDAP_PORT` || +== +`LDAP_BASE_DN` || `"dc=example,dc=com"` +|| Search criteria used in the selection of calendar users +== +`LDAP_SERVICE_BIND_DN` || `"uid=imip-agent,ou=Special Users,dc=example,dc=com"` +|| Credentials for the identity employed by imip-agent to connect +.. to the LDAP server +== +`LDAP_SERVICE_PASSWORD` || +}}} + +The eventual destination of each of the customised files obviously depends on +the nature of the component such files will be configuring. + +== Configuring the Software Itself == + There are three levels of configuration in imip-agent: * `config.sh` provides system-level and tool configuration @@ -9,12 +93,7 @@ These files are by default installed into the `/etc/imip-agent` directory and they can be changed in that location once the system is installed. -{{{#!wiki tip -=== Text Encoding === -The textual encoding employed by the preferences files is UTF-8. -}}} - -== System-Level and Tool Configuration == +=== System-Level and Tool Configuration === The `config.sh` file must indicate choices in the following areas: @@ -27,7 +106,26 @@ must be made to the file in the `tools/config.sh` location before installation can occur. -== Software Configuration == +{{{#!table +'''Setting''' || '''Example Value''' || '''Description''' +== +`IMIP_AGENT_USER` || `imip-agent` +|| Indicates the system user and group identity that is used +.. to run the software and access resources, decided when choosing a +.. strategy for [[../SystemUsers|system users and groups]] +== +`IMIP_AGENT_GROUP` || `lmtp` +== +`INSTALL_DIR` || `/var/lib/imip-agent` +|| Installation locations for data, Web resources and +.. configuration respectively +== +`WEB_INSTALL_DIR` || `/var/www/imip-agent` +== +`CONFIG_DIR` || `/etc/imip-agent` +}}} + +=== Software Configuration === Any changes to filesystem locations may need to be incorporated into the `config.py` file, which is found in the `imiptools/config.py` location of @@ -40,7 +138,7 @@ and file permissions), service-level settings (e-mail address and Web site choices), and default policies for users of the software. -== User Preferences == +=== User Preferences === Although the software configuration in `config.py` provides default policies, users can choose to override these defaults by editing their own preferences. diff -r eb488ac16e1b -r cfbb32370151 docs/wiki/GettingStarted --- a/docs/wiki/GettingStarted Sun Apr 10 02:34:00 2016 +0200 +++ b/docs/wiki/GettingStarted Sun Apr 17 23:47:19 2016 +0200 @@ -29,6 +29,10 @@ If you already use mail storage solutions that employ LMTP, you may decide to choose the [[../MailIntegration/LMTP|LMTP delivery]] approach. +Once you have decided which approach is the most preferable, you will be +able to use this choice to influence the configuration process mentioned +below. + == Installing the Software == Ideally, an operating system distribution package should be used to @@ -103,6 +107,16 @@ || [[../DatabaseStore|Database Store]] }}} +In addition, a `tools` directory provides a configuration helper tool +that can be used to quickly customise the above resources and produce +files that, after review, may be deployed. + +{{{ +conf/tools/configure.sh --help +}}} + +Use of this tool is covered in the [[../Configuration|configuration guide]]. + == Configuring the Software == The behaviour of the imip-agent software itself can be configured using diff -r eb488ac16e1b -r cfbb32370151 docs/wiki/Preferences --- a/docs/wiki/Preferences Sun Apr 10 02:34:00 2016 +0200 +++ b/docs/wiki/Preferences Sun Apr 17 23:47:19 2016 +0200 @@ -20,6 +20,11 @@ See the [[../Configuration|configuration guide]] for more information about the `config.py` file. +{{{#!wiki tip +=== Text Encoding === +The textual encoding employed by all preferences files is UTF-8. +}}} + == User Preference Settings == <> diff -r eb488ac16e1b -r cfbb32370151 docs/wiki/Prerequisites --- a/docs/wiki/Prerequisites Sun Apr 10 02:34:00 2016 +0200 +++ b/docs/wiki/Prerequisites Sun Apr 17 23:47:19 2016 +0200 @@ -37,6 +37,7 @@ Cyrus:: cyrus-imapd Dovecot:: dovecot-imapd dovecot-ldap dovecot-lmtpd -Some test programs need additional programs provided by other packages: +Some test programs and the configuration helper tool need additional programs +provided by other packages: envsubst:: gettext-base diff -r eb488ac16e1b -r cfbb32370151 tools/fix.sh --- a/tools/fix.sh Sun Apr 10 02:34:00 2016 +0200 +++ b/tools/fix.sh Sun Apr 17 23:47:19 2016 +0200 @@ -1,6 +1,6 @@ #!/bin/sh -DIRNAME=`dirname $0` +DIRNAME=`dirname "$0"` if [ -e "$DIRNAME/config.sh" ]; then CONFIG="$DIRNAME/config.sh" @@ -10,7 +10,7 @@ . "$CONFIG" fi -PROGNAME=`basename $0` +PROGNAME=`basename "$0"` if [ "$1" = "--help" ]; then cat 1>&2 <&2 <&2 < diff -r eb488ac16e1b -r cfbb32370151 tools/install.sh --- a/tools/install.sh Sun Apr 10 02:34:00 2016 +0200 +++ b/tools/install.sh Sun Apr 17 23:47:19 2016 +0200 @@ -1,6 +1,6 @@ #!/bin/sh -DIRNAME=`dirname $0` +DIRNAME=`dirname "$0"` if [ -e "$DIRNAME/config.sh" ]; then . "$DIRNAME/config.sh"