Tags:
create new tag
view all tags

Question

Using MailNotificationEnhanced, I get the following error after upgrading to CairoRelease and moving from AIX to SuSE LINUX.

Use of uninitialized value in concatenation (.) or string at ../lib/MailNotify.pm line 355.

MailNotificationEnhanced was working on the previous TWikiSite (pre-upgrade & pre-Linux). I have re-installed the ../bin/mailnotify and ../lib/MailNotify.pm and ../templates/mailnotify.tmpl .. as necessary after the upgrade.

I'm a TWiki veteran, but perl novice .. can somebody help me to get the enhanced notifications working again ?

Thanks, Keith

Environment

TWiki version: TWikiRelease02Sep2004
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: SuSE SLES 8
Web server: Apache/1.3.29 (Linux/SUSE)
Perl version: v5.8.3
Client OS: windoze 2000
Web Browser: IE 6
Categories: Mail

-- KeithHelfrich - 22 Dec 2004

Answer

Hi Keith, I have found that TWiki has main regexes in a regex hash named regex. So here is the solution I have tested on TWiki-2004-09-02.

replace the lines (MailNotify.pm Line:343 ...):

    # Allow Main as well as 'Main' in front of users/groups -
    # non-capturing regex.
    my %users= ();
    my $mainWebPattern = qr/(?:$TWiki::mainWebname|Main)/;
    my $wikiWordRegex=$TWiki::wikiWordRegex;
    my $emailAddrRegex=$TWiki::emailAddrRegex;

by these ones :

    # Allow Main as well as 'Main' in front of users/groups -
    # non-capturing regex.
    my %users= ();
    my $mainWebPattern = qr/(?:$TWiki::mainWebname|Main)/;
    my $wikiWordRegex=$TWiki::regex{wikiWordRegex};
    my $emailAddrRegex=$TWiki::regex{emailAddrRegex};

Tell me if it is ok for you too.

One great and nice thing would be to get these mail enhancements integrated in newt TWiki release. You may ask for it and maybe TWiki team will hear us wink

-- PatrickNomblot - 29 Dec 2004

definitely! Definitely !!! I will go now to submit a FeatureEnhancementRequest to ask that MailNotificationEnhanced functionality be added to TWiki core in the DakarRelease.

In the meantime, thanks so much for your help. The uninitialized value problem has indeed been fixed by your changes above. However, the script is still unable to send an email. The next problem (likely caused for similar reasons) is the following :

Undefined subroutine &TWiki::getRenderedVersion called at ../lib/MailNotify.pm line 106.

Line 106 is this one :

$emailbody = &TWiki::getRenderedVersion( $before );

Might I once again request your services in helping to fix this one ?

-- KeithHelfrich - 29 Dec 2004

Two issues:

  • Relative path in ../lib/MailNotify.pm: Specify an absolute path the twiki/bin/setlib.cfg
    • NEW Actually, absolute path is in setlib.cfg I have manually shortened the error messages to the relative path here in this topic as a simplification (and precaution to avoid giving away too much information about our server). Good call though, thanks. -- KeithHelfrich - 30 Dec 2004
  • Undocumented TWiki::getRenderedVersion call: Replace with TWiki::Func::renderText

FYI, upcoming TWiki will ship with MailerContrib, which will replace the current mailnotify script/functionality.

-- PeterThoeny - 30 Dec 2004

Thank you all for your help. I'm happy that this functionnality will exist on next TWiki release but, and this is maybe due to my poor English, I do not see the all possibilites we have in MailNotificationEnhanced... hope I will get ehough time to read more TWiki topics and maybe get a better understanding.

Here is MailNotify.pm adapted for 02 Sept 2004 TWiki.

-- PatrickNomblot - 30 Dec 2004

Hi Patrick ..

We're getting there .. making progress .. but not finished yet.

The new .pm you've attached now sends an email. But there is a problem after the email is sent :

Undefined subroutine &TWiki::formatGmTime called at ../lib/MailNotify.pm line 313.

Regarding inclusion of your enhanced features in MailerContrib - once again I agree. I've made my best argument for more attention to the subject in MailNotificationEnhancedRequest .. please read and respond in that topic. Seems this is a do it yourself world, I just wish I had the skills to help out.

-- KeithHelfrich - 30 Dec 2004

Keith, there was still a last formatGmtTime old TWiki function. This last version should be ok. I hope I will be able to rewrite MailNotify.pm with new MailerContrib interface.

DONE Yes, we have success ! It works now clean as a whistle ..

Thanks so much for all of your help. Great to have a working notification again.

My next challenge is to figure out a pretty HTML template for the email. Would you happen to know anything about that ? If you don't have the energy, then I certainly understand ..

Happy New Year !

-- KeithHelfrich - 31 Dec 2004

MailNotify had no real interface with TWiki and picked out variables and functions directly from TWiki.pm or other TWiki core. TWiki regexes rae now stored in a PERL hash so access to a regex has changed. Function to print date in GMT has changed too.

I will do my best to understand MailerContrib and hope that it is possible to build as powerfull functions as we have in MailNotificationEnhanced .

-- PatrickNomblot - 31 Dec 2004

Topic attachments
I Attachment History Action Size Date Who Comment
Perl source code filepm MailNotify.pm r2 r1 manage 20.2 K 2004-12-31 - 08:26 UnknownUser MailNotify fix for TWiki 2004
Edit | Attach | Watch | Print version | History: r13 < r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r13 - 2005-02-02 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.