cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]
http://cypht.org
GNU Lesser General Public License v2.1
979 stars 154 forks source link

Unable to save this server, are the username and password correct? #727

Open XargonWan opened 1 year ago

XargonWan commented 1 year ago

💬 Question

Whatever server I add, I got the following error: Unable to save this server, are the username and password correct?. I tried google login, google IMAP, microsoft IMAP without any success.

I am running a test server with the default composer file:

version: '3'
services:
  db:
    image: mariadb:10
    volumes:
      - ./db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=root_password
      - MYSQL_DATABASE=cypht
      - MYSQL_USER=cypht
      - MYSQL_PASSWORD=cypht_password
  cypht:
    image: sailfrog/cypht-docker:latest
    volumes:
      - ./cypht/users:/var/lib/hm3/users
    ports:
      - "8888:80"
    environment:
      - CYPHT_AUTH_USERNAME=admin
      - CYPHT_AUTH_PASSWORD=admin_password
      - CYPHT_DB_CONNECTION_TYPE=host
      - CYPHT_DB_HOST=db
      - CYPHT_DB_NAME=cypht
      - CYPHT_DB_USER=cypht
      - CYPHT_DB_PASS=cypht_password
      - CYPHT_SESSION_TYPE=DB

I don't know where the logs are located as with docker logs it prompt me the nginx logs.

Any help?

kroky commented 1 year ago

Hi, I just tested the stock docker-compose running on port 8888 and it sucessfullu connects with an IMAP server. It also displays the emails just fine. Google driver might need some special auth, I suggest you first test with another IMAP server.

The error message you see is connected with a failure to authenticate with remote IMAP server with provided credentials. There are no more logs that could be helpful. You can basically run Cypht in debug mode and have the logs appear either on-screen or logged to the standard php error log.

XargonWan commented 1 year ago

Hi, I just tested the stock docker-compose running on port 8888 and it sucessfullu connects with an IMAP server. It also displays the emails just fine. Google driver might need some special auth, I suggest you first test with another IMAP server.

The error message you see is connected with a failure to authenticate with remote IMAP server with provided credentials. There are no more logs that could be helpful. You can basically run Cypht in debug mode and have the logs appear either on-screen or logged to the standard php error log.

Thanks for your prompt reply.

How can I run it in debug mode?

marclaporte commented 1 year ago

The debug mode is documented in https://github.com/cypht-org/cypht/blob/master/INSTALL

FYI, Google and Microsoft nowadays usually restrict traditional IMAP access. My suggestions:

  1. See https://github.com/cypht-org/cypht/wiki/OAUTH2-over-IMAP
  2. As Victor indicated, "first test with another IMAP server."
  3. Make sure Google and Microsoft are set up for traditional IMAP with another mail client (ex.: Claws Mail)
XargonWan commented 1 year ago

I found GMX that is serving IMAP, it's working on my Thunderbird but not on Cypht: I got Authentication failure and even in debug mode I got no clues why. Basically what I'm trying to understand is if Cypht is retaining the emails in the database or not as I need to do some operations on my emails.

kroky commented 1 year ago

Yes, that's odd. Might be problems with SSL and docker or another thing - I see their IMAP is pretty standard (https://support.gmx.com/pop-imap/imap/server.html)

Note that cypht is a client only - it doesn't store messages, so it relies 100% on the remote IMAP server to read and display messages.

marclaporte commented 1 year ago

@XargonWan If you can provide SSH access to an environment with the issue, a Cypht team member (@josaphatim) can troubleshoot.

XargonWan commented 1 year ago

Unfortunately not, however I set it up on an azure linux vm and even there I had the same issue, both native and docker.

marclaporte commented 1 year ago

@XargonWan I really want to help and to do so, I need SSH access to an environment exhibiting the issue.

marclaporte commented 4 months ago

@XargonWan please

marclaporte commented 4 days ago

@XargonWan Last call :-)