DKIM Doc update
[exim.git] / src / src / routers / redirect.c
index 2a9d5e3b2c150966fb83172be7a2fb983537ce67..35af9ac945c9c6b948a9ee7f12e2b0a34d7e93c2 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/routers/redirect.c,v 1.17 2006/07/13 13:53:33 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/redirect.c,v 1.22 2008/12/18 13:42:26 michael Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2006 */
+/* Copyright (c) University of Cambridge 1995 - 2007 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -101,6 +101,8 @@ optionlist redirect_router_options[] = {
       (void *)offsetof(redirect_router_options_block, reply_transport_name) },
   { "rewrite",            opt_bit | (RDON_REWRITE << 16),
       (void *)offsetof(redirect_router_options_block, bit_options) },
+  { "sieve_enotify_mailto_owner", opt_stringptr,
+      (void *)offsetof(redirect_router_options_block, sieve_enotify_mailto_owner) },
   { "sieve_subaddress", opt_stringptr,
       (void *)offsetof(redirect_router_options_block, sieve_subaddress) },
   { "sieve_useraddress", opt_stringptr,
@@ -151,6 +153,7 @@ redirect_router_options_block redirect_router_option_defaults = {
   NULL,        /* sieve_subaddress */
   NULL,        /* sieve_useraddress */
   NULL,        /* sieve_vacation_directory */
+  NULL,        /* sieve_enotify_mailto_owner */
   NULL,        /* syntax_errors_text */
   NULL,        /* syntax_errors_to */
   NULL,        /* qualify_domain */
@@ -334,6 +337,9 @@ while (generated != NULL)
   next->parent = addr;
   orflag(next, addr, af_ignore_error);
   next->start_router = rblock->redirect_router;
+  if (addr->child_count == SHRT_MAX)
+    log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s router generated more than %d "
+      "child addresses for <%s>", rblock->name, SHRT_MAX, addr->address);
   addr->child_count++;
 
   next->next = *addr_new;
@@ -690,10 +696,10 @@ else
   }
 
 frc = rda_interpret(&redirect, options, ob->include_directory,
-  ob->sieve_vacation_directory, ob->sieve_useraddress, ob->sieve_subaddress,
-  &ugid, &generated, &(addr->message), ob->skip_syntax_errors? &eblock : NULL,
-  &filtertype, string_sprintf("%s router (recipient is %s)", rblock->name,
-  addr->address));
+  ob->sieve_vacation_directory, ob->sieve_enotify_mailto_owner,
+  ob->sieve_useraddress, ob->sieve_subaddress, &ugid, &generated,
+  &(addr->message), ob->skip_syntax_errors? &eblock : NULL, &filtertype,
+  string_sprintf("%s router (recipient is %s)", rblock->name, addr->address));
 
 qualify_domain_recipient = save_qualify_domain_recipient;
 
@@ -736,8 +742,8 @@ switch (frc)
     int ovector[3];
     if (ob->forbid_smtp_code &&
         pcre_exec(regex_smtp_code, NULL, CS addr->message,
-        Ustrlen(addr->message), 0, PCRE_EOPT,
-        ovector, sizeof(ovector)/sizeof(int)) >= 0)
+          Ustrlen(addr->message), 0, PCRE_EOPT,
+          ovector, sizeof(ovector)/sizeof(int)) >= 0)
       {
       DEBUG(D_route) debug_printf("SMTP code at start of error message "
         "is ignored because forbid_smtp_code is set\n");