janine
committed
on 14 Jun 04
update from Sloan
/tcl/rollout-email-init.tcl (+63)
  1 ad_library {
  2    
  3     Initialize rollout email support.  See also rollout-email-procs.tcl. 
  4
  5     Parameter settings summary:
  6
  7     ns_section ns/server/${server}/acs/acs-rollout-support
  8
  9     #EmailDeliveryMode can be:
  10     #  default:  Email messages are sent in the usual manner.
  11     #  log:      Email messages are written to the server's error log.
  12     #  redirect: Email messages are redirected to the addresses specified
  13     #      by the EmailRedirectTo parameter.  If this list is absent or
  14     #      empty, email messages are written to the server's error log.
  15     #  filter:   Email messages are sent to in the usual manner if the
  16     #      recipient appears in the EmailAllow parameter, otherwise they are
  17     #      logged.
  18     ns_param EmailDeliveryMode redirect
  19     ns_param EmailRedirectTo somenerd@yourdomain.com,othernerd@yourdomain.com
  20     #ns_param EmailAllow somenerd@yourdomain.com,othernerd@yourdomain.com
  21
  22     @author Andrew Grumet <aegrumet@alum.mit.edu>
  23     @date 30 July 2002
  24
  25 }
  26
  27 switch [ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailDeliveryMode] {
  28
  29     log {
  30
  31         if { [ro::email::rename_ns_sendmail] } {
  32
  33             ns_log Notice "rollout-email-init.tcl: renaming ro::email::sendmail_log to ns_sendmail.  Email messages will be written to the error log instead of getting sent."
  34
  35             rename ro::email::sendmail_log ns_sendmail
  36
  37         }
  38
  39     }
  40
  41     redirect {
  42
  43         if { [ro::email::rename_ns_sendmail] } {
  44
  45             ns_log Notice "rollout-email-init.tcl: renaming ro::email::sendmail_redirect to ns_sendmail.  Email messages will be redirected to addresses specified by the EmailRedirectTo parameter of acs/acs-rollout-support ('[ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailRedirectTo]') or else logged if that parameter is not set ."
  46
  47             rename ro::email::sendmail_redirect ns_sendmail
  48
  49         }
  50
  51     }
  52
  53     filter {
  54
  55         if { [ro::email::rename_ns_sendmail] } {
  56
  57             ns_log Notice "rollout-email-init.tcl: renaming ro::email::sendmail_filter to ns_sendmail.  Email messages will be logged unless this recipient's address is listed in the EmailAllow parameter of acs/acs-rollout-support ('[ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailAllow]') ."
  58
  59             rename ro::email::sendmail_filter ns_sendmail
  60
  61         }
  62     }
  63 }