Fresh installation, e-mail-validation fails, an unhandled server error has occured

Hello,

I’m new to Bitwarden, so please accept my apologies in case I ask anything really stupid.

I am able to install Bitwarden on a fresh Ubuntu 22 Server and I can successfully create my first (administrative) account and login. But I cannot validate the e-mail-address (“an unhandled server error has occured”).

First question: Do I need postfix in order to send an e-mail? I was trying to use our existing exchange-server.

Second question: Can you tell me, where the logs for this error are, so I can get more information on where to look? I’m a bit lost at the moment.

I would like to add my installation-routine so far:

# based on: https://www.how2shout.com/linux/how-to-install-bitwarden-server-on-ubuntu-20-04-22-04-lts-via-docker/

sudo vi /etc/apt/apt.conf.d/95proxies
Acquire::http::proxy "http://192.168.100.10:8080/";
Acquire::https::proxy "http://192.168.100.10:8080/";
Acquire::ftp::proxy "http://192.168.100.10:8080/";

sudo vi /etc/environment
http_proxy="http://192.168.100.10:8080/"
https_proxy="http://192.168.100.10:8080/"
ftp_proxy="http://192.168.100.10:8080/"
no_proxy="localhost,127.0.0.1,192.168.100.*,*.mydomain.local,::1"

sudo vi /etc/wgetrc
https_proxy = http://192.168.100.10:8080/
http_proxy = http://192.168.100.10:8080/
ftp_proxy = http://192.168.100.10:8080/
use_proxy = on

sudo vi ~/.curlrc
proxy = http://192.168.100.10:8080/

sudo vi /etc/systemd/timesyncd.conf
NTP=192.168.100.10
sudo timedatectl set-timezone Europe/Berlin
sudo systemctl restart systemd-timesyncd
timedatectl

sudo mkdir /media/netshare
sudo mount -t cifs -o username=<User>,password=<Password> //myfileserver/mynetshare /media/netshare
cd /media/netshare
sudo cp MyDomainRootCA.crt /usr/share/ca-certificates/MyDomainRootCA.crt
sudo cp MyDomainIssuingCA.crt /usr/share/ca-certificates/MyDomainIssuingCA.crt
sudo dpkg-reconfigure ca-certificates

sudo apt update
sudo apt upgrade
sudo apt autoremove
sudo apt autoclean

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo mkdir -p /etc/systemd/system/docker.service.d

sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://192.168.100.10:8080/"
Environment="HTTPS_PROXY=http://192.168.100.10:8080/"
Environment="NO_PROXY=localhost, 127.0.0.0/8, 192.168.100.0/24"

sudo vi /etc/systemd/system/docker.service.d/https-proxy.conf
[Service]
Environment="HTTP_PROXY=http://192.168.100.10:8080/"
Environment="HTTPS_PROXY=http://192.168.100.10:8080/"
Environment="NO_PROXY=localhost, 127.0.0.0/8, 192.168.100.0/24"

sudo apt install docker-ce docker-ce-cli containerd.io docker-compose
sudo systemctl daemon-reload
sudo systemctl restart docker

sudo mkdir /opt/bitwarden
sudo adduser bitwarden
sudo chmod -R 700 /opt/bitwarden
sudo chown -R bitwarden:bitwarden /opt/bitwarden
sudo usermod -aG docker bitwarden

su bitwarden
cd ~
curl -Lso bitwarden.sh https://go.btwrdn.co/bw-sh && chmod 700 bitwarden.sh
mkdir .docker
vi ~/.docker/config.json
{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://192.168.100.10:8080",
     "httpsProxy": "http://192.168.100.10:8080",
     "noProxy": "identity,localhost,127.0.0.1,192.168.100.*,*.mydomain.local"
   }
 }
}


./bitwarden.sh install
# mybitwardenserver
# n (Not Let's Encrypt)
# myvault
# Installation-ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
# Installation-Key: xxxxxxxxxxxxxxxxxxxx
# Self-signed-certificate

vi ~/bwdata/env/global.override.env
# [...]
globalSettings__mail__smtp__host=192.168.100.25
globalSettings__mail__smtp__port=465
globalSettings__mail__smtp__ssl=true
globalSettings__mail__smtp__username=Mailaccount
globalSettings__mail__smtp__password=MailAccoutPassword!9999
globalSettings__mail__smtp__trustServer=true
# [...]
[email protected]
# [...]

./bitwarden.sh rebuild
./bitwarden.sh start

# https://mybitwardenserver/#/login
# Create new account for [email protected]
# Login as [email protected]
# Validate e-mail
# "an unhandled server error has occured"

Best regards,

Changed ~/bwdata/env/global.override.env to

globalSettings__mail__smtp__port=25
globalSettings__mail__smtp__ssl=false

“The SMTP Server does not support authentication”

Sending e-mails via telnet works

telnet 192.168.100.25 25
helo test
mail from: [email protected]
rcpt to: [email protected]
data
Subject: Test

test

.

Hello,

I changed the settings in ~/bwdata/env/global.override.env to

globalSettings__mail__smtp__port=25
globalSettings__mail__smtp__ssl=false
globalSettings__mail__smtp__username=
globalSettings__mail__smtp__password=

This works (leaving username/password empty). :smile:
Since Bitwarden is for internal use only (not accessible via internet), that is kind of ok.
Of course it would be better, if port 465/ssl was working.
I hope I get my bitwarden working with my exchange.

Thread closed.