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.
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.
--
TWiki:Main.KwangErnLiew
- 04 Aug 2007