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 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
  • `root@mail:~# echo "test 00000999" | sendmail myemailaddress@yahoo.com root@mail:~# mail myemailaddress@yahoo.com Cc: Subject: test lllllllllllllllllllllllllllll a test ...............................
    another line
    root@mail:~#`
    

    for some reason it is not working, here are the two tests, the 'mail' test comes back with a different from after adding a mydomain to /etc/postfix/main.cf

    – macmiller Jan 15 '21 at 09:10