# Proposed change to mail node - set config via input / config node

**URL:** <https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538>\
**Category:** Core Development\
**Created:** [6 August 2025 08:41 UTC](https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538 "2025-08-06T08:41:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthiasdanne](https://avatars.discourse-cdn.com/v4/letter/m/e0b2c6/32.png) [@matthiasdanne](https://discourse.nodered.org/u/matthiasdanne)\
**Post date:** [6 August 2025 08:41 UTC](https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538/1 "2025-08-06T08:41:08Z")

</div>

Hello,

I’d like to propose a change. According to the contribution guide, I’m opening this thread to discuss it first.

I'm a developer using Node-RED in an enterprise environment, where we have CI/CD pipelines, deployments, and multiple environments with many flows and nodes in each.

Currently, the mail nodes (for sending and receiving emails) aren't well-suited for automatic deployment:

- Both nodes lack a configuration node.

- You can't set the node’s configuration (such as credentials) via input. (The mail fetch node doesn’t even have an input.)

- Credentials provided via the UI aren't persisted in the node.

As a result, after each deployment, we have to manually re-enter the credentials in every mail node via the UI - which is quite tedious.

My actual suggestion is to allow setting the configuration of mail nodes - particularly credentials -via input. In my opinion, this has an advantage over using a config node, as it allows for more dynamic behavior. For example, you could fetch emails from different folders or accounts in a rotating or conditional manner.

We’ve already built custom subflows for sending and receiving emails (using nodemailer/imap), but we believe it would be better to propose this as a feature request or pull request (PR) to the mail node itself.

I’d be happy to submit a PR with the necessary changes, if there's interest. If changes to the core mail node aren’t desired, please let me know how I can otherwise achieve persisted credentials.

Greetings,

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [6 August 2025 08:58 UTC](https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538/2 "2025-08-06T08:58:25Z")

</div>

Have you checked the flow library

> **[node-red-node-email-variable](https://flows.nodered.org/node/node-red-node-email-variable)**
>
> Node-RED nodes to send and receive simple emails.

> **[node-red-contrib-email-dynamic](https://flows.nodered.org/node/node-red-contrib-email-dynamic)**
>
> A Node-RED node to send emails. Both server settings and email details can be configured dynamically via the message payload.

PR request are always welcome.

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [6 August 2025 09:27 UTC](https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538/3 "2025-08-06T09:27:14Z")

</div>

> [@matthiasdanne](#):
>
> re-enter the credentials

I use environmental variables to feed MySQL user id and password, may be some thing similar should work for email - node as well ?

---

<div class="post-metadata">

**Author:** ![AllanOricil](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/allanoricil/32/106911_2.png) [@AllanOricil](https://discourse.nodered.org/u/AllanOricil)\
**Post date:** [16 August 2025 06:10 UTC](https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538/4 "2025-08-16T06:10:27Z")

</div>

> [@matthiasdanne](#):
>
> As a result, after each deployment, we have to manually re-enter the credentials in every mail node via the UI - which is quite tedious

As a workaround, you could pre-process your `flows.json` in your CICD pipeline to update these email nodes entries to certain values depending on the environment.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [16 August 2025 08:00 UTC](https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538/5 "2025-08-16T08:00:50Z")

</div>

> [@matthiasdanne](#):
>
> Credentials provided via the UI aren't persisted in the node.

What exactly do you mean by this?

Credentials should always be persisted as credentials (stored encrypted in a separate file, normally `flows_creds.json`) not node properties in the flow file and the email nodes do this correctly.

Also both the username and password can be set to be read from environment variables at flow start using the `${ENV_NAME}` syntax as described here:

> **[Using environment variables : Node-RED](https://nodered.org/docs/user-guide/environment-variables)**

---

<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:** [15 October 2025 08:01 UTC](https://discourse.nodered.org/t/proposed-change-to-mail-node-set-config-via-input-config-node/98538/6 "2025-10-15T08:01:15Z")

</div>

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