1 (edited by ag 2015-11-27 21:26:18)

Topic: Multiple domains and hostname problem

==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Debian 6
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hello,
I have a problem with "SMTP valid hostname" while testing my domains at mxtoolbox.com. I get "Reverse DNS is not a valid Hostname" (check attachment).

First of all I have one server with 4 domains, each domain has got it's own IP. All domains are configured the same way in my ISP dns panel also at the server but one domain let's call it domain2.com everything is ok, no "Reverse DNS is not a valid Hostname" error. I think that it's because my server is called server.domain2.com.

I don't know what could I change more, maybe I should add some record to my ISP dns zone which will point that for ex. domain1.com hostname is server.domain2.com or something else in postfix configuration.

I've added to my master.cf

xxx.xxx.xxx.xxx:smtp      inet  n       -       -       -       -       smtpd -o myhostname=mail.domainX.com

foreach ip/domain but the problem remains. It still use the hostname from main.cf.

We are being regulary blocked by hotmail/outlook and I want to fix this error because I think that it could be one of the reasons.

Thank you.

Post's attachments

mxtoolbox.jpg
mxtoolbox.jpg 53.57 kb, 1 downloads since 2015-11-27 

You don't have the permssions to download the attachments of this post.

----

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

2

Re: Multiple domains and hostname problem

it should work if you remove '-o myhostname=xxx' in master.cf.

It's very normal to host multiple mail domains on one server, with one server hostname.

3

Re: Multiple domains and hostname problem

When I do that i still have this problem, and new one with SMTP Banner:

SMTP Banner Check : Reverse DNS does not match SMTP Banner

Because if I remove this, than SMTP Banner is my hostname "server.domain2.com"

4

Re: Multiple domains and hostname problem

*) Do all your hostnames used in master.cf have reverse DNS records?
*) What's the default helo name used by your Postfix? Show us output of command "postconf smtp_helo_name".

5

Re: Multiple domains and hostname problem

1, In my ISP panel I have set revDNS for each IP, I've set my domains domain1.com, domain2.com, etc. Should I set mail.domain1.com, mail.domain2.com, etc.?

2, I get:

root@aaa:~# postconf smtp_helo_name
smtp_helo_name = $myhostname

But in my master.cf I've added this entry foreach domain:

domain-smtp     unix -       -       n       -       -       smtp
    -o smtp_bind_address=xxx.xxx.xxx.xxx
    -o smtp_helo_name=domain.com

Based on this tutorial: http://www.iredmail.org/docs/send.out.e … esses.html

6

Re: Multiple domains and hostname problem

*) What's output of command "postconf myhostname"? Does this server hostname has proper A record in DNS?
*) Do you have proper A record in DNS for all domain names specified in 'smtp_helo_name='?

7 (edited by ag 2015-11-30 19:55:24)

Re: Multiple domains and hostname problem

I don't use BIND, I setup DNS in my ISP Panel.

1, My server name is:

myhostname = server.domain2.com

Well I don't have in domain1.com, domain3.com and domain4.com DNS A record for server.domain2.com, should I have one?

2, Yes, every domain have A record with smtp_helo_name; domain1.com, domain2.com, etc.

8

Re: Multiple domains and hostname problem

Does your server IP address have a PTR record (reverse hostname)? For example, our iRedMail server (@iredmail.org):

$ dig -x 45.56.127.226 +short
mail.iredmail.org.

9

Re: Multiple domains and hostname problem

When I check every IP of the domain in response I get this domain with "." at the end, so:

domain1.com.
domain2.com.
etc.

So every IP point to correct domain, should it point to myhostname?

mail.domain1.com.
mail.domain2.com.
etc.

If so, how should I set it in server/ISP Panel?

10

Re: Multiple domains and hostname problem

The reverse name should point to the HELO name. If you set 'smtp_helo_name' for each domain, you should point the IP to the name specified in 'smtp_helo_name'.

Also:

*) Your email domain name must have A and MX records in DNS.
*) Your server hostname must have an A record.
*) Hostnames specified in all 'smtp_helo_name=' must have valid A records.
*) All your IP addresses must have PTR record (reverse DNS) and points to the the hostname specified in proper `smtp_helo_name`.

