Setting up email

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
I don't understand what this is trying to tell me (sorry):
The user account Email address to use for the envelope From email address. The user account Email in Accounts > Users > Edit must be configured first.
which user? Accounts > Users > root has my email address: pedz@xyz.com I don't remember how it got there -- perhaps in the initial set up. In any case, under System > Email > From Email it has root@truenas.local ...

Should the two match or not match? There are other fields for the authentication so I'm not sure if it really matters. A reply to the email is not likely to get back to anyone
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
I'm trying various settings (a.k.a. setting bingo) and the closest I come is a long delay ending with
Connection unexpectedly closed
I've now tried two different SMTP servers and three or perhaps four different accounts. Still no go. I'm out of ideas of what to try.
 
Last edited:

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Preferences:

Code:
System -> E-Mail
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
Preferences:

Code:
System -> E-Mail
I don't know what you are trying to tell me ... sorry. I'm in System -> E-Mail trying various settings for both the "From" as well as the authorization id and password (as well as the server -- I tried a server on A2 Hosting and Yahoo).
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
I tried to tell you, to configure a valid existing account right there: System -> E-Mail,

Your mail address in root's contact field (in /etc/passwd) is of no use. As is configuring the system mail account to something local (as long as the TN box isn't your local relay/mailer). Only the "from" field is free for fancy things.

What did you configure exactly (please don't post logins or passwords here)?
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
Thank you very much for your time and effort here. One thing that might give you a clue is each test takes a rather long time -- like minutes. Other processes that I have in Jails also go rather slow. The CPU on the front page is in the 30%-40% range. (Just FYI)

Not your question but just in case: for Accounts -> Users -> root -> email I have my own personal email.

For System -> Email:

From: I create a new account on my hosting site so I was positive I had the right password. I just sent it an email from my personal email account and it worked. Lets pretend this is joe@foo.com

From Name: I put "Root at Truenas"

I have SMTP Authentication picked

For Outgoing Mail Server I put the site that my hosting site tells me to: mail.aix-consulting.com

Mail Server Port: 465

For Security I've tried TLS and SSL (I tend to test with SSL mostly).

SMTP Authentication is checked

Username (under the authentication) I put the id of the account: joe@foo.com ... On this site, sometimes it wants you to replace the @ with a + and so I've tried joe+foo.com as well

Password (under the authentication) I put "Joe's" password.

As I mentioned before, I have a Yahoo account and I found the Yahoo page on how to set up out going SMTP and followed it -- still no go. I do have a Gmail account I could try but I haven't yet. I have also tried my personal account at the A2 Hosting site.

I'm dumping a bunch of files to the NAS. It should be done late tonight. When it completes I'm going to stop all the processes, etc. Do the update that just came out. And see how it goes. I have a couple other weird issues too that I hope a reboot might clean up.
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Well ...

[1] ping your smtp server from TrueNAS shell. If you get replies ...

[2] telnet your mail server's ip on the mentioned port from TrueNAS shell like

Code:
telnet server.ip.adress.here 465


You should see something like:

Code:
Trying server.ip.adress.here ...
Connected to your.mail.server.name.
Escape character is '^]'.


Enter

Code:
bye


and the server should reply with

Code:
Connection closed by foreign host.


[3] If it doesn't work, most probably the port you are trying is wrong. A lot of smtp servers listen on port 587 (STARTTLS). You could try again with telnet ...

Code:
telnet server.ip.adress.here 587


The advantage to try via shell/telnet is this: you get much better feedback to stdout (=console). Please double check, you are using the correct data (server address/name, port, credentials). If it won't work initially via telnet, it won't via the (much more "muted") GUI/TN middleware.

Concerning yahoo accounts there is a caveat:

 
Last edited:

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
Well ...

[1] ping your smtp server from TrueNAS shell. If you get replies ...

[2] telnet your mail server's ip on the mentioned port from TrueNAS shell like

Code:
telnet server.ip.adress.here 465


You should see something like:

Code:
Trying server.ip.adress.here ...
Connected to your.mail.server.name.
Escape character is '^]'.


Enter

Code:
bye


and the server should reply with

Code:
Connection closed by foreign host.


[3] If it doesn't work, most probably the port you are trying is wrong. A lot of smtp servers listen on port 587 (STARTTLS). You could try again with telnet ...

Code:
telnet server.ip.adress.here 587


The advantage to try via shell/telnet is this: you get much better feedback to stdout (=console). Please double check, you are using the correct data (server address/name, port, credentials). If it won't work initially via telnet, it won't via the (much more "muted") GUI/TN middleware.

Concerning yahoo accounts there is a caveat:

If you don't learn something every day, you aren't growing.

From your suggestion, I found this page and I bumbled around until I got it to work:
250 HELP
EHLO
250-mi3-ss4.a2hosting.com Hello cpe-70-94-128-193.satx.res.rr.com [70.94.128.193]
250-SIZE 78643200
250-8BITMIME
250-PIPELINING
250-PIPE_CONNECT
250-AUTH PLAIN LOGIN
250 HELP
AUTH PLAIN AHRydWVuYXNAYWl4LWNvbnN1bHRpbmcubmV0AFRydWVuYXMyMlRydWVOYXMhQA==
235 Authentication succeeded
BYE
500 unrecognized command
DONE

But notice the port that the example uses: port 25. I was putting

openssl s_client -connect mail.foobar.net:465 -starttls smtp

and it wasn't working. I changed the 465 to 25, and it worked. I then went back to the NAS GUI and put 25 instead of 465 and... you guessed it, it worked.

I re-doubled-checked the A2 hosting site and it says 465.
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
So ... it's (usually) plaintext login without encryption. 587 didn't work? ;-)
 

pedz

Dabbler
Joined
Jan 29, 2022
Messages
35
I just now tried port 587 via openssl and it does work but it appears to be the same sequence of messages, the certificate, etc.

LDAP does something similar that might be happening here with SMTP. You have a choice of either starting with TLS by going to a particular TLS port OR you can go to the normal port and give the "Can we please start TLS now" command. I'm guessing that is what the `openssl s_client` stuff is doing.
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
Exactly (that's the above mentioned STARTTLS/opportunistic TLS). It should work via GUI as well, now that it works from the console.
 
Top