mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[email tool] Missing sender_address in SendEmailTool leads to Pydantic validation error
#917
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kejoe-zhang on GitHub (Jan 6, 2026).
Self Checks
Dify version
latest
Plugin version
0.0.7
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
When using the email sending tool (e.g.,
send_mail_batch.py), aValidationErroris raised because thesender_addressfield is not provided toSendEmailToolParameters, even though it's a required field.And I found that the email-related code is inconsistent with the code of the difypkg plugin, which prevents me from submitting a PR.
✔️ Error log
An error occurred in the plugin, please contact the author of langgenius/email/email for help, error type: ValidationError, error details: 1 validation error for SendEmailToolParameters
sender_address
Field required [type=missing, input_value={'smtp_server': 'qa-smtp....], 'bcc_recipients': []}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.8/v/missing
@dosubot[bot] commented on GitHub (Jan 6, 2026):
This error happens because the SendEmailToolParameters model requires a sender_address field, but send_mail_batch.py only provides email_account, not sender_address. This mismatch triggers the Pydantic ValidationError you’re seeing. The issue is confirmed in recent reports and is due to send_mail_batch.py not using sender_address from credentials, unlike send_mail.py, which does this correctly. The recommended fix is to update send_mail_batch.py to fetch sender_address from credentials (falling back to email_account if missing) and pass it to SendEmailToolParameters, matching the logic in send_mail.py. You can find more details and the suggested code change in issue #838 and issue #1085.
As a temporary workaround, you can patch your local send_mail_batch.py by adding:
This should resolve the validation error until an official fix is released.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other