0

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

macmiller
  • 101
  • 1
  • 1

1 Answers1

0

This information should be located in /etc/postfix/main.cf. Open the file and look for two variables:

myhostname=server.myserveraddress.com
mydomain=myserveraddress.com

Note: If you do not have a mydomain variable, you can add it.

Restart Postfix and you should be good:

sudo systemctl restart postfix.service