Is the command-line mail utility not usable under TrueNAS Scale?

When I try to send out any message from the command line using /usr/bin/mail, it disappears. If I use the -v option for more detail, I get:

ddb@fsfs:~/proj/zfsbackup$ mail dd-b@dd-b.net -s "test again" -v < ~bup/logs/worker_20260321-160840CDT_zpdb_bupMiscA.log
LOG: MAIN
  <= ddb@tnsbuilds02 U=ddb P=local S=1095
ddb@fsfs:~/proj/zfsbackup$ delivering 1w4VDm-00000005Dfj-0cJh
R: nonlocal for dd-b@dd-b.net
LOG: MAIN
  ** dd-b@dd-b.net R=nonlocal: Mailing to remote domains not supported
LOG: MAIN
  <= <> R=1w4VDm-00000005Dfj-0cJh U=Debian-exim P=local S=2340
LOG: MAIN
  Completed
delivering 1w4VDm-00000005Dfx-0ikN
R: system_aliases for ddb@tnsbuilds02
R: nonlocal for dd-b@dd-b.net
LOG: MAIN
  ** dd-b@dd-b.net <ddb@tnsbuilds02> R=nonlocal: Mailing to remote domains not supported
LOG: MAIN
  Frozen (delivery error message)

This appears to be saying I can’t send email outside the system? I’ve tried specifying local addresses (users on the server that have email addresses configured), and I get the exact same error – including complaining about the same address, which is not the address in the command for those cases.

I think I’ve figured out how to construct and send an email using the mail.send API, so in terms of accomplishing what I want, I can probably get it done (so far so good anyway). But – if the mail utility isn’t useful, the documentation should probably say so somewhere. Or, if it works fine but I just didn’t wheedle it right, that’d be useful to know (and the wheedle needled should also be documented somewhere).

What version of TrueNAS? Checking @joeschmuck and the Multi-Report posts may help as that emails results.

Here some explanation, has been an headache that time for many :smile:
Using the API for quick message is pretty easy, unless you don’t need to send attachments… in this case instead will be a pain :face_with_peeking_eye: (and that’s why i built my sendemail for Joe’s multi report)

It sounds like you have your email working but if you are looking for a working replacement to send emails, look no further than @oxyde sendemail.py script on GitHub. It works very well.

1 Like