Item8170: Can't locate Email/FolderType/Net.pm when running mailincron

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release:
Applies To: Extension
Component: MailInContrib
Branches:
Reported By: ChrisPurves
Waiting For:
Last Change By: CrawfordCurrie
I installed foswiki-mailincontrib 090204-195 from the debian repository.

After configuring the incoming email server and user I attempted to run mailincron as follows:

cd /usr/lib/cgi-bin/foswiki/
/var/lib/foswiki/tools/mailincron

I get the following error:

Can't locate Email/FolderType/Net.pm in @INC (@INC contains: /var/lib/foswiki/lib /etc/foswiki . /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /var/lib/foswiki/lib/Foswiki/Contrib/MailInContrib.pmline 30.
BEGIN failed--compilation aborted at /var/lib/foswiki/lib/Foswiki/Contrib/MailInContrib.pm line 30.
Compilation failed in require at /var/lib/foswiki/tools/mailincron line 29.
BEGIN failed--compilation aborted at /var/lib/foswiki/tools/mailincron line 29.

-- ChrisPurves - 01 Jun 2009

The following perl modules were not in Debian repositories and so I had to install from CPAN: Email::FolderType::Net, Email::Delete, Email::Folder::POP3

In addition, mailincron cound not find Email/Delete/POP3.pm which was located in /var/lib/foswiki/lib/CPAN/lib, so I created a softlink /var/lib/foswiki/lib/Email pointing to /var/lib/foswiki/lib/CPAN/lib/Email.

Things appear to be working now.

-- ChrisPurves - 01 Jun 2009

please let me know if this works without creating the extra symlink (you sure shouldn't have to do that):

Index: mailincron
===================================================================
--- mailincron  (revision 6768)
+++ mailincron  (working copy)
@@ -22,7 +22,11 @@
 use strict;

 BEGIN {
-    unshift @INC, '.';
+    if (-e './setlib.cfg') {
+       unshift @INC, '.';
+    } elsif (-e '../bin/setlib.cfg') {
+       unshift @INC, '../bin';
+    }
     require 'setlib.cfg';
 }

and/or maybe it's missing documentation? for example, mailnotify says:
 # Mail notification script. You must add the Foswiki bin dir to the
 # search path for this script, so it can find the rest of Foswiki e.g.
 # perl -I /usr/local/foswiki/bin /usr/local/foswiki/tools/mailnotify

i don't think this is anything debian-specific (except the paths), so i'm setting it to MailInContrib. if what i posted above does work, all tools scripts should be reviewed and updated.

i have created Item8726 for the missing debian dependencies, and i have raised the dependencies issue in Item2157 and in DebianPackagingTaskTeam

-- WillNorris - 18 Mar 2010

Sorry for taking so long to reply. I just tried the modification to mailincron; it had no effect. It looks to me that it boils down to lib/CPAN/lib missing from the INC path as described in Item230. Although this was apparently fixed a long time ago.

-- ChrisPurves - 13 Sep 2010

I modified LocalLib.cfg to replace

$CPANBASE = 1;
with
$CPANBASE = "/var/lib/foswiki/lib/CPAN/lib";

That did fix the problem. I suspect that the problem might be that the Debian packaged config files assume that all perl modules will come from Debian repositories and will not be installed from CPAN.

-- ChrisPurves - 13 Sep 2010

See Item8276

-- CrawfordCurrie - 07 May 2014

 

ItemTemplate edit

Summary Can't locate Email/FolderType/Net.pm when running mailincron
ReportedBy ChrisPurves
Codebase 1.0.5
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component MailInContrib
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r5 - 07 May 2014, CrawfordCurrie
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