Cannot send email after upgrade to Scale 25

Hello, after I upgraded from Core 13.0 to Scale 25.10.1 (Goldeye) I lost ability to send emails which is pretty bad for notifications (hardware failures, pool anomalies, etc).

I am reusing the config from the previous install (13.0) and made sure the email settings were correct. I even reentered them to be sure.

When I try to send an email via GUI I get

“[EFAULT] Failed to send email: ‘str’ object has no attribute ‘decode’”.

I am sending emails via a local SMTP relay running on port 8025.

Middleware logs show:

root@srv-nas01[~]# tail -f /var/log/middlewared.log | grep -i -A 10 "mail"

[2026/02/22 12:49:05] (WARNING) MailService.send_raw():312 - Failed to send email @cee:{"TNLOG": {"exception": "Traceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/middlewared/plugins/mail.py\", line 288, in send_raw\n from_addr if isinstance(from_addr, str) else from_addr.encode().decode(),\n ^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'str' object has no attribute 'decode'", "type": "PYTHON_EXCEPTION", "time": "2026-02-22 17:49:05.583575"}}

[2026/02/22 12:49:05] (ERROR) middlewared.job.run():540 - Job > failed: CallError("Failed to send email: 'str' object has no attribute 'decode'")

[2026/02/22 12:51:46] (ERROR) middlewared.job.run():540 - Job > failed: CallError('Failed to send email: [Errno 111] Connection refused')

[2026/02/22 12:52:01] (WARNING) MailService.send_raw():312 - Failed to send email @cee:{"TNLOG": {"exception": "Traceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/middlewared/plugins/mail.py\", line 288, in send_raw\n from_addr if isinstance(from_addr, str) else from_addr.encode().decode(),\n ^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'str' object has no attribute 'decode'", "type": "PYTHON_EXCEPTION", "time": "2026-02-22 17:52:01.656595"}}

[2026/02/22 12:52:01] (ERROR) middlewared.job.run():540 - Job > failed: CallError("Failed to send email: 'str' object has no attribute 'decode'")

[2026/02/22 12:54:47] (WARNING) MailService.send_raw():312 - Failed to send email @cee:{"TNLOG": {"exception": "Traceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/middlewared/plugins/mail.py\", line 288, in send_raw\n from_addr if isinstance(from_addr, str) else from_addr.encode().decode(),\n ^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'str' object has no attribute 'decode'", "type": "PYTHON_EXCEPTION", "time": "2026-02-22 17:54:47.933155"}}

[2026/02/22 12:54:53] (ERROR) middlewared.job.run():540 - Job > failed: CallError("Failed to send email: 'str' object has no attribute 'decode'")

[2026/02/22 12:58:40] (WARNING) MailService.send_raw():312 - Failed to send email @cee:{"TNLOG": {"exception": "Traceback (most recent call last):\n File \"/usr/lib/python3/dist-packages/middlewared/plugins/mail.py\", line 288, in send_raw\n from_addr if isinstance(from_addr, str) else from_addr.encode().decode(),\n ^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'str' object has no attribute 'decode'", "type":

Searching the bugtracker I have the impression that this issue was fixed in Goldeye but apparently not.

Seriously, nobody? Am I the only one with issues ?

I just installed multi_report.sh but of course it cant send email notifications because of this issue.

multi_report.sh not rely on the built-in sendemail, but on a custom script that use the same built-in config… if both are failing, is reasonable to think that something odd is happening config side, despite you save the config again.
From shell, if you cd into the multi report folder, you will see the sendemail.py: try run it with the --test_mode arg, like

python3 sendemail.py --test_mode

and see what happen. Let’s see if something different is catch by the script that can help resolve the issue

Hello!

OK I ran the script in test mode:

root@srv-nas01[/mnt/zpool/scripts/multi_report]# python3 sendemail.py --test_mode
Activating test mode
{“version”: “1.80”, “error”: true, “detail”: “KO: (450, b’failed to send notification’)”, “logfile”: “/mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt”, “total_attach”: 1, “ok_attach”: 0}
root@srv-nas01[/mnt/zpool/scripts/multi_report]# cat /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt

TEST MODE ON

Script Version: 1.80

Entering template render. Scale/Core switch needed
search for test_message template on REPO
reading template
templates loaded
applying iteration
trying to expands iterated vars
nothing to iterate found
File /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt successfully generated
13 totals file log
1 totals attachment to handle
trying read mail.config
read mail.config successfully
Switching for the right provider
** SMTP Version **
From found
parsing smtp config
switch from classic send and bulk email
mail hmtl provided
parsing html content
body can’t be a file, too much long
trying apply a template
no template provided
start parsing headers
parsing data from config and override options
using mr-config fromname-email
generate a message ID using alertsrv
alertsrv not a valid address, tryng on srv-nas01@tuxdomain
domain: tuxdomain
uuid: 2026_03_01_10_06_02_85997c572a9-a5ba-468e-9f1f-187e4a0c7cda
messageid: 2026_03_01_10_06_02_85997c572a9-a5ba-468e-9f1f-187e4a0c7cda@tuxdomain
check for attachements…
attachments found
symlink verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt pass
size verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt pass
blacklist verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt pass
attachment valid /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt
Found 1 valid files
standard attachment mode
trying to parse the correct mimetype for /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt
result: text/plain | None
mimetype correctly splitted
attachment /mnt/zpool/scripts/multi_report/sendemail_log/20260301_100602.txt done
1 ok attachments
get hostname
hostname retrieved: srv-nas01.tuxdomain
tryng retrieving if more recipient are set
establing connection based on security level set on TN: PLAIN
entered PLAIN path
adding ehlo to the message
entering credentials
sending PLAIN email
An unexpected error has occured: (450, b’failed to send notification’)
KO: (450, b’failed to send notification’)

Please note: “alertsrv” is the pre-configured user on my SMTP relay (using mailrise which forwards the email to my proton email).

I know now that the multireport script does not use truenas’s settings but here’s my config anyways because the test mode above mentioned user “alertsrv” which I do not remember entering when I ran the config option of multireport… So perhaps after all the multireport script does use some data from truenas’s config?

  • Send mail method: SMTP
  • From email: root@srv-nas01.tuxdomain
  • Outgoing Mail server: support.tuxdomain
  • Mail server port: 8025
  • Security: PLAIN (no encryption)
  • SMTP Auth: CHECKED
  • Username: alertsrv
  • Password: **********

When I press “Send Test Email” → [EFAULT] Failed to send email: ‘str’ object has no attribute ‘decode’

Thanks for the details!
I think that both TN and sendemail are receiving the same error, but somehow TN try to decode the already string from mailrise and raise that useless exception.

Now we have the real error:

An unexpected error has occured: (450, b’failed to send notification’)
KO: (450, b’failed to send notification’)

and to me this really seems that mailrise received the email, but can’t somehow process It.
Are you running mailrise in a docker container in the same machine? Can you see the logs inside the container?

For that instead

I probably was not clear in the previous post, what i mean was that MR not rely on the sending builtin email functionality of TN but on the sendemail.py, though sendemail.py rely on the TN builtin email config :smile: so yes the configuration Is “shared”. It also give more options like overrides, as you see in the logs (just to mention if you decide to use the sendemail stand alone for other purpose)

EDIT:
sorry for the edit, i realized another things that yesterday i didn’t notice:

using mr-config fromname-email
generate a message ID using alertsrv
alertsrv not a valid address, tryng on srv-nas01@tuxdomain
domain: tuxdomain

did you put srv-nas01@tuxdomain as from in the mr-config? Is it correct?
Just for be sure: rename momentary the multi_report_config.txt like __multi_report_config.txt and try again the test mode, just to be sure that is not only that that block mailrise to send the notification (at least sendemail side)

Check “From Name” in System/General Settings/Email Options. If the field is empty, the error shown in your log may occur.

Hello guys, OK I managed to get further. There was indeed a problem on mailrise running on a remote host, somehow the config file got overwritten during a backup which it was not supposed to happen… Anyways now from Truenas’s webui I can send emails using the general config > email > send test email. Works flawlessly.

However multi_report.sh still chokes… I did many hours of troubleshooting and the issue is on mailrise’s side. Apprise seems to be having troubles with the complexity of the email generated with multi_report.sh…. stripping the attachments (which required short-circuiting the script and the python email helper) worked.

I am not sure why the script doesn’t have a “flatten” / ”legacy” switch which would send a simple email with no attachment but thats a problem on mailrise’s side so I wont complain about the multi-report script.

Sorry for late response, i missed the thread :smile:

Btw, you should give a look into multi report config (maybe use the hub, via GitHub), because there are some way to suppress certain attachment, but im not sure if all are switchable.
Sendemail Is capable to zip all the attachments, maybe you can try this way just for the sake of test It (but you will need to manually edit the sendemail invocation into multi report because this option Is not exposed).

I’m instead pretty surprised to read about “complexity” of the email, because the body Is just plain online HTML (either the disk layout part).

Hello Oxyde, no need to be sorry I indeed didnt have time to come back lately and I’m still having issues. To summarize my adventure so far, I made the email notifications from Truenas itself (from the WebUI) by adjusting my mailrise config (on my smtp relay). Emails are being sent without issue from truenas.

However unfortunately the emails from multi_report are still not working.

I decided to wipe my scripts folder clean and restart fresh. I git cloned the multi_report.sh script then updated it with “-update_all”. Then I ran the config, set my to & from emails and saved.

Finally running the script:

root@srv-nas01[/mnt/zpool/scripts/multi_report]# ./multi_report.sh

Multi-Report v3.31 dtd:2026-04-11 (TrueNAS SCALE - Goldeye 25.10.1)

Checking for Updates
Multi-Report - Installed: 3.31, GitHub: 3.31 - No Update Available
Drive-Selftest - Installed: 1.09, GitHub: 1.09 - No Update Available
Sendemail - Installed: 1.90, GitHub: 1.90 - No Update Available
SMR-Check - Installed: 2.0, GitHub: 2.0 - No Update Available
Disk Layout (render_case) - Installed: 0.17, GitHub: 0.17 - No Update Available

Running Drive Self-test Script: /mnt/zpool/scripts/multi_report/drive_selftest.sh

Joe’s SMART Drive Self-test Script - Run: 22 May 09:20:14 AM
Script Version: 1.09 (1 April 2026), TrueNAS Scale 25.10.1
Using “/mnt/zpool/scripts/multi_report/multi_report_config.txt” values…"

-—> Silent Enabled - Minimal Data and any Errors will be reported <----
----> You may experience prolonged silence, be patient <----

… Drive sde is still running a test: (80% remaining)
… 09:21:15.31: EXIT run_smart_test
Elapsed Time: 1 minutes and 1.03 seconds elapsed.

.. 09:21:25.23: EXIT run_smart_test
Elapsed Time: 1 minutes and 10.95 seconds elapsed.

Zzzz…

Exiting Joe’s SMART Drive Self-test Script
Collecting Multi-Report Data…
Using sendemail.py
Send Failed
Retrying in 120 seconds…
Retry Count: 1
Send Failed
Retrying in 120 seconds…
Retry Count: 2
Send Failed
Retrying in 120 seconds…
Retry Count: 3
Send Failed
Retrying in 120 seconds…
Retry Count: 4
Send Failed
Retrying in 120 seconds…
Retry Count: 5
Send Failed
Retrying in 300 seconds…
Retry Count: 6
Send Failed
Retrying in 300 seconds…
Retry Count: 7
Send Failed
Retrying in 300 seconds…
Retry Count: 8
Send Failed
Retrying in 300 seconds…
Retry Count: 9
Send Failed
Retrying in 300 seconds…
Retry Count: 10
Send Failed
Retrying in 300 seconds…
Retry Count: 11
Email sent to blabla@mailrise.xyz

HoweverI never got the email.

Mailrise logs

[2026-05-22 14:06:02] INFO:mail.log:('192.168.120.20', 37328) >> b'ehlo srv-nas01.localdomain'

[2026-05-22 14:06:02] INFO:mail.log:('192.168.120.20', 37328) >> b'mail FROM:<root@srv-nas01.localdomain> size=192751'

[2026-05-22 14:06:02] INFO:mail.log:('192.168.120.20', 37328) sender: root@srv-nas01.localdomain

[2026-05-22 14:06:02] INFO:mail.log:('192.168.120.20', 37328) >> b'rcpt TO:<blabla@mailrise.xyz>'

[2026-05-22 14:06:02] INFO:mailrise.skeleton:Added recipient: blabla@mailrise.xyz

[2026-05-22 14:06:02] INFO:mail.log:('192.168.120.20', 37328) recip: blabla@mailrise.xyz

[2026-05-22 14:06:02] INFO:mail.log:('192.168.120.20', 37328) >> b'data'

[2026-05-22 14:06:02] INFO:mailrise.skeleton:Accepted email: address: [ root@srv-nas01.localdomain ➤ blabla@mailrise.xyz ] subject: [ SMART Testing Results for srv-nas01 - All is Good ] body: [ Multi-Report v3.31 d (83.5K) ] attach: [ Disk_layout.html (10.2K), Old_multi_report_config.txt (32.8K), multi_report_config.txt (32.8K) ]

[2026-05-22 14:06:02] INFO:apprise:Applying Custom Defaults

[2026-05-22 14:06:02] INFO:apprise:Loaded 1 entries from memory://

[2026-05-22 14:06:02] INFO:apprise:Notifying 1 service(s) asynchronously.

[2026-05-22 14:06:03] WARNING:mailrise.skeleton:Notification failed: address: [ root@srv-nas01.localdomain ➤ blabla@mailrise.xyz ] subject: [ SMART Testing Results for srv-nas01 - All is Good ] body: [ Multi-Report v3.31 d (83.5K) ] attach: [ Disk_layout.html (10.2K), Old_multi_report_config.txt (32.8K), multi_report_config.txt (32.8K) ]

[2026-05-22 14:06:03] INFO:mail.log:('192.168.120.20', 37328) >> b'rset'

[2026-05-22 14:06:03] INFO:mail.log:('192.168.120.20', 37328) >> b'QUIT'

[2026-05-22 14:06:03] INFO:mail.log:('192.168.120.20', 37328) connection lost

[2026-05-22 14:06:03] INFO:mail.log:('192.168.120.20', 37328) Connection lost during _handle_client()

[2026-05-22 14:07:10] INFO:mail.log:Available AUTH mechanisms: LOGIN(builtin) PLAIN(builtin)

[2026-05-22 14:07:10] INFO:mail.log:Peer: ('172.23.0.1', 58388)

[2026-05-22 14:07:10] INFO:mail.log:('172.23.0.1', 58388) handling connection

[2026-05-22 14:07:10] INFO:mail.log:('172.23.0.1', 58388) EOF received

[2026-05-22 14:07:10] INFO:mail.log:('172.23.0.1', 58388) Connection lost during _handle_client()

[2026-05-22 14:07:10] INFO:mail.log:('172.23.0.1', 58388) connection lost

Then I tried sendemail.py with –test_mode as you previously suggested:

root@srv-nas01[/mnt/zpool/scripts/multi_report]# python3 sendemail.py --test_mode
Activating test mode
{“version”: “1.90”, “error”: true, “detail”: “KO: (450, b’failed to send notification’)”, “logfile”: “/mnt/zpool/scripts/multi_report/sendemail_log/20260522_102719.txt”, “total_attach”: 1, “ok_attach”: 0}

However when I add “–zip_attachments” it works, mailrise accepts the email, and forwards it to my external email provider!

root@srv-nas01[/mnt/zpool/scripts/multi_report]# python3 sendemail.py --test_mode --zip_attachments
Activating test mode
{“version”: “1.90”, “error”: false, “detail”: "<< Email Sent >> ", “logfile”: “/mnt/zpool/scripts/multi_report/sendemail_log/20260522_101644.txt”, “total_attach”: 1, “ok_attach”: 1}

The log file

TEST MODE ON

Script Version: 1.90

Entering template render. Scale/Core switch needed
search for test_message template on REPO
reading template
templates loaded
applying iteration
trying to expands iterated vars
nothing to iterate found
File /mnt/zpool/scripts/multi_report/sendemail_log/20260522_101644.txt successfully generated
14 totals file log
1 totals attachment to handle
trying read mail.config
read mail.config successfully
Switching for the right provider
** SMTP Version - without login **
From found
parsing smtp config
switch from classic send and bulk email
mail body provided
mail body type html provided
parsing content
body can’t be a file, too much long
trying apply a template
no template provided
start parsing headers
parsing data from config and override options
using mr-config fromname-email
generate a message ID using blablabla
domain: blabla.com
uuid: 2026_05_22_10_16_45_545ac71b238-b65d-4207-849e-14d2da17ddfc
messageid: [2026_05_22_10_16_45_545ac71b238-b65d-4207-849e-14d2da17ddfc@blabla.com](mailto:2026_05_22_10_16_45_545ac71b238-b65d-4207-849e-14d2da17ddfc @ blabla .com)
check for attachements…
attachments found
symlink verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260522_101644.txt pass
size verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260522_101644.txt pass
blacklist verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260522_101644.txt pass
attachment valid /mnt/zpool/scripts/multi_report/sendemail_log/20260522_101644.txt
Found 1 valid files
zip mode enabled

Im going to wait for your reply before trying anything else. To be honest I am not sure why there’s such a conflict between the scrip and mailrise with attachments. At least, my suspicion is on the attachments…..

Hi!
I have added the –zip_attachments flag some time ago after have digged a lot with a certain provider, refusing to delivery an email containing certain attachments extension… and i fairly suppose your situation is quite worst because neither a .txt can be send properly (the kind sent by the test_mode).

Just to be sure that isn’t something i can improve my side… try to grab the BETA version 1.91 from github, i have made a little change on file name handling (for attachment), hoping this will do the trick: standalone-tn-send-email/sendemailBETA.py at main · oxyde1989/standalone-tn-send-email · GitHub

(delete old sendemail from MR folder, then place this into it and rename as the original file).

If this is not enough will try to “hack” the sendemail to always zip attachments

Thats very interesting…. I retrieved the sendemailBETA.py and ran it:

root@srv-nas01[/mnt/zpool/scripts/multi_report]# python3 sendemail.py --test_mode
Activating test mode
{“version”: “1.91”, “error”: false, “detail”: “<< Email Sent >> \n>> Soft warning: something wrong with 1 or more attachments >>”, “logfile”: “/mnt/zpool/scripts/multi_report/sendemail_log/20260522_194536.txt”, “total_attach”: 1, “ok_attach”: 0}

So it seems to be running a bit better now still not perfect… I go the email, but it had no attachment.

When I run it with zip_attachments:

root@srv-nas01[/mnt/zpool/scripts/multi_report]# python3 sendemail.py --test_mode --zip_attachments
Activating test mode
{“version”: “1.91”, “error”: false, “detail”: "<< Email Sent >> ", “logfile”: “/mnt/zpool/scripts/multi_report/sendemail_log/20260522_195010.txt”, “total_attach”: 1, “ok_attach”: 1}

I get the email and it has the attachment (attachments_2026……zip).

Im curious and eager to understand whats going on and help you fix this!

I think the little change has broke the attachment function somehow, but i can’t understand how (It works on my machine), what the log says about the first attempt?

Test without zip_attachments

### TEST MODE ON ###
### Script Version: 1.91 ###
Entering template render. Scale/Core switch needed
search for test_message template on REPO
reading template
templates loaded
applying iteration
trying to expands iterated vars
nothing to iterate found
File /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065004.txt successfully generated
18 totals file log
1 totals attachment to handle
trying read mail.config
read mail.config successfully
Switching for the right provider
** SMTP Version - without login **
From found
parsing smtp config
switch from classic send and bulk email
mail body provided
mail body type html provided
parsing content
body can't be a file, too much long
trying apply a template
no template provided
start parsing headers
parsing data from config and override options
using mr-config fromname-email
generate a message ID using email@hotmail.com
domain: hotmail.com
uuid: 2026_05_23_06_50_05_990416319cd-a80d-4c25-ab5c-2ca82776f8a2
check for attachements...
attachments found
symlink verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065004.txt pass
size verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065004.txt pass
blacklist verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065004.txt pass
attachment valid /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065004.txt
Found 1 valid files
standard attachment mode
trying to parse the correct mimetype for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065004.txt
result: text/plain | None
mimetype correctly splitted
failed to pars attachment in standard mode: Message.add_header() missing 1 required positional argument: '_value'
0 ok attachments
get hostname
hostname retrieved: srv-nas01.localdomain
tryng retrieving if more recipient are set
establing connection based on security level set on TN: PLAIN
entered PLAIN path
adding ehlo to the message
sending PLAIN email
SMTP operations finished
<< Email Sent >> 
>> Soft warning: something wrong with 1 or more attachments >>

Test WITH zip_attachments

### TEST MODE ON ###
### Script Version: 1.91 ###
Entering template render. Scale/Core switch needed
search for test_message template on REPO
reading template
templates loaded
applying iteration
trying to expands iterated vars
nothing to iterate found
File /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065246.txt successfully generated
19 totals file log
1 totals attachment to handle
trying read mail.config
read mail.config successfully
Switching for the right provider
** SMTP Version - without login **
From found
parsing smtp config
switch from classic send and bulk email
mail body provided
mail body type html provided
parsing content
body can't be a file, too much long
trying apply a template
no template provided
start parsing headers
parsing data from config and override options
using mr-config fromname-email
generate a message ID using email@hotmail.com
domain: hotmail.com
uuid: 2026_05_23_06_52_46_5919a4d1e03-191c-4034-92aa-a2e68f9ab801
messageid: <2026_05_23_06_52_46_5919a4d1e03-191c-4034-92aa-a2e68f9ab801@hotmail.com>
check for attachements...
attachments found
symlink verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065246.txt pass
size verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065246.txt pass
blacklist verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065246.txt pass
attachment valid /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065246.txt
Found 1 valid files
zip mode enabled
queued /mnt/zpool/scripts/multi_report/sendemail_log/20260523_065246.txt
valid files has been zipped
1 ok attachments
get hostname
hostname retrieved: srv-nas01.localdomain
tryng retrieving if more recipient are set
establing connection based on security level set on TN: PLAIN
entered PLAIN path
adding ehlo to the message
sending PLAIN email
SMTP operations finished
<< Email Sent >> 

Off course, after have corrected this error yesterday i forget to push the new file :folded_hands:
i’m sorry, grab again the 1.91 beta file now and let’s see if the attachment is accepted or will still end in a refuse from mailrise

OK I retrieved the binary from //raw.githubusercontent.com/oxyde1989/standalone-tn-send-email/refs/heads/main/sendemailBETA.py

but when I run “python3 sendemail.py --test_mode” it seems to error out faster than before…. Now it doesnt look like its talking to mailrise at all. When I hit enter, I almost immediately see this output, but before (with the sendemail BETA from yesterday), it was “thiking” fr a few seconds then giving the messages I posted before. Now I see:

Activating test mode
{“version”: “1.91”, “error”: true, “detail”: “KO: (450, b’failed to send notification’)”, “logfile”: “/mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt”, “total_attach”: 1, “ok_attach”: 0}

The log:

### TEST MODE ON ###
### Script Version: 1.91 ###
Entering template render. Scale/Core switch needed
search for test_message template on REPO
reading template
templates loaded
applying iteration
trying to expands iterated vars
nothing to iterate found
File /mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt successfully generated
21 totals file log
1 totals attachment to handle
trying read mail.config
read mail.config successfully
Switching for the right provider
** SMTP Version - without login **
From found
parsing smtp config
switch from classic send and bulk email
mail body provided
mail body type html provided
parsing content
body can't be a file, too much long
trying apply a template
no template provided
start parsing headers
parsing data from config and override options
using mr-config fromname-email
generate a message ID using email@hotmail.com
domain: hotmail.com
uuid: 2026_05_23_09_01_27_20719123f3c-8fc4-4075-a26d-0b752b3e4654
messageid: <2026_05_23_09_01_27_20719123f3c-8fc4-4075-a26d-0b752b3e4654@hotmail.com>
check for attachements...
attachments found
symlink verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt pass
size verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt pass
blacklist verification for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt pass
attachment valid /mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt
Found 1 valid files
standard attachment mode
trying to parse the correct mimetype for /mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt
result: text/plain | None
mimetype correctly splitted
attachment /mnt/zpool/scripts/multi_report/sendemail_log/20260523_090126.txt done
1 ok attachments
get hostname
hostname retrieved: srv-nas01.localdomain
tryng retrieving if more recipient are set
establing connection based on security level set on TN: PLAIN
entered PLAIN path
adding ehlo to the message
sending PLAIN email
An unexpected error has occured: (450, b'failed to send notification')
KO: (450, b'failed to send notification')

Because with the yesterday 1.91 broke version the attachment fails, and not being delivered let the email success.
The problem Is obviously with attachments, but honestly i don’t know what Is wrong with how sendemail prepare them, i don’t see anything obvious. The attempt made was just to handle safer filenames… because except that and the extension itself, there are no difference between how attachments are served (but zip works…).
At this point, considering that sendemail Is capable to zip attachments but MR doesn’t handle that, i would force always the zip path modifing your local version:
search in the script

if zip_attachments:

And add BEFORE

zip_attachments = True

Final:

zip_attachments = True
if zip_attachments:

Modifying the script as you suggested seems to have worked perfectly! I am now getting the emails complete with the attachments.

I will refrain from updating sendemail.py for now. I am not sure what happened with mailrise. ON march 08, I opened a ticket on the mailrise git but I never heard back from the mailrise developper…

I must be the only one using mailrise with your script. I dont expect you to spend much more time on this as your solution seems to work.

thanks oxyde for the support!

if you will receive some update let me know, also DM me in case so i will not miss the post if some day will pass. You can also reach me directly on github in case.
If there is something i can do, i will be happy to make the adjustement… but at the moment i really don’t know what is making mailrise complaining about the attachments in a different extension from .zip

I ran into the exact same error today on 25.10.4 ([EFAULT] Failed to send email: 'str' object has no attribute 'decode') and found a workaround: fill in the “From Name” field in System → General Settings → Email.

In my case the field was empty, and every test mail failed with the decode error. After setting From Name to a simple string (e.g. “TrueNAS NAS02”), test mails went through cleanly with a success message. No other settings changed.

Looking at the traceback you posted, that fits: the crash happens in mail.py line 288 where the from address is processed — from_addr.encode().decode(). When From Name is empty, from_addr apparently ends up as an email.header.Header object instead of a plain string, and Header.encode() returns a str, which has no .decode() — hence the AttributeError.

Two things worth noting for your setup:

  1. The decode error can mask the real SMTP response. In my testing, mails were sometimes delivered to the SMTP server successfully even though the GUI reported FAILED — the crash happens while processing the sender/response, not necessarily before sending. So your mailrise relay’s 450 failed to send notification from the sendemail.py test is likely a separate, second issue on the relay side worth checking independently.

  2. My setup for reference: SMTP, plain (no encryption), no SMTP auth, local relay on port 25 — so the bug is not related to auth or encryption settings.

Hope this unblocks you. Filed the related TrueCloud error-handling bug as NAS-141287; the From Name issue probably deserves its own report since it has a trivial repro (clear From Name → send test mail → crash).