the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
991 stars 117 forks source link

HestiaCP Install not working #1128

Closed LIFETAB closed 1 year ago

LIFETAB commented 1 year ago

Describe the bug I tried to use your v-add-sys-snappymail file to install snappymail on hestiacp, but i get errors.

To Reproduce Steps to reproduce the behavior:

  1. Install hestiacp
  2. Setup the domain and mail services
  3. Download the integration for hestiacp form this respository
  4. Put it into this directory /usr/local/hestia/bin and give it permissions.
  5. run v-add-sys-snappymail as root user in your terminal

Expected behavior I expected snappymail to install with no problems

Screenshots image

Please complete the following information:

I don' know i just used your integration script with hestiacp

Debug/logging information there are no except for the screenshot above

the-djmaze commented 1 year ago

Does the following work? wget "https://snappymail.eu/repository/latest.tar.gz" --retry-connrefused -O "/var/lib/snappymail/snappymail-latest.tar.gz"

LIFETAB commented 1 year ago

The command works, but the installation doesn't :/

image

LIFETAB commented 1 year ago

Can you fix it or help me out @the-djmaze? Maybe i'm doing something wrong idk.

the-djmaze commented 1 year ago

I might could fix it, but i don't have Hestia. Currently it is draft code and someone might do a better job at it.

Also see https://github.com/hestiacp/hestiacp/issues/2620

the-djmaze commented 1 year ago

Try with https://github.com/the-djmaze/snappymail/tree/master/integrations/hestiacp

bin/v-add-sys-snappymail to hestia bin/v-add-sys-snappymail install/deb/snappymail/install.php to hestia install/deb/snappymail/install.php

the-djmaze commented 1 year ago

I see more is needed. Working on it at https://github.com/the-djmaze/hestiacp

LIFETAB commented 1 year ago

Could you tell me when you have fixed it? Thank you!

the-djmaze commented 1 year ago

I can't as i don't use HestiaCP Someone should test and finish my code at https://github.com/hestiacp/hestiacp/pull/3590

LIFETAB commented 1 year ago

Okay

jaapmarcus commented 1 year ago

I can't as i don't use HestiaCP

Someone should test and finish my code at https://github.com/hestiacp/hestiacp/pull/3590

Working on it..

It should work right now...

LIFETAB commented 1 year ago

I can't as i don't use HestiaCP Someone should test and finish my code at hestiacp/hestiacp#3590

Working on it..

It should work right now...

yes i managed to get it to work, thank you for your work, but one more thing, the password change plugin failes to change the mail password for hestiacp in the webmail: image

I have installed and enabled the plugin password change and i also have the hestia driver from this respository, and i configured the plugin to access my hestia host and port

the-djmaze commented 1 year ago

When you enable debug log in application.ini or ?admin config. Then you can see in the log why it fails.

LIFETAB commented 1 year ago

Thank you! I've found the error, the plugin 'change_password' has the settings for hestia: "hestia_host" and "hestia_port". The driver for hestia in /plugins/change-password-hesita/driver.php expects a variable of "hestia_login",.

I would suggest to update this line in the driver for hesita: $sHost = $this->oConfig->Get('plugin', 'hestia_login'); to $sHost = $this->oConfig->Get('plugin', 'hestia_host');.

jaapmarcus commented 1 year ago

hestia_login

That fixes the issue...

LIFETAB commented 1 year ago

hestia_login

That fixes the issue...

What do you mean? I've changed the line in the driver to get the variable hestia_host from the snappymail plugin and use as the host url of hestia, before that it tried to get the variable hestia_login which is not existing in the plugin configuration, so it tried to access hestia at https://:8083/. Now its working correctly and accessing it with https://[url or ip of hestia]:8083/

jaapmarcus commented 1 year ago

https://github.com/the-djmaze/snappymail/pull/1135/commits/0ae7b11776a54fda4f7075025fc45b3d70a32912

LIFETAB commented 1 year ago

Oh, nvm I didn't notice you changed it. Btw thank you for such fast work on integrating snappymail into hestia :)

michelsouzams commented 1 year ago

Is it possible to install on a normal cpanel hosting like rainloop?

the-djmaze commented 1 year ago

jaapmarcus has improved and fixed my attempt and merged it into HestiaCP.

I've added it to the wiki. https://github.com/the-djmaze/snappymail/wiki/Installation-instructions#hestiacp

jaapmarcus commented 1 year ago

Will be released with 1.8 ...

michelsouzams commented 1 year ago

I want to install on a cpanel hosting account, it would not be on WHM. Normal hosting as I already do with Rainloop. It's possible ?

jaapmarcus commented 1 year ago

In your case you will need to download snappy mail and install it the same way as you did with Rainloop it should work fine.

How ever this is not related to this issue...

michelsouzams commented 1 year ago

I've tried that, "HTTP ERROR 500" appears.

About the topic, I didn't find anything about it.

jaapmarcus commented 1 year ago

Create a new issue. It is not related to this issue or HestiaCP

michelsouzams commented 1 year ago

Thanks!

demlasjr commented 1 year ago

Hi @the-djmaze, I just installed snappymail using the v-add-sys-snappymail command, everything installs just well but I cannot login into any email address, either admin panel. This is what I'm getting from the logs. I'm kinda lost trying to debug it.

[2023-08-17 11:25:10.042][a13636a2] [INFO]: [SM:2.28.4][IP:79.117.16.168][PID:224846][Apache/2.4.57 (Debian) mod_fcgid/2.3.9 OpenSSL/3.0.9][fpm-fcgi][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3][POST https://webmail.test.net/?/Json/&q[]=/0/] [2023-08-17 11:25:10.043][a13636a2] JSON[INFO]: Action: DoLogin

[2023-08-17 11:25:10.043][a13636a2] IMAP[INFO]: Start connection to "tcp://locahost:143"

[2023-08-17 11:25:10.049][a13636a2] IMAP[INFO]: < * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN AUTH=LOGIN] Mail Delivery Agent\r\n

[2023-08-17 11:25:10.049][a13636a2] IMAP[INFO]: > TAG1 AUTHENTICATE PLAIN ***\r\n [2023-08-17 11:25:12.052][a13636a2] IMAP[INFO]: < TAG1 NO [AUTHENTICATIONFAILED] Authentication failed.\r\n

[2023-08-17 11:25:12.052][a13636a2] IMAP[WARNING]: MailSo\Imap\Exceptions\NegativeResponseException: AUTHENTICATIONFAILED Authentication failed. in /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ResponseCollection.php:46 Stack trace:

0 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(542): MailSo\Imap\ResponseCollection->validate()

1 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(465): MailSo\Imap\ImapClient->getResponse()

2 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(181): MailSo\Imap\ImapClient->SendRequestGetResponse()

3 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(298): MailSo\Imap\ImapClient->Login()

4 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(238): RainLoop\Model\Account->netClientLogin()

5 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(418): RainLoop\Model\Account->ImapConnectAndLogin()

6 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(140): RainLoop\Actions->imapConnect()

7 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/User.php(44): RainLoop\Actions->LoginProcess()

8 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoLogin()

9 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()

10 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()

11 /var/lib/snappymail/snappymail/v/2.28.4/include.php(143): RainLoop\Service::Handle()

12 /var/lib/snappymail/index.php(11): include('...')

13 {main}

[2023-08-17 11:25:12.052][a13636a2] IMAP[NOTICE]: MailSo\Imap\Exceptions\NegativeResponseException: AUTHENTICATIONFAILED Authentication failed. in /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ResponseCollection.php:46 Stack trace:

0 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(542): MailSo\Imap\ResponseCollection->validate()

1 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(465): MailSo\Imap\ImapClient->getResponse()

2 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(181): MailSo\Imap\ImapClient->SendRequestGetResponse()

3 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(298): MailSo\Imap\ImapClient->Login()

4 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(238): RainLoop\Model\Account->netClientLogin()

5 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(418): RainLoop\Model\Account->ImapConnectAndLogin()

6 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(140): RainLoop\Actions->imapConnect()

7 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/User.php(44): RainLoop\Actions->LoginProcess()

8 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoLogin()

9 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()

10 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()

11 /var/lib/snappymail/snappymail/v/2.28.4/include.php(143): RainLoop\Service::Handle()

12 /var/lib/snappymail/index.php(11): include('...')

13 {main}

Next MailSo\Imap\Exceptions\LoginBadCredentialsException: AUTHENTICATIONFAILED Authentication failed. in /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php:241 Stack trace:

0 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(298): MailSo\Imap\ImapClient->Login()

1 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(238): RainLoop\Model\Account->netClientLogin()

2 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(418): RainLoop\Model\Account->ImapConnectAndLogin()

3 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(140): RainLoop\Actions->imapConnect()

4 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/User.php(44): RainLoop\Actions->LoginProcess()

5 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoLogin()

6 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()

7 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()

8 /var/lib/snappymail/snappymail/v/2.28.4/include.php(143): RainLoop\Service::Handle()

9 /var/lib/snappymail/index.php(11): include('...')

10 {main}

0 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(140): RainLoop\Actions->imapConnect()

1 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/User.php(44): RainLoop\Actions->LoginProcess()

2 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoLogin()

3 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()

4 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()

5 /var/lib/snappymail/snappymail/v/2.28.4/include.php(143): RainLoop\Service::Handle()

6 /var/lib/snappymail/index.php(11): include('...')

7 {main}

[2023-08-17 11:25:15.039][a13636a2] SERVICE[WARNING]: - AUTHENTICATIONFAILED Authentication failed. @ /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php#241 [2023-08-17 11:25:15.039][a13636a2] [ERROR]: MailSo\Imap\Exceptions\NegativeResponseException: AUTHENTICATIONFAILED Authentication failed. in /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ResponseCollection.php:46 Stack trace:

0 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(542): MailSo\Imap\ResponseCollection->validate()

1 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(465): MailSo\Imap\ImapClient->getResponse()

2 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php(181): MailSo\Imap\ImapClient->SendRequestGetResponse()

3 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(298): MailSo\Imap\ImapClient->Login()

4 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(238): RainLoop\Model\Account->netClientLogin()

5 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(418): RainLoop\Model\Account->ImapConnectAndLogin()

6 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(140): RainLoop\Actions->imapConnect()

7 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/User.php(44): RainLoop\Actions->LoginProcess()

8 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoLogin()

9 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()

10 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()

11 /var/lib/snappymail/snappymail/v/2.28.4/include.php(143): RainLoop\Service::Handle()

12 /var/lib/snappymail/index.php(11): include('...')

13 {main}

Next MailSo\Imap\Exceptions\LoginBadCredentialsException: AUTHENTICATIONFAILED Authentication failed. in /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/MailSo/Imap/ImapClient.php:241 Stack trace:

0 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(298): MailSo\Imap\ImapClient->Login()

1 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Model/Account.php(238): RainLoop\Model\Account->netClientLogin()

2 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(418): RainLoop\Model\Account->ImapConnectAndLogin()

3 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(140): RainLoop\Actions->imapConnect()

4 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/User.php(44): RainLoop\Actions->LoginProcess()

5 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoLogin()

6 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()

7 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()

8 /var/lib/snappymail/snappymail/v/2.28.4/include.php(143): RainLoop\Service::Handle()

9 /var/lib/snappymail/index.php(11): include('...')

10 {main}

Next RainLoop\Exceptions\ClientException: AuthError[102] in /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php:429 Stack trace:

0 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/UserAuth.php(140): RainLoop\Actions->imapConnect()

1 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Actions/User.php(44): RainLoop\Actions->LoginProcess()

2 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/ServiceActions.php(142): RainLoop\Actions->DoLogin()

3 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(132): RainLoop\ServiceActions->ServiceJson()

4 /var/lib/snappymail/snappymail/v/2.28.4/app/libraries/RainLoop/Service.php(14): RainLoop\Service::RunResult()

5 /var/lib/snappymail/snappymail/v/2.28.4/include.php(143): RainLoop\Service::Handle()

6 /var/lib/snappymail/index.php(11): include('...')

7 {main}

[2023-08-17 11:25:15.039][a13636a2] JSON[INFO]: {"Action":"Login","Result":false,"ErrorCode":102,"ErrorMessage":"","ErrorMessageAdditional":"AUTHENTICATIONFAILED Authentication failed.","epoch":1692271515} [2023-08-17 11:25:15.039][a13636a2] [INFO]: Memory peak usage: 2MB [2023-08-17 11:25:15.039][a13636a2] [INFO]: Time delta: 5.0003340244293 [2023-08-17 11:25:15.039][a13636a2] IMAP[INFO]: Disconnected from "tcp://localhost:143" (success)

Any idea? Thanks!