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

Item4110: Do not display email confirmation when no mailhost is set up

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Registration Low No Action Required   n/a  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

When {SMTP}{MAILHOST} or SMTPMAILHOST is undefined, it is unecessary to send off a confirmation email on registration. I've made changes to Register.pm and messages.tmpl to reflect on the changes. Basically checking whether the variable is defined, and parse accordingly.

Not a big issue at all. Just consistency stuff. smile

Register.pm

--- lib/TWiki/UI/Register.pm   2007-03-03 15:45:57.000000000 +0100
+++ lib/TWiki/UI/Register.pm   2007-05-21 21:06:33.389104641 +0200
@@ -832,17 +832,27 @@
         $status = $session->{i18n}->maketext(
             'Warning: Could not send confirmation email')."\n\n$status";
     } else {
-        $status = $session->{i18n}->maketext(
-            'A confirmation e-mail has been sent to [_1]',
-            TWiki::entityEncode( $data->{Email} ));
-    }
 
-    # and finally display thank you page
-    throw TWiki::OopsException( 'attention',
-                                web => $TWiki::cfg{UsersWebName},
-                                topic => $data->{WikiName},
-                                def => 'thanks',
-                                params => [ $status ] );
+        # don't display confirmation text if SMTP not set up
+        my $mailhost = $TWiki::cfg{SMTP}{MAILHOST} || TWiki::Func::getPreferencesValue( "SMTPMAILHOST" );
+        if ($mailhost)  {
+            $status = $session->{i18n}->maketext(
+                'A confirmation e-mail has been sent to [_1]',
+                TWiki::entityEncode( $data->{Email} ));
+
+            # and finally display thank you page
+            throw TWiki::OopsException( 'attention',
+                                        web => $TWiki::cfg{UsersWebName},
+                                        topic => $data->{WikiName},
+                                        def => 'thanks',
+                                        params => [ $status ] )
+        } else {
+            throw TWiki::OopsException( 'attention',
+                                        web => $TWiki::cfg{UsersWebName},
+                                        topic => $data->{WikiName},
+                                        def => 'thanks' )
+        }
+    }
 }
 
 #Given a template and a hash, creates a new topic for a user

messages.tmpl

--- templates/messages.tmpl   2007-03-03 15:45:56.000000000 +0100
+++ templates/messages.tmpl   2007-05-21 20:41:47.728256638 +0200
@@ -135,7 +135,7 @@
    * %MAKETEXT{"You can review your changes in your personal TWiki topic [_1]" args="%TOPIC%"}% <br />
      %MAKETEXT{"(__Suggestion:__ How about uploading your picture to your topic?)"}%
    * %MAKETEXT{"You are also listed in the [_1] topic" args="%MAINWEB%.%WIKIUSERSTOPIC%"}%
-%PARAM1%
+%IF{"$param1=''" else="%URLPARAM{param1}%"}%
 %TMPL:END%
 %TMPL:DEF{"reset_ok"}%
 %PARAM1%

-- TWiki:Main/KwangErnLiew - 21 May 2007

Huh? I SMTP isn't set up then /usr/bin/sendmail is used to send the mail. This change doesn't make sense, sorry. Rejected.

CC

It would make sense if there's no need of sending ANY mails for whatever reason simply because nothing is setup for SMTP. It has less to do with SMTP than the need of sending confirmation emails.

-- TWiki:Main.KwangErnLiew - 02 Aug 2007

Hm, nevermind. I just found out about clearing MailProgram to enable that 'feature'

Now it disables quite a good warning message

============ Warning: Could not send confirmation email

No mail handler available ============

Makes sense to me now. wink

-- TWiki:Main.KwangErnLiew - 04 Aug 2007

ItemTemplate
Summary Do not display email confirmation when no mailhost is set up
ReportedBy TWiki:Main.KwangErnLiew
Codebase

SVN Range TWiki-4.1.2, Fri, 18 May 2007, build 13796
AppliesTo Engine
Component Registration
Priority Low
CurrentState No Action Required
WaitingFor

Checkins

TargetRelease n/a
ReleasedIn

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-08-04 - TWikiUserMapping_KwangErnLiew
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback