Koozali.org: home of the SME Server

PHPList and SME 7.5.1

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
PHPList and SME 7.5.1
« on: November 13, 2010, 06:15:51 PM »
Has anyone managed to get PHPList working properly on the current version of SME (7.5.1)?
I used it on SME Server a long time ago and it was working fine, but now I just can't seem to get it working. Most of it works fine but I just CANNOT get the import function to work whatsoever.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: PHPList and SME 7.5.1
« Reply #1 on: November 13, 2010, 09:33:36 PM »
Most of it works fine but I just CANNOT get the import function to work whatsoever.
Any error messages in the logfiles or on screen? You do not give us much to go at. Please remember we do not know the steps you took and can not see the screens you observe.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Re: PHPList and SME 7.5.1
« Reply #2 on: November 13, 2010, 10:35:05 PM »
Cactus, thanx for the reply

Sorry, the question was aimed at anyone who tried installing phplist on sme, then he would know exactly what i am talking about.

I have used PHPList on SME Server in the past but something has changed either in the newer version of PHPList or (most likely) in SME Server. I have searched the net for months now but just can't get the import function to work.

When trying to import from a file I get this error:
Quote
Fatal Error: Something went wrong while uploading the file. Empty file received. Maybe the file is too big, or you have no permissions to read it.

When trying to import from an imap account I get this error:
Quote
Fatal Error: can't connect: Can't open mailbox {:143/imap/notls}: invalid remote specification
Error: Cannot continue

I have notice there is no server name before the port number (and there should be) . It seems like the variables $server, $user password $password in import3.php are empty (or not passed)

