? reroute_email.module.txt Index: reroute_email.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/reroute_email/reroute_email.module,v retrieving revision 1.6 diff -r1.6 reroute_email.module 30,31c30,31 < '#type' => 'textfield', < '#title' => t('Email address'), --- > '#type' => 'textarea', > '#title' => t('Email addresses'), 34,35c34,37 < '#size' => 35, < '#description' => t('The email address to reroute all emails from the site to.') --- > '#cols' => 35, > '#rows' => 5, > '#description' => t('Provide a list of email addresses to pass through. Any email addresses > not on this list will be rerouted to the first address on the list.') 58,69c60,78 < // Format a message to show at the top < $msg[] = t("This email was rerouted."); < $msg[] = t("Web site: @site", array('@site' => $base_url)); < $msg[] = t("Mail key: @key", array('@key' => $mailkey)); < $msg[] = t("Originally to: <@to>", array('@to' => $to)); < $msg[] = "-----------------------"; < < // Prepend to the body of the email < $message['body'] = array_merge($msg, isset($message['body']) ? (is_array($message['body']) ? $message['body'] : array($message['body'])) : array()); < < // Change the $to address to be the one we defined < $message['to'] = variable_get(REROUTE_EMAIL_ADDRESS, ini_get('sendmail_from')); --- > // Split the address string on whitespace, ignoring any empty results > $addresslist = preg_split('/\s/', variable_get(REROUTE_EMAIL_ADDRESS, ini_get('sendmail_from')), > -1, PREG_SPLIT_NO_EMPTY); > > if (in_array($to, $addresslist)) { > // To address is in the pass-through list, let it pass through > $message['to'] = $to; > } else { > // Not on the list, so reroute to the first address in the list > $message['to'] = $addresslist[0]; > // Format a message to show at the top > $msg[] = t("This email was rerouted."); > $msg[] = t("Web site: @site", array('@site' => $base_url)); > $msg[] = t("Mail key: @key", array('@key' => $mailkey)); > $msg[] = t("Originally to: <@to>", array('@to' => $to)); > $msg[] = "-----------------------"; > // Prepend to the body of the email > $message['body'] = array_merge($msg, isset($message['body']) ? (is_array($message['body']) ? $message['body'] : array($message['body'])) : array()); > }