Bitwarden with onprem install and usage of local smarthost with TLS on port 25

Bitwarden’s SMTP service  does behave a bit weird without some settings in the /opt/bitwarden/bwdata/env/global.override.env file.

For allow TLS on port 25 use the option „globalSettings__mail__smtp__sslOverride=true“.

For not using SSL and fix the mail service to TLS use the option „globalSettings__mail__smtp__ssl=false“.

You can find more information in the logfiles in /opt/bitwarden/bwdata/logs/events.

Example:

globalSettings__mail__replyToEmail=sender@domain.tld
globalSettings__mail__smtp__host=relay.domain.tld
globalSettings__mail__smtp__port=25
globalSettings__mail__smtp__ssl=false
globalSettings__mail__smtp__username=<not needed for open relay>
globalSettings__mail__smtp__password=<not needed for open relay>
globalSettings__disableUserRegistration=true
adminSettings__admins=bitwarden-admin@domain.tld
globalSettings__mail__smtp__sslOverride=true

Use GMX as smarthost / relay_host with Postfix with separate transport_map

Excerpt /etc/postfix/main.cf
———————-
transport_maps = hash:/etc/postfix/transport
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_tls_security_level = encrypt

 

Excerpt /etc/postfix/transport
————————
<mailaddress>@gmx.net smtp:mail.gmx.net:25

 

Excerpt /etc/postfix/sender_canonical
——————————-
root@proxmox sberg1@gmx.net

 

Excerpt /etc/postfix/sasl_password
—————————–
mail.gmx.net <mailaddress>@gmx.net:<password>

 

Execute postmap commands to create the hash db file from above transport / sender_canonical / sasl_password
—————————–
postmap transport
postmap sender_canonical
postmap sasl_password

 

Restart Postfix
————
systemctl restart postfix

 

Testing
——
mail -s test <mailaddress>@gmx.net
HINT: CC just hit <Enter> – then write the body followed by <Enter> and <.> (dot character) and again <Enter>- then quit the mail command by pressing <CTRL>-<D>