I have also checked all possible log files and the event log of PHPList, but can see no errors or clues.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: PHPList and SME 7.5.1
« Reply #3 on: November 14, 2010, 08:37:45 AM »
When trying to import from a file I get this error:
[codeFatal Error: Something went wrong while uploading the file. Empty file received. Maybe the file is too big, or you have no permissions to read it.[/code]
How large is the file you are uploading? Did you check the limits in the PHP file against your file size?

When trying to import from an imap account I get this error:
Code: [Select]
Fatal Error: can't connect: Can't open mailbox {:143/imap/notls}: invalid remote specification
Error: Cannot continue
There could indeed be an issue with the host you are specifying, but things have changed regarding the IMAP accessibility, I'm not sure if port 143 allows for no TLS based connections. I remember some recent changes on that topic.

Found some references:

I have also checked all possible log files and the event log of PHPList, but can see no errors or clues.
Which would that be? Does that include /var/log/httpd/error_log and /var/log/httpd/access_log? Did you already enable the display error message to see if PHP would spit an error at you like this: http://wiki.contribs.org/PHP#Display_Error_Messages
« Last Edit: November 14, 2010, 08:43:20 AM by cactus »
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Re: PHPList and SME 7.5.1
« Reply #4 on: November 14, 2010, 09:02:12 AM »
The file size doesn't matter, I have even tried a test file with only 3 email addresses in.

No issue with the host, i have enabled no TLS connections:
Code: [Select]
config show imap
imap=service
    ConcurrencyLimit=400
    ConcurrencyLimitPerIP=12
    TCPPort=143
    access=public
    status=enabled

The part in the import3.php file that handles the imap info looks like this:
Code: [Select]
function getImapFolders($server,$user,$password) {
  $port =  "143/imap/notls";
  $mbox = @imap_open("{".$server.":".$port."}",$user,$password,OP_HALFOPEN);
  if (!$mbox) {
    Fatal_Error($GLOBALS['I18N']->get("can't connect").": ".imap_last_error());
    return 0;
   }

But those variables ($server,$user,$password) are empty and should contain the info entered on the import page. if I hard code values in those variables the imap connection works:
Code: [Select]
function getImapFolders($server,$user,$password) {
  $server = 'localhost';
  $user = 'sales';
  $password = 'mypassword';
  $port =  "143/imap/notls";
  $mbox = @imap_open("{".$server.":".$port."}",$user,$password,OP_HALFOPEN);
  if (!$mbox) {
    Fatal_Error($GLOBALS['I18N']->get("can't connect").": ".imap_last_error());
    return 0;
   }

And yes, that includes /var/log/httpd/error_log and /var/log/httpd/access_log, enabling PHP Display Errors also shows nothing.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: PHPList and SME 7.5.1
« Reply #5 on: November 14, 2010, 09:41:53 AM »
No issue with the host, i have enabled no TLS connections:
Code: [Select]
config show imap
imap=service
    ConcurrencyLimit=400
    ConcurrencyLimitPerIP=12
    TCPPort=143
    access=public
    status=enabled
We can not conclude you did that from above information. AFAIK TLS related options are set in qpsmtpd configuration like below as described in the references I provided you.

Code: [Select]
config setprop qpsmtpd TlsBeforeAuth 0
signal-event email-update

However that is not the first issue to worry about as you seem to have a more serious problem:

The part in the import3.php file that handles the imap info looks like this:
Code: [Select]
function getImapFolders($server,$user,$password) {
  $port =  "143/imap/notls";
  $mbox = @imap_open("{".$server.":".$port."}",$user,$password,OP_HALFOPEN);
  if (!$mbox) {
    Fatal_Error($GLOBALS['I18N']->get("can't connect").": ".imap_last_error());
    return 0;
   }

But those variables ($server,$user,$password) are empty and should contain the info entered on the import page. if I hard code values in those variables the imap connection works:
Then you should investigate where the function is called from and trace it back to where the server, username, password variables are defined. My guess is you need to check the configuration parameters, most likely these should be defined in there. If they are defined properly in your configuration file something in between blanks them.

This seems more a PHPList error to me than a SME Server error. Does PHPList not have documentation or support?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: PHPList and SME 7.5.1
« Reply #6 on: November 14, 2010, 09:44:38 AM »
A quick investigation on the PHPList site in their documentation yields some debugging options for PHPList: http://docs.phplist.com/PhpListConfiguration

Did you read their docs? Did you already try the debugging options?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: PHPList and SME 7.5.1
« Reply #7 on: November 14, 2010, 09:48:06 AM »
Looking a little further I also found this: http://docs.phplist.com/ImportUsersInfo

Did you configure a proper temporary directory that is accessible by the web server user keeping in mind PHP Open BaseDir restrictions?
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Re: PHPList and SME 7.5.1
« Reply #8 on: November 14, 2010, 10:32:42 AM »
It is definitely not a phplist issue, when moving the installation to another webserver (not SME) then it works fine.
The variables are not defined in the configuration, but you type them in on the import page, then click submit, then the error comes up.

Quote
We can not conclude you did that from above information. AFAIK TLS related options are set in qpsmtpd configuration like below as described in the references I provided you.
If I hardcode the values in the variables the imap connection works fine, therefor my mail server is not the problem.

Quote
Did you read their docs? Did you already try the debugging options?
Yes, everything I could find.

Quote
Did you configure a proper temporary directory that is accessible by the web server user keeping in mind PHP Open BaseDir restrictions
Yes, the temporary directory is within the BaseDir restrictions and is writable by the webserver.

Mu UN-educated guess is that it must have something to with the PHP setup on SME, I also tried using PHP5, and no luck.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: PHPList and SME 7.5.1
« Reply #9 on: November 14, 2010, 10:57:30 AM »
It is definitely not a phplist issue, when moving the installation to another webserver (not SME) then it works fine.
The variables are not defined in the configuration, but you type them in on the import page, then click submit, then the error comes up.
No, you can not state that for certain until you find and resolve the issue.

If I hardcode the values in the variables the imap connection works fine, therefor my mail server is not the problem.
True, which leads me to believe that the problem is in the PHPList code (perhaps accompanied with a setting, but we still need to find that out). The default PHP settings have not changed from 7.5 to 7.5.1 AFAIK.

Mu UN-educated guess is that it must have something to with the PHP setup on SME, I also tried using PHP5, and no luck.
My educated guess is that it isn't. Please do not assume that PHPList is not at fault because it runs out of the box on other machines, simply because of the fact that when you hard code the values it also works on SME Server. That change is in the PHPList code and not in anything related to SME Server.

AFAICT the problem is that the variables are not set when the getImapFolders() function is called. So you need to find out where that function is called from and find out why the variables are not set. The symptom is that the values are not set, but you still have not determined the cause, you only found a way to work around that issue.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Gert

  • *****
  • 208
  • +0/-0
    • http://www.huge.co.za
Re: PHPList and SME 7.5.1
« Reply #10 on: November 14, 2010, 11:43:25 AM »
I've got a feeling that the season why the variables is not set is the same as the reason it says: "Fatal Error: Something went wrong while uploading the file. Empty file received. Maybe the file is too big, or you have no permissions to read it" when trying to upload a file. Maybe that is a variable issue too.

Quote
The default PHP settings have not changed from 7.5 to 7.5.1 AFAIK.
It use to work with a MUCH older version if SME, definitely not 7.5 or 7.4.

I am most certain that it is not a bug in SME, just an incompatibility, would love to know what causes it. I have spend hours and hours but just reaching dead ends. I am sure there must be more people wanting to run PHPList on SME.

Offline lieou

  • 1
  • +0/-0
Re: PHPList and SME 7.5.1
« Reply #11 on: November 16, 2010, 04:49:09 PM »
Hello, I've just read your writings and I am fighting with the same issue.
I would like to assert that almost for sure it is a PHPlist problem, since I am having the same problem (I don't use SME 7.5.1) and in their forum there are some unresolved threats about that from 2006. Somebody said that it is a bug that came with newest version.
So this is the point:
We want to import users from IMAP account (3° option in importing users offered by PHPlist), but the system gives back the following error: Can't open mailbox {:143/imap/notls}: invalid remote specification

Please everybody here, could we try to solve the issue one time for ever. I am sure it would be a great contribute to a lot of people here.

Thank you very much to whoever will try to help us on that.

Lieou