kevinoid / auth-mailbox-joomla

Plugin for Joomla! to authenticate users against a mail server using IMAP, NNTP, or POP3.
GNU General Public License v2.0
6 stars 0 forks source link

Problem on 3.0.3 #5

Closed ghost closed 11 years ago

ghost commented 11 years ago

I have tested your auth-mailbox on 2.5 and it worked perfect. We are now going to move to a 3.0.3 install and I installed your version for 3x and set it up the same but cannot get it to work. I have tried every combo I can think of and even tried another imap account and still cannot get it to work. I just keep getting two errors. one: Failed to authenticate: %s and the other: Username and password do not match or you do not have an account yet.

kevinoid commented 11 years ago

Thanks for using it and reporting the error. Looks like the "Failed to authenticate: %s" message is because the error message translations aren't being loaded properly, I'll start tracking that down. I think the only matching error message is if the imap_open function is missing. Could you confirm that the PHP IMAP module is installed and, if so, what version is being used? The information will be available in the output of the phpinfo(); function.

ghost commented 11 years ago

php-imap is installed version 5.3.3 according to the yum output.
This is a test machine with a fresh version of CentOS 6 and Joomla 3.0.3

I just uninstalled and reinstalled it and now I only get the error about the password not matching.

From phpinfo:

imap IMAP c-Client Version 2007e SSL Support enabled Kerberos Support enabled

On 04/15/2013 09:50 PM, Kevin Locke wrote:

Thanks for using it and reporting the error. Looks like the "Failed to authenticate: %s" message is because the error message translations aren't being loaded properly, I'll start tracking that down. I think the only matching error message is if the |imap_open| function is missing. Could you confirm that the PHP IMAP module is installed and, if so, what version is being used? The information will be available in the output of the |phpinfo();| function.

— Reply to this email directly or view it on GitHub https://github.com/kevinoid/auth-mailbox-joomla/issues/5#issuecomment-16423845.

ghost commented 11 years ago

Additional follow-up: I have been working with it a bit more and now I only get the error below. I have double checked the username and password.

    Warning

Authentication to mailbox server failed

On 04/15/2013 09:50 PM, Kevin Locke wrote:

Thanks for using it and reporting the error. Looks like the "Failed to authenticate: %s" message is because the error message translations aren't being loaded properly, I'll start tracking that down. I think the only matching error message is if the |imap_open| function is missing. Could you confirm that the PHP IMAP module is installed and, if so, what version is being used? The information will be available in the output of the |phpinfo();| function.

— Reply to this email directly or view it on GitHub https://github.com/kevinoid/auth-mailbox-joomla/issues/5#issuecomment-16423845.

kevinoid commented 11 years ago

What are the plugin settings for "Allow Plaintext Password" and "Protocol Encryption"? By default I disallow plaintext (PLAIN) passwords, but almost all IMAP servers require them. And they're safe as long as TLS is required.

ghost commented 11 years ago

I have tried every combo of this and none work. The 2.5 and 3.x installs are on different machines. Could I be missing something else in my install?

On the 2.5 install this works: (I tried this same setup on the 3.0 install)

Incl mail domian YES Protocal IMAP Port 143 All plain YES Encryption None

On 04/15/2013 10:46 PM, Kevin Locke wrote:

What are the plugin settings for "Allow Plaintext Password" and "Protocol Encryption"? By default I disallow plaintext (PLAIN) passwords, but almost all IMAP servers require them. And they're safe as long as TLS is required.

— Reply to this email directly or view it on GitHub https://github.com/kevinoid/auth-mailbox-joomla/issues/5#issuecomment-16425168.

ghost commented 11 years ago

The more I look into this I think it might be a server problem. I just installed 2.5 on this test box and it does not work with your plugin.
Could I be missing something in my php setup? Or server setup?

On 04/15/2013 10:46 PM, Kevin Locke wrote:

What are the plugin settings for "Allow Plaintext Password" and "Protocol Encryption"? By default I disallow plaintext (PLAIN) passwords, but almost all IMAP servers require them. And they're safe as long as TLS is required.

— Reply to this email directly or view it on GitHub https://github.com/kevinoid/auth-mailbox-joomla/issues/5#issuecomment-16425168.

kevinoid commented 11 years ago

The "Authentication to mailbox server failed" message (not followed by a specific error message) indicates that imap_open failed and imap_errors didn't return an array to tell us what happened. If you have access to the IMAP server, do its logs have anything useful to add?

Try creating a new PHP file on your server with the following content:

<?php
$mailboxStream = imap_open("{server.example.com/service=imap/readonly/novalidate-cert}", "username", "password", OP_READONLY | OP_HALFOPEN);
if ($mailboxStream) {
    print("Connected!");
    imap_close($mailboxStream);
} else {
    print("Failed: " . implode('<br />', imap_errors()));
}
?>

Where "server.example.com", "username", and "password" are replaced as appropriate. Then browse to the PHP file and let me know what happens.

ghost commented 11 years ago

I am getting an error: Failed: Can't connect to mail.---------.com,143: Permission denied

On 04/15/2013 11:28 PM, Kevin Locke wrote:

|<?php $mailboxStream = imap_open("{server.example.com/service=imap/readonly/novalidate-cert}", "username", "password", OP_READONLY | OP_HALFOPEN); if ($mailboxStream) { print("Connected!"); imap_close($mailboxStream); } else { print("Failed: " . implode('
', imap_errors())); } ?>|

kevinoid commented 11 years ago

Hmmm. "Permission denied" instead of "Connection refused" or "Authentication failed"... Sounds like the PHP process isn't able to make an outgoing connection to the mail server. Could it be an issue with SELinux or another security mechanism on the web server?

ghost commented 11 years ago

Oh now I feel dumb. It was SELinux. I was thinking I had disabled it but I was only disabling it per session. Thank you for your help.

kevinoid commented 11 years ago

Glad you got it figured out! I've also tracked down the error message formatting issue, which will be fixed in the next version. Hopefully that will make it a little easier to troubleshoot in the future.

ghost commented 11 years ago

Kevin:

I have a feature request. Since you are logging into a IMAP server is it possible to check the number of unread emails and deliver that to the user? Something that would check the number and it could be displayed "You have x unread emails" And give an option to launch into the web-mailbox? Would this be possible?

On 04/16/2013 08:37 AM, Kevin Locke wrote:

Glad you got it figured out! I've also tracked down the error message formatting issue, which will be fixed in the next version. Hopefully that will make it a little easier to troubleshoot in the future.

— Reply to this email directly or view it on GitHub https://github.com/kevinoid/auth-mailbox-joomla/issues/5#issuecomment-16444909.

kevinoid commented 11 years ago

Although it would be technically possible and I can see it being a useful feature for some users, it's beyond the scope that I have in mind for the plugin.

If you (or another developer) would like to add the feature, I'd be happy to answer any questions you might have about the plugin internals. But it's not something that I'm planning to implement personally.

Sorry.