# Email login/password setup

**URL:** <https://discourse.nodered.org/t/email-login-password-setup/77213>\
**Category:** General\
**Created:** [3 April 2023 22:25 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213 "2023-04-03T22:25:36Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 May 2023 13:43 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213/21 "2023-05-12T13:43:49Z")

</div>

I am not sure what it is that you don't understand.

---

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [12 May 2023 13:59 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213/22 "2023-05-12T13:59:50Z")

</div>

Well, I think the point that @calixtoemilio is trying to make is that for MQTT node the password can be part of the imported flow, whereas for email it is not.

His export shows:

> [@calixtoemilio](#):
>
> "password": "${DB\_PASSWORD}",

The exports of the eMail node, which we created earlier, showed no field for password.

Maybe there is another way to properly pass credentials to a freshly created docker container of node-red?

---

<div class="post-metadata">

**Author:** ![calixtoemilio](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@calixtoemilio](https://discourse.nodered.org/u/calixtoemilio)\
**Post date:** [12 May 2023 14:07 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213/23 "2023-05-12T14:07:13Z")

</div>

I make changes to the code, then download it via **export** into my desktop. This **flow.json** is saved into git repository. Then the linux host pull the code from the git repository, and create a new container to be deployed. btw, this instance runs in multiple hosts in parallel, hence the new container creation process is repeated after a new code version.

**Challenge:**

How to persistently pass email username and password into **the email node** upon creating a new container with a new code, which is passed via **flow.json** while **Dockerfile** inject environment variables into the new container.

I see 2 options: having the email to store the environment variable, or injecting email config params into the email node. Or the 3rd way I am missing 😨

---

<div class="post-metadata">

**Author:** ![cameo69](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cameo69/32/66593_2.png) [@cameo69](https://discourse.nodered.org/u/cameo69)\
**Post date:** [12 May 2023 14:28 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213/24 "2023-05-12T14:28:55Z")

</div>

Or you just add the credentials to the import 🙂

Email node uses a [credentials JSON](https://github.com/node-red/node-red-nodes/blob/9f9d293461ba1112d6c5d035c97b1263e874e24f/social/email/61-email.js#L43).

Just tried it, and for me it imports with credentials.

```auto
[
    {
        "id": "0f3dbcb16a5fecb8",
        "type": "e-mail in",
        "z": "f6f2187d.f17ca8",
        "name": "",
        "protocol": "IMAP",
        "server": "imap.gmail.com",
        "useSSL": true,
        "autotls": "required",
        "port": "993",
        "authtype": "BASIC",
        "credentials": {"userid":"${EMAIL_USER}", "password":"${EMAIL_PASSWORD}"},
        "saslformat": true,
        "token": "oauth2Response.access_token",
        "box": "wss_export",
        "disposition": "None",
        "criteria": "_msg_",
        "repeat": "300",
        "fetch": "trigger",
        "inputs": 1,
        "x": 510,
        "y": 500,
        "wires": [
            []
        ]
    }
]

```

---

<div class="post-metadata">

**Author:** ![calixtoemilio](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@calixtoemilio](https://discourse.nodered.org/u/calixtoemilio)\
**Post date:** [12 May 2023 14:40 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213/25 "2023-05-12T14:40:57Z")

</div>

Interesting!!, will try that, not an elegant way, but effective enough for my development cycle.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 May 2023 14:43 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213/26 "2023-05-12T14:43:56Z")

</div>

Are you exporting the full set of flows? If so then put your full .node-red folder in git, except for node\_modules, and it will just go.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 July 2023 14:44 UTC](https://discourse.nodered.org/t/email-login-password-setup/77213/27 "2023-07-11T14:44:30Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.nodered.org/t/email-login-password-setup/77213.md?page=1)
