On a freshly installed TWiki 4.1.2, Registration fails consistently.
The registration process actually succeeds, but after that we end up with an internal server error (500) writing the following into the apache error log:
[Fri Sep 07 19:15:05 2007] [error] [client 131.151.90.145] malformed header from script. Bad header=TWiki Administrator <>... User: register, referer:
http://xxxx.xxxx.xxxx/helptwiki/bin/oops/Main/TWikiRegistration?template=oopsattention;def=confirm;param1=xxxxxxxx
The url we are on is
http://xxxx.xxxx.xxxx/helptwiki/bin/register?action=verify&code=ThomasWeigert.5900031291
However, this problem occurs whether verification is turned on for registration or not.
I am sorry to report this, but there is not much to go on in the above log. Did anybody else see this problem? Or have any idea what might be the cause?
The twiki seems operational otherwise. After this, I can log in and log out, and edit files. But it worries me that I am getting this server error.
--
TWiki:Main/ThomasWeigert - 08 Sep 2007
We saw this once before; IIRC the oops template was wrong somehow. It just affects displaying the confirmation after successful registration. Sorry, I can't remember any more detail.
--
TWiki:Main.CrawfordCurrie - 08 Sep 2007
Thanks. I'll take a look.
--
TWiki:Main.ThomasWeigert - 08 Sep 2007
OK, I think I found the culprit.
In TWiki::UI::Registration::_emailRegistrationConfirmations, line 981, an attempt is made to send some email. This email was not successful, and an error is written to the output which is the "TWiki Administrator <>... User: register" above.
This is not good. If a user does not have email correctly set up on his or her machine, that should not lead them to think that TWiki is broken.
--
ThomasWeigert - 08 Sep 2007
Note that this particular email attempt is also made when the system is configured not to ask for verification.
So far it has not been the case that TWiki requires a working email setup in order to function. If we presuppose this, we should actually state that in the system requirements.
--
ThomasWeigert - 08 Sep 2007
Do you have a valid administrator email address defined in configure?
--
TWiki:Main.KennethLavrsen - 08 Sep 2007
No, I purposefully did not.
Nevertheless, a user might do exactly so, thinking that it is not necessary for them to use email, or they may not be capable to do so (sendmail is a horrible beast, and even Net::SMTP might cause problems), or they are on a standalone machine and are never expecting to use emails.
I confirm that if the email is set and can be sent, then this particular problem does not occur.
Note that there is another problem, for which I submit a separate bug.
--
ThomasWeigert - 08 Sep 2007
There has been a lot of feature requests against the e-mail subsystem to make it behave more "user-friendly?" in the initial TWiki installation set up process.
Unfortunately, it doesn't seem to be a high developer priority and current compromise has been reached only though a lot of debate.
(Therefore configure is also very explicit in stating:
"To disable all outgoing email from TWiki leave both this field and the MAILHOST field below blank." - I am not entirely sure that is what you have done in your setup.)
I have downgraded to Normal, but if you are willing to invest energy in this item yourself please upgrade again.
--
TWiki:Main.SteffenPoulsen - 08 Sep 2007
I will test whether indeed this disables the outgoing mails.
Note however, that the configure comment is rather cryptic. In the same breath it says
*Net::SMTP is installed in this environment, so this setting will not be used* . This led me to believe that things would work as I expected, as I did not have a MAILHOST defined, and this field was supposed to be not used per the comment.
--
ThomasWeigert - 09 Sep 2007
I tested by removing all information in configure relevant to mail, in particular the two settings discussed above.
The result is that if one leaves the registration setting to email verification on, then registration now fails with an oops dialog saying
Internal error when sending email to weigert@umr.edu.
Please contact 0.
You have *not* been registered
The dialog is oopsattention/registration_mail_failed. Note that this is certainly the wrong behavior. I just did everything that the manual said I need to do so that
no mail will be sent, but I get an error because it tried to send mail!
I realize that this is a partial user error as the user had turned off mail function, but left email verification on.
However, these are in different setting sections, so the user might miss this. It might be better to have an explicit setting to turn all mail features off and then test whenever mail functions are invoked whether this setting is on or off.
I think that also we should not write error text to the page, as TWiki::UI::Registration::_emailRegistrationConfirmations did, see my report above.
--
ThomasWeigert - 09 Sep 2007
Yes; in the interests of improving the installation experience I raised this to Urgent and changed the headline from "Server error in twiki registration" to "Too many mail dependencies". What I believe needs doing is:
- Have a single switch for all email-requiring options in configure, or if that's too risky:
- Improve the doc in TWiki.spec to ensure the email options are inter-related
CC
from my recollection of the code (1) is simple - Koen - I presume you're on this already?
--
TWiki:Main.SvenDowideit - 15 Sep 2007
I haven't actually done the work yet, but i will very soon. Had some urgent $dayjob stuff get in between my intentions and reality
--
TWiki:Main.KoenMartens - 20 Sep 2007
Well, here is what i did:
- Created a setting 'EnableEmail', that toggles email
- Changed/added email related warnings, among which a warning for when email is disabled but NeedVerification is true
- Changed the errors on registration, confirmation and password change when email is not enabled
- Have TWiki::Net::sendEmail() return an appropriate error when called and email is disabled
--
KoenMartens - 01 Oct 2007