# Test SMTP Email Settings

**URL:** <https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020>\
**Category:** Uncategorized\
**Created:** [July 18, 2021, 4:51am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020 "2021-07-18T04:51:31Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![copenhaus](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/copenhaus/32/378_2.png) [@copenhaus](https://vaultwarden.discourse.group/u/copenhaus)\
**Post date:** [July 18, 2021, 4:51am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/1 "2021-07-18T04:51:31Z")

</div>

Hi, I have a Synology NAS, running VaultWarden as a docker container.

I went to the Admin portal, SMTP Eamil Settings section, I filled out:

- Enabled: true
- Host: [smtp.gmail.com](http://smtp.gmail.com)
- Enable Secure SMTP: true
- Force TLS: false
- Port: 587
- From Address: [my gmail email address]
- From Name: my made up name
- Username: [my gmail email address]
- Password: a specific app password made just for this
- SMTP Auth mechanism: [blank]

I saved it and when I test it, it says: Error sending SMTP test email, undefined.

I flipped over to the “Log” tab in the docker window, nothing shows there.

Thoughts/suggestions are greatly appreciated!

---

<div class="post-metadata">

**Author:** ![cksapp](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@cksapp](https://vaultwarden.discourse.group/u/cksapp)\
**Post date:** [July 18, 2021, 11:53pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/2 "2021-07-18T23:53:59Z")

</div>

Try the setting I use for gmail

(When tested secure SMTP works both enabled and disabled) Enable Secure SMTP: false  
Force TLS: True  
Port: 465

Edit: corrected SMTP port

---

<div class="post-metadata">

**Author:** ![copenhaus](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/copenhaus/32/378_2.png) [@copenhaus](https://vaultwarden.discourse.group/u/copenhaus)\
**Post date:** [July 19, 2021, 2:02am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/3 "2021-07-19T02:02:59Z")

</div>

sorry, port 455 is not a standard port for SMTP delivery, I am sure the network admin won’t open it…

Anyway, I tried another account and it works now…

Thanks…

---

<div class="post-metadata">

**Author:** ![cksapp](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@cksapp](https://vaultwarden.discourse.group/u/cksapp)\
**Post date:** [July 19, 2021, 2:22am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/4 "2021-07-19T02:22:17Z")

</div>

My apologies, I mistyped port 455 which should have been port 465, please see [Send email from a printer, scanner, or app - Google Workspace Admin Help](https://support.google.com/a/answer/176600?hl=en)

I believe you can get it working with port 587 as well but may need both  
Enable Secure SMTP: true  
Force TLS: true

Try it, save the config, and test email outbound.

> [@copenhaus](#):
>
> I am sure the network admin won’t open it…

Also, wanted to check you have the proper firewall rule to allow outbound traffic on whatever outbound SMTP port you use. Either UPNP mostly in home use or the proper firewall rule to pass outbound traffic on the SMTP port to the internet, or Google’s SMTP servers.

---

<div class="post-metadata">

**Author:** ![rutherford](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/rutherford/32/895_2.png) [@rutherford](https://vaultwarden.discourse.group/u/rutherford)\
**Post date:** [January 7, 2023, 12:57am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/5 "2023-01-07T00:57:21Z")

</div>

Seems like the settings have changed a bit. I’m also having trouble getting the SMTP stuff setup right for gmail SMTP. Can anyone share their gmail SMTP setup? Thanks!

 ![vaultwarden smtp](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/154c2a2e5b2e22b813a6b4dfbf1e3b679ac00d33.png)

---

<div class="post-metadata">

**Author:** ![gerardv514](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@gerardv514](https://vaultwarden.discourse.group/u/gerardv514)\
**Post date:** [January 7, 2023, 4:46am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/6 "2023-01-07T04:46:13Z")

</div>

I use force\_tls and port 465. I also tried starttls port 587 and that worked for me too.

Also my smtp auth mechanism is blank; not sure exactly what this does. I also added plain when I tried 587 starttls and it worked.

Wondering if this is due to something on your gmail account being used?

---

<div class="post-metadata">

**Author:** ![rutherford](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/rutherford/32/895_2.png) [@rutherford](https://vaultwarden.discourse.group/u/rutherford)\
**Post date:** [January 7, 2023, 5:15am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/7 "2023-01-07T05:15:17Z")

</div>

that did the trick. thanks!

---

<div class="post-metadata">

**Author:** ![gerardv514](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@gerardv514](https://vaultwarden.discourse.group/u/gerardv514)\
**Post date:** [January 7, 2023, 5:45pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/8 "2023-01-07T17:45:21Z")

</div>

Does anyone have an opinion on which port is the preferred one to go with, given that the SMTP service uses both?

---

<div class="post-metadata">

**Author:** ![copenhaus](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/copenhaus/32/378_2.png) [@copenhaus](https://vaultwarden.discourse.group/u/copenhaus)\
**Post date:** [January 7, 2023, 10:41pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/9 "2023-01-07T22:41:03Z")

</div>

port 587.

> **[What’s the Difference Between Ports 465 and 587? - SendGrid](https://sendgrid.com/blog/whats-the-difference-between-ports-465-and-587/)**
>
> Learn about the differences between ports 465 and 587, why there's so much confusion around the ports, and how to best use them.

---

<div class="post-metadata">

**Author:** ![gerardv514](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@gerardv514](https://vaultwarden.discourse.group/u/gerardv514)\
**Post date:** [January 7, 2023, 11:00pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/10 "2023-01-07T23:00:46Z")

</div>

👍 I’ve read the articles about it. It does seem 587 is the way forward. It was confusing for me because In some applications you would have to uncheck ssl when specifying port 587; thus nothing would be checked off. It creates an illusion that you have less security when unchecking a box such as ssl, as long as starttls is baked into port 587 with no additional check boxes needed then I guess it’s good. This is the part I haven’t been able to find or figure out in the articles.

---

<div class="post-metadata">

**Author:** ![Malz1902](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Malz1902](https://vaultwarden.discourse.group/u/Malz1902)\
**Post date:** [January 16, 2023, 1:04pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/11 "2023-01-16T13:04:25Z")

</div>

I cant send Emails.

Error sending SMTP test email  
SMTP 5xx error: permanent error (535): 5.7.8 Username and Password not accepted. Learn more at - Authentication credentials invalid

 ![gmail_smtp](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/03500700c99792e03482a3a7b6025b635efed8bb.jpeg)

I can sign up on [google.com](http://google.com)

---

<div class="post-metadata">

**Author:** ![Malz1902](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Malz1902](https://vaultwarden.discourse.group/u/Malz1902)\
**Post date:** [January 16, 2023, 1:39pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/12 "2023-01-16T13:39:24Z")

</div>

> [@Malz1902](#):
>
> 5xx error: permanent error (535): 5.7.8 Username and Password not accepted. Learn more at - Authentication credentials invalid

Now its worked, after change login metthod in 2FA in google and using app passwort

---

<div class="post-metadata">

**Author:** ![gerardv514](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@gerardv514](https://vaultwarden.discourse.group/u/gerardv514)\
**Post date:** [January 17, 2023, 3:18am UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/13 "2023-01-17T03:18:53Z")

</div>

What is the smtp auth mechanism field for, and what is a recommended value for it. I’ve been running the default blank value.

---

<div class="post-metadata">

**Author:** ![cksapp](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@cksapp](https://vaultwarden.discourse.group/u/cksapp)\
**Post date:** [January 17, 2023, 12:40pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/14 "2023-01-17T12:40:51Z")

</div>

I believe this might help to explain

> **[AUTH Command and its Mechanisms (PLAIN, LOGIN, CRAM-MD5) - SMTP Commands...](https://www.samlogic.net/articles/smtp-commands-reference-auth.htm)**
>
> This article describes the SMTP AUTH command and different mechanisms it supports (PLAIN, LOGIN, CRAM-MD5).

---

<div class="post-metadata">

**Author:** ![gerardv514](https://avatars.discourse-cdn.com/v4/letter/g/439d5e/32.png) [@gerardv514](https://vaultwarden.discourse.group/u/gerardv514)\
**Post date:** [January 18, 2023, 6:11pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/15 "2023-01-18T18:11:20Z")

</div>

Ok so I see this field is to send username and password to the email server. If that is the case how is it authenticating when that field is left blank?

---

<div class="post-metadata">

**Author:** ![cksapp](https://avatars.discourse-cdn.com/v4/letter/c/b9e5f3/32.png) [@cksapp](https://vaultwarden.discourse.group/u/cksapp)\
**Post date:** [January 18, 2023, 10:37pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/16 "2023-01-18T22:37:39Z")

</div>

I believe this defaults to whatever your docker run command or docker-compose file dictates.  
Otherwise I assume if left blank in the `admin` panel and not otherwise configured it would fall back to `PLAIN`

---

<div class="post-metadata">

**Author:** ![mgadbois](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mgadbois](https://vaultwarden.discourse.group/u/mgadbois)\
**Post date:** [January 31, 2023, 6:24pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/17 "2023-01-31T18:24:12Z")

</div>

Trying to set up Gmail on Unraid docker container. I am getting this error.  
 ![error](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/91cff488c5e0443e4b3eda0e9e662dd13df0ada6.png)

---

<div class="post-metadata">

**Author:** ![mgadbois](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mgadbois](https://vaultwarden.discourse.group/u/mgadbois)\
**Post date:** [January 31, 2023, 6:24pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/18 "2023-01-31T18:24:49Z")

</div>

SMTP config is:

 ![smtp](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/2210110e668b6f91c4b63e4fa141e6a3b95ab277.png)

---

<div class="post-metadata">

**Author:** ![mgadbois](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mgadbois](https://vaultwarden.discourse.group/u/mgadbois)\
**Post date:** [January 31, 2023, 6:26pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/19 "2023-01-31T18:26:16Z")

</div>

2FA config is:

 ![2fa](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/bb4da889323401963e273fc94502dfc0eb2033de.png)  
Gmail app password is in the pw field in the SMTP config.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![TheShills](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/theshills/32/1307_2.png) [@TheShills](https://vaultwarden.discourse.group/u/TheShills)\
**Post date:** [January 12, 2024, 6:33pm UTC](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020/20 "2024-01-12T18:33:58Z")

</div>

I just did this dance and it is a gmail thing, extra security. Because we can’t do 2 factor for this you need to do this:

1. Go to your [Google Account](https://myaccount.google.com/).
2. Select **Security.**
3. Under “Signing in to Google,” select **2-Step Verification**.
4. At the bottom of the page, select **App passwords**.
5. Enter a name that helps you remember where you’ll use the app password.
6. Select **Generate**.
7. To enter the app password, follow the instructions on your screen. The app password is the 16-character code that generates on your device.
8. Select **Done**.

drop that password into vaultwarden and you are golden and good to go.

[Next page](https://vaultwarden.discourse.group/t/test-smtp-email-settings/1020.md?page=2)
