0

I have a Ubuntu server with nginx I have installed sendmail on it by running

apt-get install sendmail

I was also able to sendmail using

sendmail <my_email_address>
hello
.

the mail I received on the specified email was from myusername@ns1234.ip-12-34-23.eu. Here myusername is the username of my ubuntu machine I want to create new mail accounts like info@mydomainname.com contact@mydomainname.com etc. I have read many guides but they assume that the person is running apache2 so the folders were different from what I have

2 Answers2

1

nginx/apache is not particularly relevant to setting up email user ids and servers.

Check the contents of /etc/mailname. This should be where the nsoo1234.ip-12-34-23.eu is set. Change the name to the domain in this file you want to use.

Setting up a mail server for reliable delivery takes a bit of work. If you are just sending, you can configure your mail server as a smarthost, and use your ISP's relay server.

Incoming mail requires DNS configuration to work correctly. You may find my post on Running an Email Server helps. You should also consider setting up SPF (Sender Policy Framework) record in DNS to discourage use of your domain(s) to send spam.

I prefer to use exim4 instead of sendmail. Others prefer to use postfix. In most cases any of the three will work as a drop in replacement for the others. Their construction and configuration are significantly different, but the functionality is the same.

BillThor
  • 4,698
0

IMHO The simplest way is to change your host FQDN (Fully Qualified Domain Name) to name with MX or A DNS records in public DNS.

How to set the fully qualified domain name in 12.04?

AnFi
  • 902