I actually serve the problem that I can’t send any email any more with Bitwarden since Google droped the support for less secure apps.
I looked for a easy to install on-premise SMTP Solution, and found mailcow.
After configuring mailcow and adding a mailbox([email protected]) with smtp, imap & pop3, I change this in bwdata/env/global.override.env
to apply changes i runed this:
sudo ./bitwarden.sh rebuild
sudo ./bitwarden.sh updateself
sudo ./bitwarden.sh update
Specs:
bitwarden.sh version 2022.5.1 On-Premise
Docker version 20.10.12, build 20.10.12-0ubuntu2~20.04.1
docker-compose version 1.25.0, build unknown
Apache is used as reverse proxy
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
On the webui i only get “an unexpected error has occurred”
In the log of mailcows postfix isn’t any entry that bitwarden sends/try to send an Email.
Thanks in advance.
I hope any of you guys can help me
This doesn’t really help with the issue of mailcow, but your root concern with Gmail dropping support for less secure apps can be resolved with using an app password.
Having 2FA on my account when I’ve run into any testing has required the creation and use of a “Bitwarden specific app password” since I’ve ever tried.
This app password can be used in leui of the Gmail or Google Workspace Gmail enabled account password and should allow to send to Google SMTP servers directly for mail delivery on your self-hosted instance.
Edit: For further information too, have you tried to see if any other application or service can send using your mailcow SMTP relay?
Edit: For further information too, have you tried to see if any other application or service can send using your mailcow SMTP relay?
Yes my Nextcloud can send Mails over starttls on port 587.
Does Bitwarden write a logfile for sending mails? If yes where can i find them or in which container?
After you change the environment variables in the override file be sure to run ./bitwarden.sh rebuild as you have done previously to ensure the changes take effect.
Thanks I was about to recommend the same as David did if you could be sure you had this set so I’m glad you were able to verify. Sorry to hear that didn’t take care of it.
It might help to have some understanding of the setup, I understand you run the Bitwarden install script and thus everything runs within docker on your Ubuntu host server.
Does the Mailcow SMTP service run on a separate machine or on the same Ubuntu server, either local host or a docker container as well?
It might help to have some understanding of the setup, I understand you run the Bitwarden install script and thus everything runs within docker on your Ubuntu host server.
Yes, behind my Apache reverse proxy which is also on this machine.
Does the Mailcow SMTP service run on a separate machine or on the same Ubuntu server, either local host or a docker container as well?
Mailcow runs with docker on the same Ubuntu machine, here the WebUI also runs behind Apache.
I also tried this, but without success.
I looked again into my nextcloud config and saw i that i get every time the EMail got send my nextcloud reports a connection time out, but the EMail was sended.
Actually looks more like a mailcow setup problem i have.
Ahh bummer to hear that, glad to at least help pinpoint the issue. Very strange that Nextcloud does eventually send SMTP through Mailcow even though is throws errors, perhaps it continues to try whist Bitwarden just times out the connection.
Perhaps something that you can get some further help with directly from the Mailcow community, while I am not super familiar with it I always love the idea of a good open-source project and as @accolon can attest it appears to be popular and have a good community following with users that may be able to assist in your configuration.
In the meantime, either possibly as a patch until you can resolve the Mailcow issues if you continue to go that route.
I personally would never attempt to run a full on mail server as I understand it is complex, tedious, and time-consuming while email hosting providers can be fairly cheap. As a fun project and to learn sure, but otherwise I would only perhaps run this as an SMTP relay if required.
Have you looked at the option to use Google Gmail SMTP servers as you referenced in your original posting? You can use Option 2 if you have a free gmail account using smtp.gmail.com
As I believe Option 1 using smtp-relay.gmail.com may be for Google Workspaces customers only, but I may be wrong about this.
These settings still apply and can still be used without the need for “Less secure apps” by instead creating and using an “App Password” which is used in place of the gmail account password.
Hopefully that may work at least until you decide if you would like to stay with this method, go with another, or tinker with the Mailcow config to get that working properly.
@cksapp Thanks for the tip with Google App password but actually i’m more interested into hosting my own Mail Server for educational purpose, but I see it like you, if i have to configure postfix manually i would also refuse, but with a out of the box docker(mailcow) solution I see a higher chance to get it working, also I wouldn’t use it to receive email, I only wan’t to send with this.
I’m all for testing and tinkering! It’s one of the best ways to learn IMHO, I’ve learned much from my Homelab personally and has helped me greatly.
Wasn’t sure if this was something more critical or not, but hopefully the folks at the Mailcow community can help you further and it’ll be a good learning experience.
It’s especially rewarding when you test and learn new things to finally get them running and see your accomplishments and goals achieved.
Best of luck to you and your adventures