Author Topic: My installation simply died today without cause  (Read 4467 times)

Offline mkaatman

  • Newbie
  • *
  • Posts: 8
My installation simply died today without cause
« on: September 14, 2006, 03:42:06 PM »
I was using it earlier today and now I get a login failed whenever I try to login.

In the error log I simply get:
[14-Sep-2006 14:37:18 -0500] IMAP Error: Could not connect to mail.mydomain.com at port 143: in on line 0

Even though it's not displaying the file name in the error message, the file is imap.inc and the line it's erroring on is the fsockopen.

I can telnet to port 143 and get an IMAP response and I tried squirrelmail successfully as an additional IMAP client.

I'm really perplexed as to why I can't login all of the sudden. I double checked the database user/pass is valid and I even did an update from svn to try to latest with the same results.

Any clue as to where I should start troubleshooting this problem? It's also all users. Running courier on debian sarge as my imap server.

Update: I uncommented the @ on the fsockopen line 358 and I get some additional errors:
[14-Sep-2006 14:45:17] PHP Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/round/trunk/roundcubemail/program/lib/imap.inc on line 358
[14-Sep-2006 14:45:17] PHP Warning: fsockopen() [function.fsockopen]: unable to connect to mail.mydomain.com:143 (Unknown error) in /var/www/round/trunk/roundcubemail/program/lib/imap.inc on line 358

So I guess this isn't a roundcube mail problem but I'm not sure why it suddenly popped up. The domains are resolving fine on the system. Any clues?

If I manually add my domain to /etc/hosts everything works again.

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Re: My installation simply died today without cause
« Reply #1 on: September 19, 2006, 03:35:06 PM »
Yes, try this in a new PHP file:

<?php

// Test fsockopen
$host 'mail.mydomain.com';
$port 143;
$timeout 30;

/*** DO NOT EDIT BELOW THIS LINE ***/
$IMAP fsockopen($host$port$errno$errstr$timeout);

if(!
$IMAP)
  echo 
'<h3 style="color: #900;">ERROR!</h3><p>'$errno'
'
$errstr;
else
  echo 
'Everything is fine with PHP\'s fsockopen() function.';

@
fclose($IMAP);

?>


Put that in a new file, save it as fsocktest.php and upload it to your server. Report back what it says.

[edit]Updated script somewhat.[/edit]
 
  

Offline mkaatman

  • Newbie
  • *
  • Posts: 8
Re: My installation simply died today without cause
« Reply #2 on: September 19, 2006, 03:58:13 PM »
You had some errors in your script:
I modified it:

Code: [Select]
<?php
$host 
'webmail.mydomain.com';
$port 143;
$timeout 30;

$IMAP fsockopen($host$port$errno$errstr$timeout);


if(!
$IMAP){
  print(&
quot;ERROR Number: &quot;.$errno'<br />Error String: '$errstr);
}else{
  echo 
'Everything is fine with PHPs fsockopen() function.';
}

fclose($IMAP);

?>


And the results:
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /var/www/onlinedyno.com/htdocs/fsocktest.php on line 6

Warning: fsockopen() [function.fsockopen]: unable to connect to webmail.mydomain.com:143 (Unknown error) in /var/www/onlinedyno.com/htdocs/fsocktest.php on line 6
ERROR Number: 2048
Error String:
Warning: fclose(): supplied argument is not a valid stream resource in /var/www/onlinedyno.com/htdocs/fsocktest.php on line 15

If I switch to localhost it comes back with success because localhost is defined in /etc/hosts

Not sure why I'm getting DNS errors. I can resolve everything at the command line with no problems. Regardless, this doesn't appear to be a roundcube mail problem.

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Re: My installation simply died today without cause
« Reply #3 on: September 19, 2006, 04:07:54 PM »
Other than the one glaring error (PHP's) and the unsupressed error message with fclose(), it was all valid ;) You just need PHP 4 and it would have worked. There was nothing else wrong with the syntax (i.e. using , instead of . to concatenate a string in the echo statement, or leaving the {} braces off of the if()else() statement).

Ah, so we've discovered it's not a Roundcube issue. Well, that's good. I too for some odd reason have had issues with self-declared url that is the IMAP server, and it too does not work for whatever reason.

That's all the help I can offer you, you'd now have to talk to your host or someone who knows the *nix system better than I.

[edit]Okay, so my script had 2 issues with it:
1.) I mistakenly ended a string early with the "PHP's" conjunction. Oops.
2.) I didn't surpress errors with the fclose() call.

Both have been fixed, and the script should work fine now.[/edit]
 
  

Offline mkaatman

  • Newbie
  • *
  • Posts: 8
Re: My installation simply died today without cause
« Reply #4 on: September 19, 2006, 04:08:52 PM »
I am the host :-[

No less, localhost will solve my issue for now.