3

I have two IP address running on Postfix and each IP has own domain. In short i want to isolate domain so outside folks think it is running on own IP and fully isolated even PTR also

But in postfix it not handling myhostname option IP specifically. it always use default value set in mail.cf file

I have tried to set -o myhostname=abc but it still using mail.cf value. Because of it my IP got block in SPAM list

How do i set IP specific myhostname so HELO banner looks good

Updated:

This is what going on:

I have two IP address on my Postfix mailserver I want to host two domain isolated with each other so no one can find out they are hosted on same server.

abc.com 1.1.1.1 zyx.com 2.2.2.2

Hostname of server is mail.abc.com so obvious postfix use it as myhostname

If i send email from zyx.com domain to helocheck@cbl.abuseat.org to check what helo my server sending then i am getting following reply, it is saying we mail system at host mail.abc.com ( thats why i want to use myhostname variable to set it base on which IP it is using to send email)

I am worry may be CBL blacklist my IP because Hostname is different and HELO FQDN is different.

This is the mail system at host mail.abc.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<helocheck@cbl.abuseat.org>: host helocheck.abuseat.org[54.245.112.115] said:
    550 *** The HELO for IP address 2.2.2.2 was 'mail.zyx.com'
    (valid syntax) *** (in reply to RCPT TO command)
1
+50

-o myhostname=abc not much important. To affect HELO You must override -o smtp_helo_name=abc

Values configured in main.cf has complex inheritance, but it work only on main.cf loading. When You override some parameters latter, You need override all necessary.

For now, I dont know how to force postfix to send mail from domain over correct worker, But I think it possible.

UPD.

-o smtp_helo_name= enforce HELO FQDN. Additionaly You need define corresponding A (in Your domain zone) and PTR (in reverse zone of ISP or Datacenter or own if You have AS) records for Your server.

Example: -o smtp_helo_name=mailserver.abc.com

Your Domain Zone abc.com

mailserver A 203.0.113.23

ISP Zone 113.0.203.in-addr.arpa

23 PTR mailserver.abc.com

It not necessary to match FQDN and mail domain it can be different. Primary, HELO FQDN resolvable to IP and IP resolvable to FQDN

$ host mailserver.abc.com
mailserver.abc.com has address 203.0.113.23
$ host 203.0.113.23
23.113.0.203.in-addr.arpa domain name pointer mailserver.abc.com

https://serverfault.com/questions/41693/best-practices-for-preventing-you-from-looking-like-a-spammer

  • I have update my Question for better understanding – Satish Jan 14 '15 at 20:32
  • Update reply to be more clear. – mmv-ru Jan 14 '15 at 23:25
  • 1
    So you are saying myhostname isn't important only important is sending domain should have FQDN with PTR record for HELO, right? – Satish Jan 15 '15 at 20:58
  • 1
    I am confused with OS hostname and running Multiple Virtual mail domain, But look like if postfix sending proper HELO using smtp_helo_name option then we are good right? – Satish Jan 15 '15 at 21:00
  • Yes, if speak about HELO checks. There some other checks, that detect SPAM, what You must meet, to lover Your SPAM rating. – mmv-ru Jan 19 '15 at 9:12
2

If you want distinct myhostname then you may interested in Postfix Multipe Instance, see the official documentation here.

With this feature, each instance will get one IP address and one myhostname parameter. And because the default value of smtp_helo_name was myhostname, then your helo name should match your myhostname.


For example, you have two domains, xyz.example with IP address 192.168.1.1 and abc.example with IP address 10.10.0.2 (see RFC 2606 section 2). Note: This short tutorial was performed on CentOS 6.5

  • Configure your default postfix installation to use myhostname mail.abc.example and inet_interface 10.10.0.2.
  • Tune your postfix configuration on default instance, such as configuration of smtpd_*_restrictions.
  • Create the second instance with postmulti tool.

    postmulti -e init
    

    this will insert multi_instance_ configuration in main.cf

    postmulti -I postfix-secondary -e create
    

    this will create new instance named postfix-secondary. It will create new configuration directory /etc/postfix-secondary and another directory such as spool and data directory.

  • Second instance will come with default configuration. You should replicate the configuration on first instance. Of course you have to set different parameter value for these parameter

    queue_directory = /var/spool/postfix-secondary
    data_directory = /var/lib/postfix-secondary
    multi_instance_name = postfix-secondary
    myhostname = mail.xyz.example
    inet_interfaces = 192.168.1.1
    
  • Ensure that parameter multi_instance_enable = yes was listed in secondary main.cf.

Done. Refer to the docs for available command for administrating postfix multi instance.


Notes:

  • Postfix Multiple Instance will seems overkill for your need. However, it gives you better level of isolation. For example: your bounce mail above still contains trace about mail.abc.example. With multiple instance, you will get bounce email from mail.xyz.example if you send it from xyz instance.

  • You need maintenance both configuration as postfix doesn't sharing configuration between two instance

  • Another solution proposed by mmv-ru was sufficient to preventing you from looking like spammer. Server FQDN doesn't have same value with smtp_helo_name. Just ensure that you have proper PTR record of the domain specified on smtp_helo_name :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.