1

Topic: Change mail server name and not hostname

Hello, I am on freshly installed centos 7 with latest iredmail and everthung works. The how to in install said and I added(the entries are made up and ip's also is made up):

# Part of file: /etc/hosts
127.0.0.1   main.mokoko.com main localhost localhost.localdomain

Now, I want my mail server to be: mail.mokoko.com but I do not want to change hostname and fqdn. Should I just change it in postfix main.cf to mail.mokoko.com and add dns record?

Also, shouldn't' the entrie in /etc/hosts rather be like  this after the installation:

# Part of file: /etc/hosts
127.0.0.1    localhost localhost.localdomain
34.23.122.288 main.mokoko.com main (ip is fake just for example)
?

Thank you smile

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2 (edited by Clouseau 2016-01-13 20:39:34)

Re: Change mail server name and not hostname

I am asking this because mails from system daemons are not getting through:

rkhunter

<root@localhost.main.mokoko.com>: Host or domain name not found. Name service
    error for name=localhost.main.mokoko.com type=A: Host not found

In rkhunter cronjob out of default there is mail:
MAILTO=root@localhost
/bin/cat $TMPFILE1 | /bin/mail -s "rkhunter Daily Run on $(hostname)" $MAILTO


When I run in terminal: mail -s "rkhunter Daily Run on $(hostname)" root@localhost it doesn't work. The suffix main.mokoko.com is getting glued to root@localhost address.

For monit I had to add in monitrc  set mail-format { from: monit@main.mokoko.com} instead monit@localhost because it also doesn't work...

I think the problem is in resolv.conf which is default and configured per iredmail install instructions ...

3

Re: Change mail server name and not hostname

Clouseau wrote:

Now, I want my mail server to be: mail.mokoko.com but I do not want to change hostname and fqdn. Should I just change it in postfix main.cf to mail.mokoko.com and add dns record?

Do you mean you want to use 'mail.mokoko.com' as the domain part in email address? if so, you should add a new mail domain with iRedAdmin instead.

4

Re: Change mail server name and not hostname

Ignore my first question because I wanted my server to have different fqdn than my mailserver name so the remote smtp could see mail.mokoko.com instead of main.mokoko.com. I left the default and didn't chaneg anything, my mailname is the same as fwqdn of server - main.mokoko.com
BUT I do not know why there are problems regarding monit from field, and rkhunter and etc... Can I just set /etc/hosts file to:

127.0.0.1    localhost localhost.localdomain
34.23.122.288 main.mokoko.com main (ip is fake just for example)

instead of:
127.0.0.1   main.mokoko.com main localhost localhost.localdomain

Or the problem regarding daemons sending emails to root is unrelated to this?

5

Re: Change mail server name and not hostname

If I use this in bash: /bin/mail -s "test" root@localhost

I get this:

<root@localhost.main.mokoko.com>: Host or domain name not found. Name service
    error for name=localhost.main.mokoko.com ype=A: Host not found

Why is fqdn of server attached to localhost when sending to root@localhost?

6

Re: Change mail server name and not hostname

I have fixed this by adding to main.cf:
append_dot_mydomain =  no

There has been a change in default postfix settings for that setting, from no to yes...