docker-mailserver: [BUG]: RSPAMD needs a password for the web interface

📝 Preliminary Checks

  • I tried searching for an existing issue and followed the debugging docs advice, but still need assistance.

👀 What Happened?

The documentation says

Rspamd provides a web interface, which contains statistics and data Rspamd collects. The interface is enabled by default and reachable on port 11334.

This doesn’t mention the need to setup a custom password that is needed to get into the web interface.

The documentation also mentions that DMS doesn’t set a password but only provides an option to disable it altogether:

DMS does not set a default password for the controller worker. You may want to do that yourself. In setups where you already have an authentication provider in front of the Rspamd webpage, you may want to set the secure_ip option to “0.0.0.0/0” for the controller worker to disable password authentication inside Rspamd completely.

I’ll work on a PR that will ad a section to the documentation that explains how to add the password and therefore enable the WebUI by utilizing the custom config file but I think that this should be an option in DMS as the UI is enabled by default.

👟 Reproduction Steps

  1. See the docs
  2. Open port 11334 in the container
  3. Connect to the web interface
  4. See password prompt
  5. See rspamd documentation to know that must set a password in order to be able to log in

🐋 DMS Version

v13.3.1

đŸ’» Operating System and Architecture

Debian GNU/Linux 11 (bullseye) aarch64

⚙ Container configuration files

Not relevant

📜 Relevant log output

Not relevant

Improvements to this form?

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (11 by maintainers)

Most upvoted comments

Please note that this response was created using generative AI, leveraging previously available information from the repository. This information may be helpful. However, it is our strong recommendation that you carefully consider the information before blindly applying it.


Para configurar uma senha para o acesso Ă  interface web do Rspamd no Docker Mail Server (DMS), vocĂȘ precisarĂĄ criar ou modificar um arquivo de configuração personalizado. Aqui estĂŁo os passos que vocĂȘ pode seguir:

  1. Criar o Arquivo de Configuração Personalizado: Primeiro, vocĂȘ precisa criar um arquivo chamado worker-controller.inc dentro do diretĂłrio de configuração do Rspamd no DMS. Este diretĂłrio geralmente Ă© mapeado para docker-data/dms/config/rspamd no host ou /tmp/docker-mailserver/rspamd/ dentro do contĂȘiner.

  2. Definir a Senha no Arquivo de Configuração: No arquivo worker-controller.inc, vocĂȘ deve definir a senha para o trabalhador do controlador. Adicione a seguinte linha ao arquivo:

    password = "sua_senha_secreta";
    

    Substitua "sua_senha_secreta" pela senha que vocĂȘ deseja usar.

  3. Reiniciar o ContĂȘiner do DMS: ApĂłs modificar ou criar o arquivo de configuração, vocĂȘ precisarĂĄ reiniciar o contĂȘiner do DMS para que as alteraçÔes tenham efeito. VocĂȘ pode fazer isso com o seguinte comando Docker:

    docker restart nome_do_seu_contĂȘiner
    
  4. Acessar a Interface Web: ApĂłs o reinĂ­cio, vocĂȘ pode acessar a interface web do Rspamd no navegador usando o endereço http://<seu_endereço_ip>:11334. VocĂȘ serĂĄ solicitado a inserir a senha que configurou.

Essas instruçÔes devem ajudĂĄ-lo a configurar a senha para a interface web do Rspamd no Docker Mail Server. Se vocĂȘ encontrar algum problema, verifique os logs do contĂȘiner para possĂ­veis erros relacionados Ă  configuração do Rspamd.

This comment was generated by Glime.

LOL the options are wrong and in Portuguese! XD

@jiriks74 , on Saturday I started using DMS again. I use (and highly recommend) Caddy as my reverse proxy. I still have a “mystery” to solve but I managed to configure the password to access the RSPAMD web interface by doing the following:

  1. get the password hash
docker exec -it mail /bin/bash
root@mail:/# rspamadm pw
Enter passphrase: my-secret-password
$2$prr46knpibphrur7kap1xgxpqc6ggf7s$akyskngdoprw98hpaoq38a38dqgyi3e8d7juqx7joese7zeaf5oy
  1. create the file that will configure RSPAMD
cat << 'EOF' | tee ~/docker/mail/config/rspamd/custom-commands.conf > /dev/null
set-option-for-controller secure_ip "172.18.0.0/16 1.1.1.1/32 8.8.8.8/32"
set-option-for-controller password "$2$prr46knpibphrur7kap1xgxpqc6ggf7s$akyskngdoprw98hpaoq38a38dqgyi3e8d7juqx7joese7zeaf5oy"
set-option-for-controller enable_password "$2$prr46knpibphrur7kap1xgxpqc6ggf7s$akyskngdoprw98hpaoq38a38dqgyi3e8d7juqx7joese7zeaf5oy"
EOF

On my test server, in my user folder, I have a “docker” folder where I create subfolders for the containers/stacks I use. In the case of DMS this folder is ~/docker/mail/. The config folder is created inside this folder and within it the rspamd folder which will have the custom-commands.conf file. Then when the container runs the configuration is adjusted.

The “mystery” that remains to be resolved is that RSPAMD should not ask for passwords for IPs that I have defined as “secure”. But it keeps asking for the password.

I hadn’t touched DMS in a long time. The project has improved a lot (congratulations to the developers and collaborators) and the documentation is great too.

If you’re not familiar with reverse proxies, the port concern is what they excel at avoiding 😃

Yes but I already have traefik that exposes 80 and 443 to the internet. I also use it for retrieving the Let’s Encrypt certificates for DMS.

I have multiple services (eg. my website, Gitea, Opengist, asciinema, OpenProject, 
) running on the domain so the ports are not available due to them being used by an existing proxy server.

Yeah that’s fantastic, thanks for taking the time to contribute for the benefit of others, much appreciated! ❀

It’s the least I can do after I’m making use of something that’s provided for free and open-source.

No worries if you want to avoid all that

I kinda want to avoid spinning up unnecessary containers as the host isn’t that powerful. Also I’d still have to figure out how to turn the password off which is not that clear in the docs. The change I proposed was adding some guidance on creating the password using the custom config file with some further discussion on possible integrations here.

I think that for my use case it’s better to change the password rather than spin up a new container, learn new config (in case I want to change something) and change ports on some other container because 80, and others, are already used.

We’re trying to avoid accepting any more ENV that effectively adjust one config line. I understand the convenience but it was becoming a problem as more niche PRs tried to get an ENV into DMS that updated a single line of config for them. This isn’t something that warrants a new ENV.

That’s a problem I wasn’t aware of and I totally understand why you wouldn’t want to add another env option. I thing that after knowing this (and not writing this at 12AM - envs are easier to leak) I think that the addition to the docs is the best way to solve this.