Author Topic: settings in main.inc.php not sticking  (Read 4854 times)

Offline genec

  • Newbie
  • *
  • Posts: 5
settings in main.inc.php not sticking
« on: July 01, 2010, 12:03:27 PM »
I'm new to RoundCube.  I'v just installed it from packages on Ubuntu and have it up and running.  However, I have an issue where some of the settings that I've put into main.inc.php don't appear to be doing anything.

Specifically, I only want access through https (on port 5555), so I have this setting:
$rcmail_config['force_https'] = 5555;

Despite that, if I go to my.server.com, I can access it just fine.  It also works through https://my.server.com:5555/roundcube, but, as the setting says, I want to "force" access through https only.

My second issue is the imap host setting.  I am presented with an empty box for the host on the login screen.  I want the default host to be set.  Actually, I'd prefer to have no option there at all and to automatically go to the default host.  I'll tinker with the template to hide that field, but in the mean time, this setting in main.inc.php reads:
$rcmail_config['default_host'] = 'ssl://localhost';
But that doesn't appear to be having any effect.

Any advice on these two issues?

Thanks!

Gene

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
settings in main.inc.php not sticking
« Reply #1 on: July 02, 2010, 12:55:52 AM »
1. What version of RoundCube are you using? Maybe this problem #1486411 (force_https to new port not working) ? Roundcube Webmail

2. I have never had this problem, I have used every version of RoundCube and whenever I specify a host in $rcmail_config['default_host'] the box has disappeared. Hate to ask but are you sure your uploading the main.inc.php right?

Offline genec

  • Newbie
  • *
  • Posts: 5
settings in main.inc.php not sticking
« Reply #2 on: July 02, 2010, 07:15:09 PM »
Quote from: skaero;28447
1. What version of RoundCube are you using? Maybe this problem #1486411 (force_https to new port not working) ? Roundcube Webmail


I'm using version 0.3.1-3, but my problem seems unrelated to that bug.  I applied the patch anyway, but it didn't help.

Quote
2. I have never had this problem, I have used every version of RoundCube and whenever I specify a host in $rcmail_config['default_host'] the box has disappeared. Hate to ask but are you sure your uploading the main.inc.php right?


main.inc.php is where it was installed by the package.  I do know that when I moved it, roundcube wouldn't work.  So it's not being completely ignored.  I'm also not getting any logging, whether to a file or to syslog, making it that much harder to debug this problem.

So, I've just been putting some error_log() statements in the code.  I only found one place where the force_https setting is used, in index.php, so I put error_log() statements in the code at various places before that.  Unfortunately, after the second line of code:


// init application and start session with requested task
$RCMAIL rcmail::get_instance();


The error_log() statements stopped working, so then I tried writing directly to STDERR, and I found that  $RCMAIL->config->get('force_https'false) returns nothing.  That's about as far as I got in the debugging so far.  How can I print out the entire contents of the rcmail_config?


Thanks!

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
settings in main.inc.php not sticking
« Reply #3 on: July 03, 2010, 01:45:02 PM »
I wonder if your overwriting the config variables. To check all of the rcmail_config settings create a new php file in RoundCube's root folder and put:

<?php
include('config/main.inc.php');

echo 
'<pre>';
print_r($rcmail_config);
echo 
'</pre>';
?>

Post the results.

Offline genec

  • Newbie
  • *
  • Posts: 5
settings in main.inc.php not sticking
« Reply #4 on: July 15, 2010, 01:26:20 AM »
skaero, here's what I get:

