Forum OpenACS Development: Error: can't rename to "_old_ns_sendmail": command already exists

I'm getting an error when initializing acs-mail-lite (and I have errors sending mail)
Notice: acs-mail-lite: renaming acs_mail_lite::sendmail to ns_sendmail
[29/Oct/2013:05:00:52][17099.18446744072172807936][-main-] Error: Error sourcing /home/openacs/openacs/packages/acs-mail-lite/tcl/acs-mail-lite-init.tcl:
can't rename to "_old_ns_sendmail": command already exists
    invoked from within
"rename ns_sendmail _old_ns_sendmail"
    (file "/home/openacs/openacs/packages/acs-mail-lite/tcl/acs-mail-lite-init.tcl" line 35)
    invoked from within
"source $__file "

Might be a mis configuration in my email server?

It seemed to be a problem with my configuration file. So I think Openacs couldn't connect with my email server.

I had
set server "localhost"

and I fix it setting

server ""

ns_param hostname $hostname

hostname has to be the real name

actually, the init-file is supposed be loaded only once, so the error is strange.

In general the policy of OpenACS to rename predefined commands is not great. In this case, the predefined sendmail mechanism of AOLServer or NaviServer (namely ns_sendmail) is essentially replaced by a send-mail implementation from the tcl library (presumably, since the the AOLserver variant was broken in some respects). However, at least the NaviServer variant has the advantage, that all of it's I/O never uses the select() system call and that it works therefore with file descriptors > 1000. Tcl I/O leads to crashes whenever a select() is called with high file descriptors (e.g. on async I/O, which is used often with timeouts, etc.).

There are so few calls to ns_sendmail in all packages such it seems much better to define (and use) an ad_sendmail, which calls then the favorite version ...

I had errors with acs-mail-lite (some procs like sweeper). Problem was that email server (I mean, connection between mail server and openacs) doesn't seem to work.

I solved that checking email configuration (I had a simple "localhost" insteead of "full qualified domain")

And I also had some problems (package requiere mime and package require base64) but it were solved installing tcllib (apt-get install tcllib in debian)

It's working fine now thanks!

Anyway, this renaming error will now show up again. I've replaced the renaming of ns_sendmail by a simple redefinition in the oacs-5-8 branch. The implementation of ns_sendmail based on acs_mail_lite::send is just needed for the transition period until the deprecated command will be removed. The usage of ns_sendmail was deprecated by the release of OpenACS 5.6.0.
As I can remember, my problem was solved when email configuration (mailhost parameter in config file) was right.
i am aware of that.