Forum OpenACS Development: Outbound email control

Collapse
Posted by Andrew Grumet on
I've written some procs to help us control outbound email behavior on dev vs. staging vs. production. The file is here: https://openacs.org/new-file-storage/one-file? file_id=411. You can put it in any tcl directory. Then you should add the parameters to your config file.

Here are the modes that the code supports:


#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.
These procs take the pretty heavy-handed approach of renaming ns_sendmail. In a perfect world, everyone would use a single API for sending mail and we would enhance that API to exhibit these behaviors. I think that goal is within reach (though not by me in the next week!) if people agree that it is a good idea. For reference here is a grep on the HEAD of OpenACS and dotLRN from July 23.
bash-2.05$ find . -name "*.tcl" |xargs grep -l ns_sendmail
./packages/acs-admin/www/users/user-add-3.tcl
./packages/acs-mail/tcl/acs-mail-procs.tcl
./packages/acs-mail-lite/tcl/acs-mail-lite-procs.tcl
./packages/acs-messaging/tcl/acs-messaging-init.tcl
./packages/acs-messaging/tcl/acs-messaging-procs.tcl
./packages/acs-subsite/www/admin/users/new.tcl
./packages/acs-subsite/www/register/awaiting-email-verification.tcl
./packages/acs-subsite/www/register/email-password-2.tcl
./packages/acs-subsite/www/register/user-new-2.tcl
./packages/acs-subsite/www/shared/send-email.tcl
./packages/acs-tcl/tcl/rollout-email-procs.tcl
./packages/dotlrn/tcl/spam-procs.tcl
./packages/dotlrn/www/user-add-3.tcl
./packages/dotlrn/www/admin/users-bulk-upload-2.tcl
bash-2.05$