2

I have a VPS with multiple IP addresses:

  • venet0:0 x.x.x.2
  • venet0:1 x.x.x.3
  • venet0:2 x.x.x.4
  • venet0:3 x.x.x.5

All IPs have A records

  • m2.domain.com -> x.x.x.2
  • m3.domain.com -> x.x.x.3
  • m4.domain.com -> x.x.x.4
  • m5.domain.com -> x.x.x.5

and rDNS records

  • x.x.x.2 -> m2.domain.com
  • x.x.x.3 -> m3.domain.com
  • x.x.x.4 -> m4.domain.com
  • x.x.x.5 -> m5.domain.com

I have installed postfix + dovecot + mysql + opendkim.

Here is part of my master.cf which starts SMTP:

x.x.x.2:smtp  inet  n  - - - -  smtpd -o myhostname=m2.domain.com
x.x.x.3:smtp  inet  n  - - - -  smtpd -o myhostname=m3.domain.com
x.x.x.4:smtp  inet  n  - - - -  smtpd -o myhostname=m4.domain.com
x.x.x.5:smtp  inet  n  - - - -  smtpd -o myhostname=m5.domain.com

When I telnet to m2.domain.com:25 I get the expected HELO m2.domain.com and so on for all subdomains.

All fine, but in the message header I have the wrong HELO X-Spam-Last-External-HELO: localhost.localdomain.

I didn't set $mydomain in main.cf and values from master.cf did not override it.

How do I set HELO dynamically for all IPs?

Here is a full header

Received: by mail-tester.com (Postfix, from userid 500) id 5E7229FFAC;
    Thu, 26 Mar 2015 23:06:15 +0100 (CET)
Authentication-Results: mail-tester.com; dkim=pass  reason="1024-bit key;
 unprotected key/testing"   header.d=domain.com header.i=@domain.com
 header.b=ow7oSJaj; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail-tester.com
X-Spam-Level: 
X-Spam-Status: No/-0.7/5.0
X-Spam-Test-Scores: DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,
    RP_MATCHES_RCVD=-0.55,SPF_PASS=-0.001
X-Spam-Last-External-IP: x.x.x.2
X-Spam-Last-External-HELO: sender.localdomain
X-Spam-Last-External-rDNS: m2.domain.com
X-Spam-Date-of-Scan: Thu, 26 Mar 2015 23:06:15 +0100
X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record   * -0.6
 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain   *  0.1
 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily    *     
 valid  * -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
 author's   *       domain  * -0.1 DKIM_VALID Message has at least one valid
 DKIM or DK signature
Received-SPF: Pass (sender SPF authorized) identity=mailfrom;
 client-ip=x.x.x.2; helo=sender.localdomain;
 envelope-from=mailbox@domain.com; receiver=web-d60f04@mail-tester.com
Authentication-Results: mail-tester.com; dmarc=pass
 header.from=domain.com
Received: from sender.localdomain (m2.domain.com [x.x.x.2])
    by mail-tester.com (Postfix) with ESMTPS id 21A759FF80
    for <web-D60F04@mail-tester.com>; Thu, 26 Mar 2015 23:06:13 +0100 (CET)
Received: from [10.11.12.128] (unknown [93.123.22.36])
    by m2.domain.com (Postfix) with ESMTPA id E5B0E60CFF
    for <web-D60F04@mail-tester.com>; Thu, 26 Mar 2015 18:06:16 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=domain.com;
    s=mail; t=1427407577;   bh=ipEvgup1uxRHqlEp4/qod7d0wSHd0KX41Jx5NvOQe28=;
    h=Date:From:To:Subject:From;
    b=ow7oSJajrfdEy0naxO6E6KlXsVcjQ6k2josh4mlxj65cMZU/bKJSzwjUb+dvVmkNw
     zwcfgsPCe7OSJ/J2CupvfgNVV/DfpIV94UBOAv8yH9tYgRYZJlJy7xNZ3louzQVQ9j
     6TxCwC4ITnsWykNJEcxrVuorNo9FMSDpU3ynemko=
Message-ID: <551482D8.80500@domain.com>
Date: Fri, 27 Mar 2015 00:06:16 +0200
From: bizportal <mailbox@domain.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101
 Icedove/31.5.0
MIME-Version: 1.0
To: web-D60F04@mail-tester.com
Subject: my email test
Return-Path: mailbox@domain.com
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

Edit:

I've seen the related links but the problem is that all outgoing emails will be from one domain (domain.com), so transport maps and multiple instances will not do the job, or I don't see how.

  • Could you post the **full header** of the problematic email? – masegaloeh Mar 26 '15 at 22:02
  • of course, I can also post the original header with real IPs and domain names if you want – Vladimir Dimitrov Mar 26 '15 at 22:16
  • 4
    possible duplicate of [Using multiple "myhostname" in postfix](http://serverfault.com/questions/624373/using-multiple-myhostname-in-postfix), especially on [violet313](http://serverfault.com/users/240351/violet313) answer. – masegaloeh Mar 26 '15 at 22:57
  • Postfix multi instance is ultimate solution for multiple IP and multiple domain. You can create the **independent** postfix configuration (including HELO name parameter) per instance. Of course the learning curve is bit high. Unfortunately violet313 answer doesn't cover this. – masegaloeh Mar 27 '15 at 15:02
  • That's good I'll try it. The main task is to send one domain's messages (multiple MX records) trough multiple IPs with corresponding DNS records – Vladimir Dimitrov Mar 27 '15 at 15:07

0 Answers0