I am setting up my mail server using this chapter of a setup guide https://www.linuxbabe.com/mail-server/setup-basic-postfix-mail-sever-ubuntu.
When doing a simple test to make sure postfix will send the email, using this line --> echo "test email" | sendmail your-account@gmail.com everything works as expected, ie. the defaulted from mail address is root@myserveraddress.com
However when using this test using 'mail' instead of 'sendmail', mail username@gmail.com with mail the defaulted from address is different, it is root@mail.myserveraddress.com. (I will later change the defaults so the mails are not coming from root).
My confusion is finding the source of the subdomain use in the default from the mail program. I am not sure where this is coming from exactly, as the sendmail works fine.
ubuntu 20.04 mail version = 3.4.13
/etc/mailname
– AlexGurin Jul 27 '22 at 18:31