Hi
I am retrying to have GM and LSQL under mod_perl
This is my startup.pl file:
use lib '/path/to/gm/admin';
use lib '/path/to/lsql/admin';
use GMail::mod_perl;
use Links::mod_perl;
1;
This is what i have in the environment page for both:
GM:
System Information
======================================
Perl Version: v5.8.1
Gossamer Mail Version: 2.2.0
DBI.pm Version: 1.42
MIME::Base64 Version: 3.01
Digest::MD5 Version: 2.33
Persistant Env: mod_perl (1) SpeedyCGI (0)
Mod Perl Version: 1.29
@INC =
/path/to/gm/admin
../..
/path/to/lsql/admin
/usr/lib/perl5/5.8.1/i686-linux
/usr/lib/perl5/5.8.1
/usr/lib/perl5/site_perl/5.8.1/i686-linux
/usr/lib/perl5/site_perl/5.8.1
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
.
/usr/local/apache/
/usr/local/apache/lib/perl
$!: No such file or directory LSQL
System Information ======================================
Perl Version: 5.008001
Links SQL Version: 2.1.2
DBI.pm Version: 1.42
Persistant Env: mod_perl (1) SpeedyCGI (0)
Mod Perl Version: 1.29
@INC =
/path/to/gm/admin
../..
/path/to/lsql/admin
/usr/lib/perl5/5.8.1/i686-linux
/usr/lib/perl5/5.8.1
/usr/lib/perl5/site_perl/5.8.1/i686-linux
/usr/lib/perl5/site_perl/5.8.1
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
.
/usr/local/apache/
/usr/local/apache/lib/perl
Then I try to use the following FileMan Mod in GM at user end to upload a File:
Code:
#!/usr/bin/perl
#----------------------------------------------------------------------------------------------
# x2concepts.com - FileMan add-on script for Gossamer Mail
#
# Website : http://www.x2concepts.com/
# Email : <EDITED>
#----------------------------------------------------------------------------------------------
# Copyright (c) 2001 Charlie piper. All rights reserved
# * Redistribution in part or in whole strictly prohibited
#
# Lib GT
# Copyright (c) 2001
Gossamer Threads Inc. http://www.gossamer-threads.com All Rights Reserved.
# Redistribution in part or in whole strictly prohibited. Please
# see LICENSE file for full details.
#
# Description:
# Launches fileman if user is authed in GMail
#
#**********************************************************************************************
# NOTE
# ** Fix the lib path below and the shebang line at the very top
# of this script **
# Pragmas
use strict;
use lib '/path/to/gmail/admin'; # You need to fix this path
# Internal modules
use GMail qw{:user_returns :objects :states};
use GMail::Auth;
use GMail::NoAuth;
#GMail->reset_env if ($GMail::PERSIST);
GMail::init('/path/to/gmail/admin');
$|=1;
# Good debugging
local $SIG{__DIE__} = \&GMail::fatal;
# Used when retrieving remote POP messages. Local for mod perl
local($SIG{TERM}, $SIG{ALRM}, $SIG{PIPE});
# Start
&main;
sub main {
# ------------------------------------------------------------------------------------
# Auth sub from webmail.cgi
#
# If this site is disabled display the disabled page
if (!$CFG->{enabled}) {
return GMail->print_page('disabled.htm');
}
# Authenticate the user.
$GMail::Auth::error ||= ''; # -w warnings, ugg
my $ret;
if (!($ret = $PLG->dispatch('GMail::Auth::authenticate', sub { GMail::Auth->authenticate() }))) {
my $t = GMail->template_set();
$IN->param(t => [$t]);
$CFG->load_template_set($t);
require GT::Template::Inheritance;
# If authentication fails while checking pop, then send them to a special page.
if ($IN->param('check_pop') and GT::Template::Inheritance->get_path(file => $CFG->{templates}->{pop_noauth}, path => "$CFG->{location}->{path}->{data}/templates/$t", use_local => 1, use_inheritance => 1)) {
return GMail->print_page($CFG->{templates}->{pop_noauth});
}
return GMail::NoAuth->auth_failed({ error => $GMail::Auth::error });
}
return $ret if $ret == EXIT;
fileman();
}
sub fileman {
# ------------------------------------------------------------------------------------
# fileman by piper
#
my ($self) = @_;
my ($user, $domain, $domain_prefix, $domain_suffix);
($user, $domain) = split(/\@/, $USER->{email});
($domain_prefix, $domain_suffix) = split(/\./, $domain);
require GT::FileMan;
my $fileman = GT::FileMan->new(
cfg => {
template_root => $CFG->{location}->{path}->{data} . '/admin/templates/fileman',
html_root_url => $CFG->{location}->{url}->{images} . '/fileman',
root_dir => "/home/g-host/$domain_suffix/$domain_prefix/$user",
debug_level => 0,
wintnt => $^O eq 'MSWin32' ? 1 : 0,
command_time_out=> 20,
allowed_space => 5242880, # 5 MB?
},
commands => {
cmd_search => 1,
cmd_replace => 1,
cmd_command => 0, # Not a good command to have enable for just any user
cmd_upload => 1,
cmd_editor => 1,
cmd_passwd => 0, # Just Not Needed
cmd_show_passwd => 0, # Just Not Needed
cmd_makedir => 1,
cmd_preferences => 0, # Disabled Link
cmd_edit => 1,
cmd_download => 1,
cmd_copy => 1,
cmd_delete => 1,
cmd_move => 1,
cmd_chmod => 1,
cmd_tail => 1,
cmd_perl => 0, # Disbaled
cmd_diff => 1,
cmd_tar => 1,
cmd_help => 1, #New Version Help Documentation
},
url_opts => 'do=fileman'
);
$fileman->process();
exit;
}
When both GM and LSQL are under mod_perl, the File is uploaded with no permissions at all.
When only GM is under mod_perl, files are uploaded with correct permissions.
Also, when both GM and LSQL are under mod_perl, the Environment section of GM has following (as already boldened above)
$!: No such file or directory When i remove LSQL from mod_perl the above from GM is not there
What am i missing? Why does the file permissions are not shown (in fact it is ---------) and the checkbox is greyed out for the uploaded file though the ownership is correct when both GM and LSQL are under mod_perl. When only GM is under mod_perl, the permission is 644 which is corerct.
TIA
Anup