ElectricEel-24.10.1 Issue

I recently upgraded to 24.10.1 from 24.10.0.2 and I have run into a problem with scripts sending (or not sending) emails.

I have been jumping back and forth between 0.2 and .1 and can now say that 24.10.0.2 can send both files with this sendmail code …

sendmail -t < TrueNASInfo2410-02.txt

However, 24.10.1 can not send the file.

TrueNASInfo2410-1.txt file content
To: myNASEmail@gmail.com
Subject: [SCALEPROD] TrueNAS Scale System Info
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="===== MIME boundary; TrueNAS server SCALEPROD ====="
--===== MIME boundary; TrueNAS server SCALEPROD =====
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<html><head></head><body><pre style="font-size:14px; white-space:pre">
---------------------------------------------
Script run from Cron Job
Script name: TrueNASInfo.sh
TrueNAS Version: TrueNAS-SCALE-24.10.1
---------------------------------------------

kernel.ostype = Linux
kernel.osrelease = 6.6.44-production+truenas
TrueNAS Version: TrueNAS-SCALE-24.10.1
Check for Updates: No Updates

---------------------------------------------

</pre></body></html>
--===== MIME boundary; TrueNAS server SCALEPROD =====--

Best check the Changelog before I ask what is going on.

Ahh. Well … that changes things. Read up on exim yields this as the key command

exim -v myNASEmail@gmail.com < TrueNASInfo2410-1.txt

… which gives me this error message …

LOG: MAIN
  <= root@tnsbuilds01.tn.ixsystems.net U=root P=local S=1183
root@ScalePROD:/mnt/SnappitySnap/TrueNASInfo/Scripts/zemailData# delivering 1tOcw6-0002ph-1q
R: nonlocal for myNASEmail@gmail.com
LOG: MAIN
  ** myNASEmail@gmail.com R=nonlocal: Mailing to remote domains not supported
LOG: MAIN
  <= <> R=1tOcw6-0002ph-1q U=Debian-exim P=local S=2508
LOG: MAIN
  Completed
delivering 1tOcw6-0002pk-1y
R: system_aliases for root@tnsbuilds01.tn.ixsystems.net
R: nonlocal for myNASEmail@gmail.com
LOG: MAIN
  ** myNASEmail@gmail.com <root@tnsbuilds01.tn.ixsystems.net> R=nonlocal: Mailing to remote domains not supported
LOG: MAIN
  Frozen (delivery error message)

… which basically boils down to …

Mailing to remote domains not supported

Some googling lead me to change update-exim4.conf.conf under /etc/exim4

# dc_eximconfig_configtype='local'
dc_eximconfig_configtype='internet'

… which didn’t help, even after restarting exim and a reboot.

What next?

1 Like

This change broke the VERY useful multi_report script from @joeschmuck.

I understand the reason for those security-related changes, but there should be a working alternative in place.

1 Like

This is the change that broke my script as well. I have not found a solution yet.

The only solution I found was to roll back to 24.10.0.2

That is my solution too. I assume you can test sending emails with exim in 24.10.0.2

You can check the status by using cat /var/log/mainlog which will show you the log file vice waiting on an email that doesn’t show up.

I still get R=nonlocal: Mailing to remote domains not supported as the error message.

I am unsure what the equivalent command is for exim, I thought it was exim -i -t < myfile.txt but it still gets blocked. I searched the internet a good portion of yesterday and tried a lot of different things (config file changes and different exim switches), still no luck.

If you uncover something, I of course am greatly interested as I’m sure many others who have scripts that send them emails. And I also attach files to my emails periodically so that for me is also important.

Good hunting!

P.S. This is a security update, so sendmail will not be coming back.

1 Like

As mentioned before, I have a few homemade rclone backup scripts that send mail reports on completion; they use the mail utility at /usr/bin/mail, with said path hardcoded in the script.

This works, even on 24.10.1, but is probably too inflexible for your script, as I have not found a way to do attachments.

I will be spinning up a seperate VM of TrueNAS 24.10.1 to test with, I’m tired of changing my real system back and forth.

I will investigate the /usr/bin/mail on that VM. I may need to make a big change to the script to make it work, but first I need to be able to send myself an email form 24.10.1. Any email other than the GUI test.

3 Likes

My script’s last line is

cat $summaryfile | /usr/bin/mail -s "${subject}" xxx@xxx.com

This is enough to send me the body of the report (piped to $summaryfile) and a variable subject, with the result of the rclone run.

It is a very simple script - the $summaryfile is just a plain text report collated from the output of rclone, but still it works in 24.10.1 and keeps me updated regarding my backups.

I still get the

grafik

So there must be a way?

The lucky dogs at iXsystems of course can make it happen, they are the ones who added the security restriction. Yesterday I had to take a break from this project :shushing_face: and instead started to learn more about 3-D printing (for the new printer I have). I have completed that for now, time to turn my focus back to this email issue. :grin:

2 Likes

They already got a bug report. I like their response …

How about we ask ‘you will need to show us how to use exim with truenas Scale

2 Likes

Right now,

  1. iX: sendmail is gone, use exim!
  2. exim: no external mail relaying!
  3. goto 1
1 Like

Ah ha! That at least explains why I didn’t get my report this morning. And seeing as Joe’s script has already saved me once when a 6 month old drive failed last week…

I would have expected something as standard as sendmail in all/most distributions being removed would have been flagged well in advance with workarounds before release. It’s hardly a rarely-used function of *nix.

@joeschmuck maybe try the api call “mail.send”