• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4576: Improve how emailing is enabled and disabled in TWiki especially for registration

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Urgent Closed   minor 4.2.0

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


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] 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. frown

-- 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:

  1. Have a single switch for all email-requiring options in configure, or if that's too risky:
  2. Improve the doc in TWiki.spec to ensure the email options are inter-related

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 frown

-- 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

Summary Improve how emailing is enabled and disabled in TWiki especially for registration
ReportedBy TWiki:Main.ThomasWeigert
Codebase 4.1.2, 4.2.0
SVN Range TWiki-4.2.0, Wed, 05 Sep 2007, build 14735
AppliesTo Engine

Priority Urgent
CurrentState Closed

Checkins TWikirev:15110 TWikirev:15115 TWikirev:15118 TWikirev:15120
TargetRelease minor
ReleasedIn 4.2.0
Edit | Attach | Watch | Print version | History: r23 < r22 < r21 < r20 < r19 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r23 - 2008-01-22 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback