stalwartlabs / mail-server

Secure & Modern All-in-One Mail Server (IMAP, JMAP, POP3, SMTP)
https://stalw.art
4.8k stars 194 forks source link

[bug]: The webadmin should use config.resource.webadmin instead of S3 #524

Closed williamdes closed 3 months ago

williamdes commented 3 months ago

What happened?

2024-06-09T13:50:31.165856Z  WARN jmap: Failed to unpack webadmin bundle. event="error" error=InternalError("S3 error: reqwest: error sending request for url (https://10.10.xx.xx:3900/my-bucket-name/knkectcxifjfix7xivbecrcnjfha): error trying to connect: received corrupt message of type InvalidContentType")
2024-06-09T13:50:31.166032Z ERROR utils::config: Build error for key "*": Failed to access webadmin blob: Internal Error: S3 error: reqwest: error sending request for url (https://10.10.xx.xx:3900/my-bucket-name/knkectcxifjfix7xivbecrcnjfha): error trying to connect: received corrupt message of type InvalidContentType

I was thinking that I could set to a file: config.resource.webadmin = "file:///mnt/storage/mail-storage/webadmin.zip" But it does nothing. And since the service restart I have no more webadmin access.

How can we reproduce the problem?

Using Garage for S3

Version

v0.8.x

What database are you using?

SQLite

What blob storage are you using?

SQLite

Where is your directory located?

LDAP

What operating system are you using?

Linux

Relevant log output

No response

Code of Conduct

williamdes commented 3 months ago

It looks like sending an email does the same error

2024-06-09T13:57:16.086830Z ERROR session{instance="submissions" protocol=Smtp remote.ip="xxx" remote.port=41634}: smtp::queue::spool: Failed to write to blob store: Internal Error: S3 error: reqwest: error sending request for url (<redacted>/bnxu0hvzytoih2a9hc2knuhpiwpmnydelqcuczu9szazy7rgrkla): error trying to connect: received corrupt message of type InvalidContentType context="queue" event="error"
williamdes commented 3 months ago

maybe the code should use put_object_with_content_type

williamdes commented 3 months ago

Well well well, using https (not specifying any protocol) instead of http for the S3 URL was the reason for InvalidContentType... Maybe the error could be better

williamdes commented 3 months ago

Only one item left for this issue, why does config.resource.webadmin = "file:///mnt/storage/mail-storage/webadmin.zip" not work as it should override the S3 bucket management for the web admin ?

mdecimus commented 3 months ago

Hi,

I am closing as this seems like a configuration issue. Your S3 server is rejecting the requests made by Stalwart, but it seems that you have already corrected this. Yes, config.resource.webadmin will override the default settings but this will path will not be used until you download the next webadmin update. This path specifies where the webadmin bundle is downloaded from but not where it is stored, which is your blob store.

williamdes commented 3 months ago

Hi,

I am closing as this seems like a configuration issue. Your S3 server is rejecting the requests made by Stalwart, but it seems that you have already corrected this. Yes, config.resource.webadmin will override the default settings but this will path will not be used until you download the next webadmin update. This path specifies where the webadmin bundle is downloaded from but not where it is stored, which is your blob store.

Okay, could you add some lines and an example to the documentation please ? It was really unclear for me. Could this enhancement be re-opened to provide a way for the webadmin to be fetched from the file and not downloaded at all. This would be more in the idea of https://github.com/stalwartlabs/mail-server/issues/533 where no internet access exists

mdecimus commented 3 months ago

Could this enhancement be re-opened to provide a way for the webadmin to be fetched from the file and not downloaded at all.

It is already possible:

config.resource.webadmin = "file:///path/to/webadmin.zip"
williamdes commented 3 months ago

Could this enhancement be re-opened to provide a way for the webadmin to be fetched from the file and not downloaded at all.

It is already possible:

config.resource.webadmin = "file:///path/to/webadmin.zip"

Well, it did not work I have to try once more