Please double check above DNS records. If you still get some failure, please show us the latest, FULL error message for troubleshooting.

11 (edited by ag 2015-12-02 16:00:46)

Re: Multiple domains and hostname problem

Your email domain name must have A and MX records in DNS.

For every domain in my ISP i have:
domainX.com   A   xxx.xxx.xxx.xxx


Your server hostname must have an A record.

Do you mean, hostname of the server or hostname which is set in master.cf (mail.domainX.com) for each domain. If the hostname of the server which is server.domain2.com, than I can't do that because in ISP panel automatically is added domain address, so when I add "server.domain2.com" I get "server.domain2.com.domain1.com".

Should I add just "server", so it would be "server.domainX.com" ?


Hostnames specified in all 'smtp_helo_name=' must have valid A records.

My smtp_helo_name is just name of the domain, so domainX.com and I already have A record (first quote).


All your IP addresses must have PTR record (reverse DNS) and points to the the hostname specified in proper `smtp_helo_name`.

My smtp_helo_name is just name of the domain, so domainX.com and in my ISP I've have that IP xxx.xxx.xxx.xxx is domainX.com

Please double check above DNS records. If you still get some failure, please show us the latest, FULL error message for troubleshooting.

Except of mxtoolbox test and not delivering e-mails to hotmail from domains other than domain2.com (which is in my server hostname server.domain2.com) I don't have any others error messages

here is what mxtoolbox inform about error:

More Information About Smtp Valid Hostname

Your Reverse DNS Record (PTR) is not a valid host name. According to email sending best practices, a PTR Record should be a valid host name. If the PTR Record is not a valid hostname, there is a likelihood that you will experience email delivery issues with anti-spam services.

If it's ok when I send e-mails to hotmail from domain2.com but there is a problem when I send it from domain1.com, domain3.com and domain4.com I assume that it's because hostname of the server (machine) is server.domain2.com and the solution should be informing others that machine is also working with domain1,3 and 4 in postfix configuration or maybe in DNS zone of my ISP. I don't know this is just my assumptions.


//EDIT:

I've changed myhostname and myorigin in main.cf to server.domain4.com, restarted postfix but in mxtoolbox problem with domain4.com still is the same, so it's not the case of myhostname and myorigin in postfix.

12

Re: Multiple domains and hostname problem

ag wrote:

Your Reverse DNS Record (PTR) is not a valid host name.

PTR record is used by IP address in DNS, so you must make sure all your IP addresses point to valid hostname, and matches the hostname specified in 'smtp_helo_name='.

13 (edited by ag 2015-12-04 15:07:48)

Re: Multiple domains and hostname problem

Ok, I finally did it!

Maybe it will help someone if I write how I've set it:

1, Base on this tutorial I've set all my domains:
http://www.iredmail.org/docs/send.out.e … esses.html

2, For each domain I've added this to my master.cf:

xxx.xxx.xxx.xxx:smtp      inet  n       -       -       -       -       smtpd -o myhostname=mail.domainX.com

3, At my ISP Panel I set reverse DNS to mail.domainX.com, for each domain.

4, At my ISP Panel I've set this records for each domain:

domainX.com         NS     MY_ISP_DNS_1.           
domainX.com         NS    MY_ISP_DNS_2.          
domainX.com            A        xxx.xxx.xxx.xxx            
www.domainX.com    A        xxx.xxx.xxx.xxx           
*.domainX.com        A        xxx.xxx.xxx.xxx            
domainX.com.        TXT        v=spf1 ip4:xxx.xxx.xxx.xxx a:domainX.com -all          
dkim._domainkey.domainX.com.    TXT    v=DKIM1;k=rsa;p=MY_GENERATED_KEY           
mail.domainX.com         A     xxx.xxx.xxx.xxx            
mail.domainX.com        MX    domainX.com.          
domainX.com                    MX    domainX.com.

I also want to set DMARC and I hope that will help improve my server reputation.

Thank you.