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
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?
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?
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