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

Khan Shahrukh
  • 298
  • 2
  • 4
  • 16

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
  • nano mailname shows mail.mydomain.com should i change it to mydomain.com only ? – Khan Shahrukh Feb 05 '14 at 20:14
  • I change it. You could also use rewrite rules on email being sent to the internet. – BillThor Feb 05 '14 at 20:18
  • @BillThor Are you SURE sendmail on ubuntu honors /etc/mailname? [The file seems to be ignored by sendmail on Debian] – AnFi Feb 05 '14 at 20:59
  • I use Exim which does honour /etc/mailname. I would expect the sendmail to support it, but it is possible the default configuration does not. dpkg-reconfigure would be the other way I would set the value. I have seen /etc/hosts used as well. – BillThor Feb 06 '14 at 03:15
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
  • 892