Forum OpenACS Improvement Proposals (TIPs): TIP#140 (implemented) acs-mail-lite package params for rollout support

So far acs-mail-lite is using config file params regarding rollout support. Those parameters are then used by both acs-mail-lite::send and ns_sendmail to set the delivery mode.

Since acs-mail-lite is now using smtp from TclLib, the parameters should be package ones. This way, ns_sendmail would still use the configuration set in the config file while acs-mail-lite would use its own. The first advantage is that the server wouldn't need a restart to change the delivery mode for acs-mail-lite.


EmailDeliveryMode = default | log | redirect | filter
EmailRedirectTo = emailAddress , { emailAddress } // when mode is set to "redirect", ignored otherwise
EmailAllow = emailAddress , { emailAddress } // when mode is set to "filter", ignored otherwise

I've actually implemented these package parameters for our stuff, however, we use SendmailBin instead of SMTP.  The difference in that regard is pretty minimal, however I would strongly suggest that ns_sendmail not have a different behavior than mail-lite.  This results in confusion when some messages are being logged or redirected while others are sent to the recipient. This is actually part of the reason I implemented the changes. I'm happy to provide you with the changes I've done, though.

The parameters I added are:

Must be one of: "normal", which sends messages via SendmailBin, "log", which logs all messages instead of sending, "redirect", which sends all messages to address specified in EmailRedirectTo parameter, "debug", which logs every message after sending, and "bcc" which sends a copy of every message to the address specified in EmailRedirectTo parameter.

Filter for the To address for allowed recipients. All other recipients will be removed from emails. Wildcards (*) may be used. Example: mailto:* or mailto:sysadmin@*.com

Comma-Delimited list of addresses that will used for EmailDeliveryMode of "redirect", "debug" and "bcc".

I should also point out that I modified ns_sendmail to adhere to these parameters, then made every message go through ns_sendmail, including anything done with mail-lite's send proc. This ensures that all emails behave as expected.
I agree with Nathan. Use the parameters, and rewrite the ns_sendmail proc in an -init.tcl script as is done now.

Only one place to configure is best.

Maybe put a warning in the acs-mail-lite-init if the config file has the parameters to left folks know to use the package parameters?

BTW we no longer support SendmailBin ...

We're also trying to discourage/end the use of ns_sendmail, but I guess as long as there are calls to it in the toolkit, it's better to have it honor the acs-mail-lite package params as you suggest.

Hi all,

Those parameters are already implemented in acs-mail-lite rollout support since 5.5 (or maybe 5.4 not sure now). The semantic of those params in OpenACS is slightly different than Nathan's ones. I kept the same semantic used by ns_sendmail for acs-mail-lite.

Regarding having ns_sendmail rollout support (implemented in acs-tcl) to use acs-mail-lite package parameters is wrong from the software architecture point of view. ns_sendmail and its rollout support are not implemented or used in acs-mail-lite. Beside, ns_sendmail users have configured the rollout support for it in the config file for years now and changing this now would just add confusion and give no benefit.

Moreover ns_sendmail is not used anymore in core or dotlrn (Don and I cleaned that up for 5.5) so there is really no point in making changes in a de facto deprecated function.

However, regarding ns_sendmail, I propose one of the following two alternatives:

Alternative 1:

- mark ns_sendmail and its rollout support as deprecated (in acs-tcl where it's implemented)

Alternative 2:

- remove ns_sendmail rollout support implementation in acs-tcl
- redefine ns_sendmail in acs-mail-lite to use acs_mail_lite::send and marking it as deprecated (sending a warning to the log when used)

I vote for alternative #2.

I'd forgotten that we had completed the task of getting rid of ns_sendmail calls cleaned out of all of core and dotlrn. I remembered working on replacing some of the calls with calls to acs_mail_lite::send, but didn't remember that we'd finished. We did good, then :)

Alternative 2 has my vote, too, it's how I'd imagined implementing daveb's suggestion (use acs_mail_lite::send, and thus use the package parameters).

Sending the warning to the log is a good idea, yes.

I agree with done. I approve alternative #2.