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

Can't do secure authentication #10

Closed lopezsalexander closed 9 years ago

lopezsalexander commented 9 years ago

Greetings, I install the plugin but show this error:

Authentication to mailbox server failed: Can't do secure authentication with this server [CLOSED] IMAP connection broken (server response)

I try configuring as POP3 and disabled SSL but no start.

Mi configuration is:

Mail domain: myowndomain.com Include Mail Domain in Mailbox Username: No Mail Server: secure.emailsrvr.com Protocol: IMAP Create users: Yes Server Port: 993 Allow Plaintext Password: No Protocol Encryption: SSL Validate SSL Certificate: No Show Protocol Errors: Yes My Joomla is: 3.3.5 - PHP 5.4.20 - Apache.

kevinoid commented 9 years ago

Hi @lopezsalexander,

That sounds like a generic IMAP connection error rather than an error specific to the plugin, so we'll need to attempt to determine the correct settings. From the Rackspace documentation, my guess would be the following:

Mail domain: myowndomain.com Include Mail Domain in Mailbox Username: Yes Mail Server: secure.emailsrvr.com Protocol: IMAP Create users: Yes Server Port: 993 Allow Plaintext Password: Yes Protocol Encryption: SSL Validate SSL Certificate: Yes Show Protocol Errors: Yes

I've bolded the settings which I changed compared to the ones you posted. Validate SSL Certificate is optional, but should be a bit more secure for you. Although "Allow Plaintext Password" sounds like a security risk, since SSL is mandatory the password is always encrypted (just not using CRAM MD5 or one of the other password-specific encryption schemes).

Could you give those settings a try and confirm whether those work for you.

Thanks, Kevin

lopezsalexander commented 9 years ago

Thanks so much for you answer, but the plugin still fail. :(

I put my configuration accord the instructions and now show this message:

Authentication to mailbox server failed: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed. [CLOSED] IMAP connection broken (server response)

Change protocol to POP3 and port to 995 and show this:

Authentication to mailbox server failed: Can not authenticate to POP3 server: Authentication failed.

My passwords are ok, I try to login with exists accounts and new accounts, I used telnet for test my connection and it's ok. And use this code for test the account and its correct:

<?php
$mailboxStream = imap_open("{secure.emailsrvr.com/service=imap/readonly/novalidate-cert}", "mymail@cmymasesores.com", "mypassword", OP_READONLY | OP_HALFOPEN);
if ($mailboxStream) {
    print("Connected!");
    imap_close($mailboxStream);
} else {
    print("Failed: " . implode('<br />', imap_errors()));
}
?>

Thanks again

ghost commented 9 years ago

@lopezsalexander I am also using Rackspace as you are with this plugin. Please be sure you have php-imap installed. If memory serves me right that might be the issue.

For testing I found using the most simple Rackspace server was best. Here is what I used... Note: webmail.emailsrvr.com is one of their mail servers but only with port 143 - that is why I tried it first.

On plugin page: Put the domain name in the Mail Domain Check Yes for Inc. domain name For mail server use: webmail.emailsrvr.com Protocol: IMAP Create Users: Yes

Advance: Port 143 Plaintext: Yes Protocal: TLS Optional Validate SSL: No

If this works then try secure.

kevinoid commented 9 years ago

@lopezsalexander, thanks for trying that snippet of PHP. That's the perfect test and if it works there shouldn't be any reason for the mailbox plugin not to work (since all it does is build the arguments for imap_open then pass the result back to Joomla). So the issue should be something simple.

As I recall, Authentication failed. is the error message which occurs when the username/password don't match on the mailbox server (it may occur in other cases as well). So, just to confirm, the username that you are using to log in to Joomla must match the part of the email address before "@" and the "Mail Domain" configuration option must match the part after "@" (so you wouldn't log in to Joomla with a username matching your whole email address).

Although I recently added some debug-level logging to the plugin to print the exact arguments passed to imap_open, I haven't found an easy way to get Joomla to log at that level short of putting the installation into debug mode. If you'd like to give it a try, I described the process in a comment on issue #9. I'll see if I can improve the logging a bit to make this easier.

lopezsalexander commented 9 years ago

Thanks for your answers,

After to try the configuration reccomended by @mgdale and debbug this accord the instructions of @kevinoid , finally was able to connect the plugin and works so fine, the file jcontroller.log show this:

2014-10-02T14:21:34+00:00   DEBUG   -   Attempting Mailbox authentication using imap_open('{secure.emailsrvr.com:143/service=imap/readonly/novalidate-cert}', 'myaccount@myowndomain.com', *, 0x42, 1)
2014-10-02T14:21:34+00:00   DEBUG   -   Successfully authenticated myaccount via Mailbox authentication

And the configuration is: Mail domain: myowndomain.com Include Mail Domain in Mailbox Username: Yes Mail Server: secure.emailsrvr.com Protocol: IMAP Create users: Yes Server Port: 143 Allow Plaintext Password: Yes Protocol Encryption: TLS Validate SSL Certificate: No Show Protocol Errors: Yes

Thanks so much for all the support, I'm so happy for this. :smile:

kevinoid commented 9 years ago

Wonderful! Glad you were able to get it working!