Forum OpenACS Q&A: Re: Development/Production setup - what's yours look like?

Collapse
Posted by Don Baccus on
e-mail alerts are no longer a problem - check out the rollout-procs.tcl file in acs-tcl/tcl that Andrew Grumet wrote for Sloan.

It lets you configure what to do with e-mail in your config Tcl file, options which include logging, forwarding to another address, etc.

<blockquote> e-mail alerts are no longer a problem - check out the
rollout-procs.tcl file in acs-tcl/tcl that Andrew Grumet
wrote for Sloan.
</blockquote>

Small aside, but this is slicker than... well, I dunno.  But it's pretty slick.  Thank you Andrew for sharing this.  We've sent spam to real-world email addresses from dev/staging servers during testing one too many times.  It's embarrassing.

Basically, it works by renaming the sendmail command on startup.  Here's the comments:

####################
Rollout support email procs.  These procs help manage differing email behavior on dev/staging/production.

Parameter settings summary:

ns_section ns/server/${server}/acs/acs-rollout-support

EmailDeliveryMode can be:
  default:  Email messages are sent in the usual manner.
  log:      Email messages are written to the server's error log.
  redirect: Email messages are redirected to the addresses specified by the EmailRedirectTo parameter.  If this list is absent or empty, email messages are written to the server's error log.
  filter:  Email messages are sent to in the usual manner if the recipient appears in the EmailAllow parameter, otherwise they are logged.
    ns_param EmailDeliveryMode redirect
    ns_param EmailRedirectTo mailto:somenerd@yourdomain.com,mailto:othernerd@yourdomain.com
    ns_param EmailAllow mailto:somenerd@yourdomain.com,mailto:othernerd@yourdomain.com
####################