peterm
committed
on 22 Mar 04
some I18N message lookup fixes
/tcl/rollout-email-procs.tcl (+16 -30)
98 98     ad_proc -private sendmail_filter {
99 99         to from subject body {extraheaders {}} {bcc {}}
100 100     } {
101 101
102 102         Email messages are sent to in the usual manner if the
103 103         recipient appears in the EmailAllow parameter, otherwise they are
104 104         logged.
105 105
106 106         @author Andrew Grumet <aegrumet@alum.mit.edu>
107 107         @date 29 July 2002
108 108
109 109
110 110     } {
111 111         set allowed [ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailAllow]
112 112         if { [lsearch [split $allowed ,] $to] >= 0 } {
113 113             return [_old_ns_sendmail $to $from $subject $body $extraheaders $bcc]
114 114         } else {
115 115             return [ro::email::sendmail_log $to $from $subject $body $extraheaders $bcc]
116 116         }
117 117     }
118   }
119 118
120   switch [ns_config ns/server/[ns_info server]/acs/acs-rollout-support EmailDeliveryMode] {
  119     ad_proc -private rename_ns_sendmail {} {
121 120
122       log {
  121         Renames ns_sendmail to _old_ns_sendmail if _old_ns_sendmail
  122         doesn't already exist.  Returns 1 if successful, 0 otherwise.
123 123
124           ns_log Notice "rollout-email-procs.tcl: renaming ns_sendmail to _old_ns_sendmail."
125           rename ns_sendmail _old_ns_sendmail
  124         @author Andrew Grumet <aegrumet@alum.mit.edu>
  125         @date 6 June 2003
126 126
127           ns_log Notice "rollout-email-procs.tcl: renaming ro::email::sendmail_log to ns_sendmail.  Email messages will be written to the error log instead of getting sent."
128           rename ro::email::sendmail_log ns_sendmail
129  
130       }
131  
132       redirect {
133  
  127     } {
134 128         ns_log Notice "rollout-email-procs.tcl: renaming ns_sendmail to _old_ns_sendmail."
135           rename ns_sendmail _old_ns_sendmail
136  
137           ns_log Notice "rollout-email-procs.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 ."
138           rename ro::email::sendmail_redirect ns_sendmail
139  
  129         if { [catch {
  130             #We have to execute this code in the global namespace
  131             #because otherwise _old_ns_sendmail will land in ro::email.
  132             namespace eval :: { rename ns_sendmail _old_ns_sendmail }
  133         } errMsg] } {
  134             ns_log Notice "rollout-email-procs.tcl: rename failed!  Error message: '$errMsg'"
  135             return 0
140 136         }
141  
142       filter {
143  
144           ns_log Notice "rollout-email-procs.tcl: renaming ns_sendmail to _old_ns_sendmail."
145           rename ns_sendmail _old_ns_sendmail
146  
147           ns_log Notice "rollout-email-procs.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]') ."
148           rename ro::email::sendmail_filter ns_sendmail
149  
  137         return 1
150 138     }
151  
152 139 }
153