Array
(
    [
debug_level] => 1
    
[log_driver] => file
    
[log_date_format] => d-M-Y H:i:s O
    
[syslog_id] => roundcube
    
[syslog_facility] => 8
    
[log_dir] => logs/
    [
temp_dir] => temp/
    [
plugins] => Array
        (
        )

    [
enable_caching] => 
    [
message_cache_lifetime] => 10d
    
[force_https] => 
    [
auto_create_user] => 1
    
[default_host] => 
    [
default_port] => 143
    
[imap_auth_type] => 
    [
imap_root] => 
    [
imap_delimiter] => 
    [
username_domain] => 
    [
mail_domain] => 
    [
virtuser_file] => 
    [
virtuser_query] => 
    [
smtp_server] => 
    [
smtp_port] => 25
    
[smtp_user] => 
    [
smtp_pass] => 
    [
smtp_auth_type] => 
    [
smtp_helo_host] => 
    [
smtp_log] => 1
    
[sql_debug] => 
    [
imap_debug] => 
    [
ldap_debug] => 
    [
smtp_debug] => 
    [
sendmail_delay] => 0
    
[list_cols] => Array
        (
            [
0] => subject
            
[1] => from
            
[2] => date
            
[3] => size
            
[4] => flag
            
[5] => attachment
        
)

    [
skin_include_php] => 
    [
session_lifetime] => 10
    
[ip_check] => 
    [
double_auth] => 
    [
des_key] => Uowtzv[2G[1]bjjafW1uz1fe
    
[language] => en_US
    
[date_short] => D H:i
    
[date_long] => d.m.Y H:i
    
[date_today] => H:i
    
[useragent] => RoundCube Webmail/RCMAIL_VERSION
    
[product_name] => RoundCube Webmail
    
[drafts_mbox] => Drafts
    
[junk_mbox] => Junk
    
[sent_mbox] => Sent
    
[trash_mbox] => Trash
    
[default_imap_folders] => Array
        (
            [
0] => INBOX
            
[1] => Drafts
            
[2] => Sent
            
[3] => Junk
            
[4] => Trash
        
)

    [
create_default_folders] => 
    [
protect_default_folders] => 1
    
[quota_zero_as_unlimited] => 
    [
mdn_requests] => 0
    
[default_charset] => ISO-8859-1
    
[enable_spellcheck] => 1
    
[spellcheck_engine] => pspell
    
[spellcheck_uri] => 
    [
spellcheck_languages] => 
    [
generic_message_footer] => 
    [
http_received_header] => 
    [
http_received_header_encrypt] => 
    [
mail_header_delimiter] => 
    [
session_domain] => 
    [
address_book_type] => sql
    
[ldap_public] => Array
        (
        )

    [
autocomplete_addressbooks] => Array
        (
            [
0] => sql
        
)

    [
dont_override] => Array
        (
        )

    [
identities_level] => 0
    
[include_host_config] => 
    [
max_pagesize] => 200
    
[mime_magic] => /usr/share/file/magic
    
[message_sort_col] => date
    
[message_sort_order] => DESC
    
[enable_installer] => 
    [
log_logins] => 
    [
delete_always] => 
    [
min_keep_alive] => 60
    
[email_dns_check] => 
    [
skin] => default
    [
pagesize] => 40
    
[timezone] => auto
    
[dst_active] => 1
    
[prefer_html] => 1
    
[show_images] => 0
    
[htmleditor] => 
    [
prettydate] => 1
    
[draft_autosave] => 300
    
[preview_pane] => 
    [
focus_on_new_message] => 1
    
[logout_purge] => 
    [
logout_expunge] => 
    [
inline_images] => 1
    
[mime_param_folding] => 1
    
[skip_deleted] => 
    [
read_when_deleted] => 1
    
[flag_for_deletion] => 
    [
keep_alive] => 60
    
[check_all_folders] => 
    [
display_next] => 
    [
index_sort] => 1
)


I don't think it's picking up any of my settings in main.inc.php.  I know that main.inc.php is being read because my debugging message is being printed to stderr, so the settings must be overwritten somewhere as you suspected.  Any clues as to why and where?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
settings in main.inc.php not sticking
« Reply #5 on: July 15, 2010, 03:39:59 PM »
The /config/main.inc.php file is just a list of variables with that has no interaction with the rest of RoundCube when listed that way. Can you give me access to the server so I can look at the files and try to see whats going on.

Offline genec

  • Newbie
  • *
  • Posts: 5
settings in main.inc.php not sticking
« Reply #6 on: September 11, 2010, 08:15:38 PM »
By the way, I finally figured out what the  problem was.  main.inc.php had three concatenated copies of the original file.  I had put my changes in at the top, but then the second and third copy overwrote my edits.  I don't know if I had somehow done that or if that's what was packaged, but I'd guess the former.