Gossamer Forum
Home : Products : Gossamer Mail : Discussion :

Gmail+LSQL under mod_perl and Fileman Problems

Quote Reply
Gmail+LSQL under mod_perl and Fileman Problems
Hi.

While trying to get GM and LSQL under mod_perl, things run fine.
However, when trying to use FileMan (from GMail)

Editing, saving, new File all is OK.
While Uploading a file the files is uploaded with permission colum showing all

---------

Removed LSQL from mod_perl and the permissions went correct even for upload.
Never tried the fileman utility of LSQL

This is observed both on the old server and also on the new server that im shifting to.

Any clues.

TIA
Anup

[EDIT] LSQL and GM are under different domains.
GM loaded first in startup.pl
GM 2.2.0 LSQL 2.1.2
[/EDIT]

Last edited by:

anup123: Apr 2, 2004, 2:52 PM
Quote Reply
Re: [anup123] Gmail+LSQL under mod_perl and Fileman Problems In reply to
Hi.

To add to the above,

When using FileMan of GM (with both GM and LSQL under mod_perl), found that it was refering to FileMan.pm of LSQL. In startup.pl, the GM loads before LSQL and the LSQL Virtual Host is Above GM Vistual Host.

When tried the same with GF and GM on same subdomain (both under mod_perl) never found such a problem of File man uploading with fiels having no permission at all.) It's only with GT products on two different domains that such abnormality was observed (both on the old as well as the new server).

What could the reasons be?? I have removed every thing except for GM from running under mod_perl.

TIA
Anup
Quote Reply
Re: [anup123] Gmail+LSQL under mod_perl and Fileman Problems In reply to
Hi.

I have moved everything to new setup server and the old server ns has been shut down.

In case GT would want to check upon the fact that why there are certain conflicting issues while running two GT products under different domains, the old server is still available for a few days before it is taken off. There is no problems for access now to the out going server.

In case it can be done i can pm the shell login details. The GT products have been configured on IP address.

Thanks
Anup
Quote Reply
Re: [anup123] Gmail+LSQL under mod_perl and Fileman Problems In reply to
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

Last edited by:

anup123: Apr 8, 2004, 1:35 PM
Quote Reply
Re: [anup123] Gmail+LSQL under mod_perl and Fileman Problems In reply to
Can you try to change filemans' configuration like:

my $fileman = GT::FileMan->new(
cfg => {
upload_chmod => '644',
....
}
.....
);

TheStone.


B.
Quote Reply
Re: [TheStone] Gmail+LSQL under mod_perl and Fileman Problems In reply to
Hi.

I had to edit the Commands.pm file for both LSQL and GMail and the problem was gone. I had to comment out and add the following to the


# Change mode
# my $octal_perm = oct($self->{cfg}->{upload_chmod});
# Permissions have to be in octal.
# chmod ($octal_perm, $fullfile);
chmod(0644, $fullfile);

Changing only in the GMail part did not solve the issue and so i had to edit the Compose.pm's of the FileMan of both GMail and LSQL which brings me to the next query:

The startup.pl has this

use lib '/path/to/gmail/admin',
'/path/to/lsql/admin';
use GMail::mod_perl;
use Links::mod_perl;
1;

What is not clear to me is why i had to edit the Commands.pm of LSQL FileMan to get the error off?

Then i reverted the Commands.pm's to original version and added yr suggestion. It worked. Thanks. I am still confused why i had to edit the LSQL FileMan Commands.pm ? ANyway, currently i am with your suggestion and orginal Commands.pm's

Thanks
Anup