# HG changeset patch # User Paul Boddie # Date 1445518799 -7200 # Node ID 2fbf8372142dedc741758aa63de9c37cf3c76299 # Parent cf2e0dc5ee0f1da52948088502b9e02798ac445c Renamed various Exim configuration files to impose an order that has the outgoing message sender address handling done first. Introduced explicit outgoing message handling where "people-outgoing+" is used in mail addresses. Tidied up the simple outgoing message handling to use sender "local parts" and domains like the other routers, rather than using full addresses. diff -r cf2e0dc5ee0f -r 2fbf8372142d README.txt --- a/README.txt Wed Oct 21 18:35:22 2015 +0200 +++ b/README.txt Thu Oct 22 14:59:59 2015 +0200 @@ -140,10 +140,11 @@ For Exim with LDAP (in conf/exim/ldap)... - 010_exim4-config_people_outgoing Defines recipients and outgoing + 010_exim4-config_ldap_people_outgoing Defines recipients and outgoing mail routing - 010_exim4-config_ldap_people ... - 010_exim4-config_ldap_resources ... + 020_exim4-config_ldap_people ... + 020_exim4-config_ldap_resources ... + 020_exim4-config_ldap_people_outgoing_recipients For Postfix with LDAP (in conf/postfix/ldap)... @@ -163,14 +164,22 @@ 010_exim4-config_people_outgoing Defines recipients and outgoing mail routing - 010_exim4-config_ldap_people ... - 010_exim4-config_ldap_resources ... + 020_exim4-config_people ... + 020_exim4-config_resources ... + 020_exim4-config_people_outgoing_recipients virtual_people Defines recipient identities - virtual_resources belonging to known domains + virtual_people_outgoing_recipients belonging to known domains + virtual_resources ... virtual_domains Defines recipient domains - virtual_people_outgoing Defines sender addresses + +In this simpler environment, recipient details must be manually edited in the +virtual files, but this permits a very transparent way of administering the +system. To add support for delivery to local mailboxes, the following +additional file is provided as an example: + + virtual_people_local Defines recipients and local users For Postfix without LDAP (in conf/postfix/simple)... diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/ldap/010_exim4-config_ldap_people --- a/conf/exim/ldap/010_exim4-config_ldap_people Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -LDAP_PERSON_QUERY = (&(|(mail=${quote_ldap:${local_part}}@${domain})(alias=${quote_ldap:${local_part}}@${domain}))(objectclass=inetorgperson)) - -ldap_person: - 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} \ - }}{no}{yes}} - transport = people_transport - cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/ldap/010_exim4-config_ldap_people_outgoing --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/ldap/010_exim4-config_ldap_people_outgoing Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,14 @@ +LDAP_PERSON_OUTGOING_QUERY = (&(|(mail=${quote_ldap:${sender_address_local_part}}@${sender_address_domain})(alias=${quote_ldap:${sender_address_local_part}}@${sender_address_domain}))(objectclass=inetorgperson)) + +ldap_person_outgoing: + debug_print = "R: ldap_person_outgoing for $sender_address_local_part@$sender_address_domain" + driver = accept + unseen + 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} \ + }}{no}{yes}} + transport = people_outgoing_transport diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/ldap/010_exim4-config_ldap_resources --- a/conf/exim/ldap/010_exim4-config_ldap_resources Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -LDAP_RESOURCE_QUERY = (&(|(mail=${quote_ldap:${local_part}}@${domain})(alias=${quote_ldap:${local_part}}@${domain}))(&(!(objectclass=inetOrgPerson))(objectclass=mailRecipient))) - -ldap_resource: - 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} \ - }}{no}{yes}} - transport = resources_transport - cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/ldap/010_exim4-config_people_outgoing --- a/conf/exim/ldap/010_exim4-config_people_outgoing Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -LDAP_PERSON_OUTGOING_QUERY = (&(|(mail=${quote_ldap:${sender_address_local_part}}@${sender_address_domain})(alias=${quote_ldap:${sender_address_local_part}}@${sender_address_domain}))(objectclass=inetorgperson)) - -people_outgoing: - debug_print = "R: person_outgoing for $sender_address_local_part@$sender_address_domain" - driver = accept - unseen - 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} \ - }}{no}{yes}} - transport = people_outgoing_transport diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/ldap/020_exim4-config_ldap_people --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/ldap/020_exim4-config_ldap_people Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,12 @@ +LDAP_PERSON_QUERY = (&(|(mail=${quote_ldap:${local_part}}@${domain})(alias=${quote_ldap:${local_part}}@${domain}))(objectclass=inetorgperson)) + +ldap_person: + 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} \ + }}{no}{yes}} + transport = people_transport + cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/ldap/020_exim4-config_ldap_people_outgoing_recipients --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/ldap/020_exim4-config_ldap_people_outgoing_recipients Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,19 @@ +PEOPLE_OUTGOING = ${strlen:people-outgoing:} + +LDAP_PERSON_OUTGOING_RECIPIENT_QUERY = (&(|(mail=${quote_ldap:${substr{PEOPLE_OUTGOING}{${local_part}}}@${domain})(alias=${quote_ldap:${substr{PEOPLE_OUTGOING}{${local_part}}}@${domain}))(objectclass=inetorgperson)) + +ldap_person_outgoing_recipient: + debug_print = "R: ldap_person_outgoing_recipient for $local_part@$domain" + driver = accept + unseen + no_expn + no_verify + condition = ${if and { \ + {eq {people-outgoing:}{${substr{0}{PEOPLE_OUTGOING}{${local_part}}}}} \ + {!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} \ + }}} \ + }} + transport = people_outgoing_transport diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/ldap/020_exim4-config_ldap_resources --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/ldap/020_exim4-config_ldap_resources Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,12 @@ +LDAP_RESOURCE_QUERY = (&(|(mail=${quote_ldap:${local_part}}@${domain})(alias=${quote_ldap:${local_part}}@${domain}))(&(!(objectclass=inetOrgPerson))(objectclass=mailRecipient))) + +ldap_resource: + 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} \ + }}{no}{yes}} + transport = resources_transport + cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/010_exim4-config_people --- a/conf/exim/simple/010_exim4-config_people Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -simple_person: - debug_print = "R: simple_person for $local_part@$domain" - driver = accept - domains = lsearch;/etc/exim4/virtual_domains - local_parts = lsearch;/etc/exim4/virtual_people - transport = people_transport - cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/010_exim4-config_people_local --- a/conf/exim/simple/010_exim4-config_people_local Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -simple_local_person: - debug_print = "R: simple_local_person for $local_part@$domain" - driver = redirect - domains = lsearch;/etc/exim4/virtual_domains - data = ${lookup{$local_part}lsearch{/etc/exim4/virtual_people_local}} - cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/010_exim4-config_people_outgoing --- a/conf/exim/simple/010_exim4-config_people_outgoing Wed Oct 21 18:35:22 2015 +0200 +++ b/conf/exim/simple/010_exim4-config_people_outgoing Thu Oct 22 14:59:59 2015 +0200 @@ -1,8 +1,11 @@ -people_outgoing: - debug_print = "R: people_outgoing for $sender_address_local_part@$sender_address_domain" +simple_person_outgoing: + debug_print = "R: simple_person_outgoing for $sender_address_local_part@$sender_address_domain" driver = accept unseen no_expn no_verify - senders = lsearch;/etc/exim4/virtual_people_outgoing + condition = ${if and { \ + {bool {${lookup {$sender_address_local_part} lsearch {/etc/exim4/virtual_people} {true} {false}}}} \ + {bool {${lookup {$sender_address_domain} lsearch {/etc/exim4/virtual_domains} {true} {false}}}} \ + }} transport = people_outgoing_transport diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/010_exim4-config_people_outgoing_recipients --- a/conf/exim/simple/010_exim4-config_people_outgoing_recipients Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -simple_person_outgoing_recipient: - debug_print = "R: simple_person_outgoing_recipient for $local_part@$domain" - driver = accept - domains = lsearch;/etc/exim4/virtual_domains - local_parts = lsearch;/etc/exim4/virtual_people_outgoing_recipients - transport = people_outgoing_transport - cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/010_exim4-config_resources --- a/conf/exim/simple/010_exim4-config_resources Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -simple_resource: - debug_print = "R: simple_resource for $local_part@$domain" - driver = accept - domains = lsearch;/etc/exim4/virtual_domains - local_parts = lsearch;/etc/exim4/virtual_resources - transport = resources_transport - cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/020_exim4-config_people --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/simple/020_exim4-config_people Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,7 @@ +simple_person: + debug_print = "R: simple_person for $local_part@$domain" + driver = accept + domains = lsearch;/etc/exim4/virtual_domains + local_parts = lsearch;/etc/exim4/virtual_people + transport = people_transport + cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/020_exim4-config_people_local --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/simple/020_exim4-config_people_local Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,6 @@ +simple_local_person: + debug_print = "R: simple_local_person for $local_part@$domain" + driver = redirect + domains = lsearch;/etc/exim4/virtual_domains + data = ${lookup{$local_part}lsearch{/etc/exim4/virtual_people_local}} + cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/020_exim4-config_people_outgoing_recipients --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/simple/020_exim4-config_people_outgoing_recipients Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,7 @@ +simple_person_outgoing_recipient: + debug_print = "R: simple_person_outgoing_recipient for $local_part@$domain" + driver = accept + domains = lsearch;/etc/exim4/virtual_domains + local_parts = lsearch;/etc/exim4/virtual_people_outgoing_recipients + transport = people_outgoing_transport + cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/020_exim4-config_resources --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/conf/exim/simple/020_exim4-config_resources Thu Oct 22 14:59:59 2015 +0200 @@ -0,0 +1,7 @@ +simple_resource: + debug_print = "R: simple_resource for $local_part@$domain" + driver = accept + domains = lsearch;/etc/exim4/virtual_domains + local_parts = lsearch;/etc/exim4/virtual_resources + transport = resources_transport + cannot_route_message = Unknown user diff -r cf2e0dc5ee0f -r 2fbf8372142d conf/exim/simple/virtual_people_outgoing --- a/conf/exim/simple/virtual_people_outgoing Wed Oct 21 18:35:22 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -paul.boddie@example.com: -vincent.vole@example.com: