tools/email: overly strict email_account validation in email sending #943

Open
opened 2026-02-16 10:21:04 -05:00 by yindo · 2 comments
Owner

Originally created by @WangYuhang-CN on GitHub (Jan 21, 2026).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.4

Plugin version

0.0.9

Cloud or Self Hosted

Cloud, Self Hosted (Docker)

Steps to reproduce

In the current email sending logic, there is semantic confusion in the validation of sender-related parameters.
The system defines both email_account and sender_address fields, yet the validation logic still forcibly treats email_account as a complete email address (mailbox) for validation. As a result, emails are incorrectly rejected in valid configuration scenarios.

When configured as follows:

email_account = myemail
sender_address = myemail@email_domain.com

the email sending request is rejected with the error message:
“Invalid parameter userid, the sender is not a mailbox”.

Configuration:

Image

Output:

Image

✔️ Error log

No response

Originally created by @WangYuhang-CN on GitHub (Jan 21, 2026). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.4 ### Plugin version 0.0.9 ### Cloud or Self Hosted Cloud, Self Hosted (Docker) ### Steps to reproduce In the current email sending logic, there is semantic confusion in the validation of sender-related parameters. The system defines both email_account and sender_address fields, yet the validation logic still forcibly treats email_account as a complete email address (mailbox) for validation. As a result, emails are incorrectly rejected in valid configuration scenarios. When configured as follows: ``` email_account = myemail sender_address = myemail@email_domain.com ``` the email sending request is rejected with the error message: **“Invalid parameter userid, the sender is not a mailbox”.** ### Configuration: <img width="558" height="661" alt="Image" src="https://github.com/user-attachments/assets/f5ba1278-3c54-4efd-9591-ac2db456446b" /> ### Output: <img width="367" height="216" alt="Image" src="https://github.com/user-attachments/assets/e822f55b-e21c-42f2-b543-7fed5333353c" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:21:04 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 21, 2026):

Hi @WangYuhang-CN! I'm Dosu and I’m helping the dify-official-plugins team.

The strict validation happens because the plugin code checks if email_account is a full email address using a regex, even when sender_address is set correctly. This causes valid setups where email_account is just a username to fail with the “Invalid parameter userid, the sender is not a mailbox” error. The logic is in tools/email/tools/send_mail.py and isn’t configurable without code changes.

A recent update fixes this: PR #2381 (merged 2026-01-08) changes the validation so email_account is only checked for presence and type, not email format, and uses sender_address as the actual From address. Upgrading to a plugin version that includes this PR should resolve the issue. You can see the relevant changes and discussion in PR #2381.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 21, 2026): <!-- Greeting --> Hi @WangYuhang-CN! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> The strict validation happens because the plugin code checks if email_account is a full email address using a regex, even when sender_address is set correctly. This causes valid setups where email_account is just a username to fail with the “Invalid parameter userid, the sender is not a mailbox” error. The logic is in tools/email/tools/send_mail.py and isn’t configurable without code changes. A recent update fixes this: PR #2381 (merged 2026-01-08) changes the validation so email_account is only checked for presence and type, not email format, and uses sender_address as the actual From address. Upgrading to a plugin version that includes this PR should resolve the issue. You can see the relevant changes and discussion in [PR #2381](https://github.com/langgenius/dify-official-plugins/pull/2381). <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/9263c2d1-80bd-4add-ae72-c0e61bbbf0f8?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/9263c2d1-80bd-4add-ae72-c0e61bbbf0f8?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/9263c2d1-80bd-4add-ae72-c0e61bbbf0f8?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/9263c2d1-80bd-4add-ae72-c0e61bbbf0f8?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9263c2d1-80bd-4add-ae72-c0e61bbbf0f8?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/9263c2d1-80bd-4add-ae72-c0e61bbbf0f8?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9263c2d1-80bd-4add-ae72-c0e61bbbf0f8?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20strict%20validation%20happens%20because%20the%20plugin%20code%20checks%20if%20email_account%20is%20a%20full%20email%20address%20using%20a%20regex%2C%20even%20when%20sender_address%20is%20set%20correctly.%20This%20causes%20valid%20setups%20where%20email_account%20is%20just%20a%20username%20to%20fail%20with%20the%20%E2%80%9CInvalid%20parameter%20userid%2C%20the%20sender%20is%20not%20a%20mailbox%E2%80%9D%20error.%20The%20logic%20is%20in%20tools/email/tools/send_mail.py%20and%20isn%E2%80%99t%20configurable%20without%20code%20changes.%0A%0AA%20recent%20update%20fixes%20this%3A%20PR%20%232381%20%28merged%202026-01-08%29%20changes%20the%20validation%20so%20email_account%20is%20only%20checked%20for%20presence%20and%20type%2C%20not%20email%20format%2C%20and%20uses%20sender_address%20as%20the%20actual%20From%20address.%20Upgrading%20to%20a%20plugin%20version%20that%20includes%20this%20PR%20should%20resolve%20the%20issue.%20You%20can%20see%20the%20relevant%20changes%20and%20discussion%20in%20%5BPR%20%232381%5D%28https%3A//github.com/langgenius/dify-official-plugins/pull/2381%29.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2460)
Author
Owner

@crazywoola commented on GitHub (Feb 3, 2026):

Hi @WangYuhang-CN, thanks for opening this issue.

Why this is being closed

Dify issue tracking requires English-only issue title and description for consistent collaboration.

Next steps

Please open a new issue in English and include clear details so maintainers can help efficiently.

Thanks for understanding and for your support.

@crazywoola commented on GitHub (Feb 3, 2026): Hi @WangYuhang-CN, thanks for opening this issue. ### Why this is being closed Dify issue tracking requires English-only issue title and description for consistent collaboration. ### Next steps Please open a new issue in English and include clear details so maintainers can help efficiently. Thanks for understanding and for your support.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#943