This question about Configuration: Answered

Encode version 2.87 required--this is only version 2.51

I'm moving my Foswiki installation to another hosting company, and the configuration doesn't show any red or yellow exclamation marks anymore, except for the Mail settings.

If i try to send a a test mail, I get the following error, whatever mail method I choose:

Encode version 2.87 required--this is only version 2.51 at /home/web00929/domains/boossy.be/public_html/wiki/lib/CPAN/lib/Email/MIME/ContentType.pm line 7.

Full log attached: MailValidationError.txt

-- StijnBousard - 11 May 2019

This seems to be a bit strange - I'm not sure what is going on. Foswiki itself doesn't call out any version of Encode other than >2.01. I've checked my own system. It's using 2.82, and is working just fine.

The System.FoswikiServerInformation page shows all of the loaded perl modules and their versions. You might check with your hosting provider and see if they can get an updated version of Encode installed for you.

If that's not possible and you have command line access it's possible to build an updated Encode yourself and cause foswiki to use your version.

I just tested installing a new Encode locally using the following steps:
mkdir perlmod
cd perlmod
curl -L https://cpanmin.us/ -o cpanm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  295k  100  295k    0     0   428k      0 --:--:-- --:--:-- --:--:--  428k

chmod +x cpanm 
./cpanm -L . Encode
--> Working on Encode
Fetching http://www.cpan.org/authors/id/D/DA/DANKOGAI/Encode-3.01.tar.gz ... OK
Configuring Encode-3.01 ... OK
Building and testing Encode-3.01 ... OK
Successfully installed Encode-3.01 (upgraded from 2.72)
1 distribution installed

That's installed Encode in the current directory (perlmod). You then have to move the lib directory it created into the Foswiki installation. It needs to be placed into the lib/CPAN directory. (In recent Foswiki releases, that library is not shipped)

cd /var/www/foswiki/lib
mkdir CPAN
cd CPAN
cp -a <your-home-directory>/perlmod/lib .

After this is done, your directory should look something like:

/var/www/foswiki/lib/CPAN/lib/perl5/x86_64-linux-gnu-thread-multi

That last part is architecture dependent. So you may have something different there.

Last step, edit your bin/LocalLIb.cfg and adjust the localPerlLibPath to point to the new code

@localPerlLibPath = (   '/var/www/foswiki/distro/core/lib/CPAN/lib/perl5/x86_64-linux-gnu-thread-multi' );

And, with this is done, System.FoswikiServerInformation indeed shows the new version:

Encode 3.01 /var/www/foswiki/lib/CPAN/lib/perl5/x86_64-linux-gnu-thread-multi/Encode.pm
-- GeorgeClark - 12 May 2019

Using the above description, I successfully created the Encode module and installed it in Foswiki's lib/CPAN directory. Afterwards, I got the following error when trying to send a test e-mail: Cannot load package 'Email::MIME::Header::AddressList': Can't locate loadable object for module Email::Address::XS ...

Building the Email::MIME::Header::AddressList module using ./cpanm -L . Email::MIME::Header::AddressList didn't work: Can't locate Module/CoreList.pm in @INC ...

Then I found the following description on installing CPAN without root access: https://www.perlmonks.org/?node_id=1053274 This way, I was able to build the Email::MIME::Header::AddressList module => 22(!) distributions installed

After I copied these to Foswiki's lib/CPAN directory, I was able to send a test e-mail. So the problem is solved!

Thanks for all your efforts!

-- StijnBousard - 14 May 2019
 

QuestionForm edit

Subject Configuration
Extension
Version Foswiki 2.1.6
Status Answered
Related Topics
I Attachment Action Size Date Who Comment
MailValidationError.txttxt MailValidationError.txt manage 19 K 11 May 2019 - 08:11 StijnBousard  
Topic revision: r4 - 25 Jul 2019, StijnBousard
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy