TrueNAS system/email

Ofloo

Explorer
Joined
Jun 11, 2020
Messages
60
Why wouldn't an empty username and password not be ok !? i've been using host based authentication on FreeNAS and pfsense and so forth for decades. Ofcourse the mail server is hosted on a private vlan. And isn't public !?

1608910005211.png
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Perhaps I don't understand the problem, but why do you have an issue about providing a username and password for email? Is there some reason why this is a bad thing?

If the system wants to send a message, how would you know who it came from without the username?
 

Ofloo

Explorer
Joined
Jun 11, 2020
Messages
60
Perhaps I don't understand. Why would you even setup a dedicated user to send mail. Why would this be a requirement. What advantage does this deliver!?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Perhaps I don't understand the problem, but why do you have an issue about providing a username and password for email? Is there some reason why this is a bad thing?

If the system wants to send a message, how would you know who it came from without the username?

Because the username that TrueNAS uses is root. This is for e-mail authentication, which the OP is correct, should absolutely be optional.

Many mail architectures do not even have infrastructure available to provide authentication of this sort. Usernames and passwords are generally only implemented on systems that *receive* e-mail, so that users can log in and retrieve them. In most cases, e-mail designs treat mail from servers as MTA (transmission) e-mail rather than MSA (submission) e-mail, and only MSA allows for user/pass authentication.

The reason you might use MSA is if you are not running your own mail servers (which you should be), and are instead relying on someone like Google or Yahoo! to run your mail, in which case FreeNAS needs to act as an MSA to reliably receive the mail.

Some significant bits have been glossed over here in a bid to make a clearly understandable point. I've got more than three decades as Postmaster running e-mail systems under my belt, going back to UUCP, so let's not quibble details please. ;-)
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Perhaps I don't understand. Why would you even setup a dedicated user to send mail. Why would this be a requirement. What advantage does this deliver!?

Because if you don't run your own mail server and instead rely on Gmail or Yahoo or something, you need to authenticate into them and use them as though they are handling an MSA.

Don't worry, you are correct in the general case.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
@jgreco Thanks for the explanation. I can google it from here to better understand the details.

@Ofloo The question was for my education because the original post caught my interest. This is a great forum to learn about "tech" things, especially when I don't even know what I don't know.

I created a username and password for my FreeNAS to use when sending alerts (via gmail.) It was no big deal to do and the email username has nothing to do with root or any of the accounts on my system. Plus, I can filter on the name which helps organize the alerts.
 

Ofloo

Explorer
Joined
Jun 11, 2020
Messages
60
It's not because it's a lot of trouble that you should. Not creating the account password and username is less work and that should just be an option. While it isn't.

And I don't want to send emails through gmail. I prefer not to use so much google. Why even run a NAS at all just buy cloud storage on google. It's almost as expensive as running your own NAS.

I don't understand your reasoning, .. the why isn't important when it should, it's not about it being a big deal, it's just something that's overall supported. Actually it makes more sense to support no auth mail then it does to support gmail, no auth mail is a standard while gmail is none of that.

Why does TrueNAS support gmail at all !?
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Actually it makes more sense to support no auth mail then it does to support gmail, no auth mail is a standard while gmail is none of that.

Why does TrueNAS support gmail at all !?

For the same reason that so-called "dynamic DNS" is supported (ironically not even supporting true RFC-standardized dynamic DNS last I checked) -- many people are not interested in the masochistic experience of and onerous requirements to set up things like their own DNS, SMTP, NTP, etc.

Look, no one's going to remove the feature just because you and I don't use it, and I already said that email authentication should be optional, which is what you're complaining about, so I don't even see a point to going further down this road. File a bug report, feel free to include a link to this thread, and feel free to post a Jira ticket number here in the thread if you wish.
 

Ofloo

Explorer
Joined
Jun 11, 2020
Messages
60
Creating a ticket right now. Only the website is awfully slow for me.

I upgraded from FreeNAS and funny enough when I send a test mail it still works.

1609077917173.png
 

ColbySilver

Cadet
Joined
Aug 29, 2019
Messages
5
Good day all,

I've discovered that you can still setup to send via your own internal mail server. It feels like a bit of a kludge but the steps below worked for me.

1) First fill it out the form with setting as SMTP and Security as Plain
2) Just put anything in the Username and Password fields to allow you to hit Save.
3) Hit the Save button and leave the form.
3) Then go back in and only change it to GMail OAuth and hit save - DO NOT click the Log In To Gmail button.

If you go to the command shell, you can also check the mail setup directly in the configuration database with the commands below.

root@freenas[~]# sqlite3 /data/freenas-v1.db ".schema system_email"

root@freenas[~]# sqlite3 /data/freenas-v1.db "select * from system_email;"

If you're really fussy, you could also update the table to clear out the gmail em_oauth field with command below (note the value being set is just 2 empty single quotes).

root@freenas[~]# sqlite3 /data/freenas-v1.db "update system_email set em_oauth='';"

Hope it helps some.
 

Emile.Belcourt

Dabbler
Joined
Feb 16, 2021
Messages
23
The option to disable Auth I think I saw was in Truenas 12.0-u2 because I didn't have any issue setting up in U2 but had to roll back to U1 for AD integration. Thank you Colby, your steps worked.
 

CLEsportsfan

Dabbler
Joined
Nov 23, 2020
Messages
20
FYI, if you want to disable SMTP Auth in 12.0-U1, run this command: sqlite3 /data/freenas-v1.db 'update system_email set em_smtp=0, em_user=null, em_pass=null;'
 
Top