diff -uNr exim-4.30/doc/OptionLists.txt exim-4.30-redirectqualify/doc/OptionLists.txt --- exim-4.30/doc/OptionLists.txt 2003-12-01 10:15:41.000000000 +0000 +++ exim-4.30-redirectqualify/doc/OptionLists.txt 2004-03-04 16:12:44.000000000 +0000 @@ -351,6 +351,7 @@ string "smtp" smtp 3.20 public_name string unset authenticators 3.10 qualify_domain string + main + string* unset redirect qualify_preserve_domain boolean false redirect 4.00 qualify_recipient string + main qualify_single boolean true dnslookup 4.00 diff -uNr exim-4.30/doc/spec.txt exim-4.30-redirectqualify/doc/spec.txt --- exim-4.30/doc/spec.txt 2003-12-01 10:15:41.000000000 +0000 +++ exim-4.30-redirectqualify/doc/spec.txt 2004-03-04 16:08:06.000000000 +0000 @@ -13628,6 +13628,12 @@ pipe transport. When the transport is run, the pipe command is in $address_pipe. +qualify_domain Type: string* Default: unset + + If this is set and an unqualified address (one without a domain) is + generated, it is qualified with the domain specified by expanding this + string, instead of the global setting in "qualify_recipient". + qualify_preserve_domain Type: boolean Default: false If this is set and an unqualified address (one without a domain) is diff -uNr exim-4.30/src/routers/redirect.c exim-4.30-redirectqualify/src/routers/redirect.c --- exim-4.30/src/routers/redirect.c 2003-12-01 10:15:41.000000000 +0000 +++ exim-4.30-redirectqualify/src/routers/redirect.c 2004-03-04 16:04:36.000000000 +0000 @@ -81,6 +81,8 @@ (void *)offsetof(redirect_router_options_block, owngroups) }, { "pipe_transport", opt_stringptr, (void *)offsetof(redirect_router_options_block, pipe_transport_name) }, + { "qualify_domain", opt_stringptr, + (void *)offsetof(redirect_router_options_block, qualify_domain) }, { "qualify_preserve_domain", opt_bool, (void *)offsetof(redirect_router_options_block, qualify_preserve_domain) }, { "repeat_use", opt_bool | opt_public, @@ -120,6 +122,7 @@ NULL, /* reply_transport_name */ NULL, /* syntax_errors_text */ NULL, /* syntax_errors_to */ + NULL, /* qualify_domain */ NULL, /* owners */ NULL, /* owngroups */ 022, /* modemask */ @@ -181,6 +184,12 @@ ob->check_group = (rblock->check_local_user && (ob->modemask & 020) == 0) || (ob->owngroups != NULL && ob->owngroups[0] != 0); +/* allow us to qualify the domain */ +if (ob->qualify_domain && ob->qualify_preserve_domain) + log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s router:\n " + "Only one of \"qualify_domain\" or \"qualify_preserve_domain\" must be set", + rblock->name); + /* If allow_filter is set, either user or check_local_user must be set. */ if (!rblock->check_local_user && @@ -515,6 +524,12 @@ address. */ if (ob->qualify_preserve_domain) qualify_domain_recipient = addr->domain; +else if (ob->qualify_domain != NULL) + { + qualify_domain_recipient = rf_expand_data(addr, ob->qualify_domain, &xrc); + if(qualify_domain_recipient == NULL) + return xrc; + } redirect.owners = ob->owners; redirect.owngroups = ob->owngroups; diff -uNr exim-4.30/src/routers/redirect.h exim-4.30-redirectqualify/src/routers/redirect.h --- exim-4.30/src/routers/redirect.h 2003-12-01 10:15:41.000000000 +0000 +++ exim-4.30-redirectqualify/src/routers/redirect.h 2004-03-04 15:43:42.000000000 +0000 @@ -25,6 +25,7 @@ uschar *reply_transport_name; uschar *syntax_errors_text; uschar *syntax_errors_to; + uschar *qualify_domain; uid_t *owners; gid_t *owngroups;