title: Mail X Changing Send Domain DKIM Fail
body: <p>I am trying to send mail from a client server through my relayhost out to the recipient (myself) I want to get the mail. On the relayhost I have DKIM enabled to sign the outgoing mail, when I send the mail from the client server via mailx to the recipient (myself) this is the message I see in gmail:</p>
  
  <pre><code>Delivered-To: user@test.com
  Received: by 10.100.177.142 with SMTP id j14csp2053888pjb;
          Tue, 2 May 2017 13:50:42 -0700 (PDT)
  X-Received: by 10.55.134.2 with SMTP id i2mr27389384qkd.43.1493758242648;
          Tue, 02 May 2017 13:50:42 -0700 (PDT)
  Return-Path: &lt;user@mpx.test.com&gt;
  Received: from mex1.mpx.test.com (ec2-XX-XX-XX-XX.compute-1.amazonaws.com. [XX.XX.XX.XX])
          by mx.google.com with ESMTPS id 54si18140615qtv.179.2017.05.02.13.50.42
          for &lt;user@test.com&gt;
          (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
          Tue, 02 May 2017 13:50:42 -0700 (PDT)
  Received-SPF: pass (google.com: domain of user@mpx.test.com designates XX.XX.XX.XX as permitted sender) client-ip=XX.XX.XX.XX;
  Authentication-Results: mx.google.com;
         dkim=fail header.i=@mpx.test.com;
         spf=pass (google.com: domain of user@mpx.test.com designates XX.XX.XX.XX as permitted sender) smtp.mailfrom=user@mpx.test.com;
         dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=test.com
  Received: from mongobkp3.prod.ec2.test.local (mongob.test.local [XX.XX.XX.XX]) by mex1.mpx.test.com (Postfix) with ESMTP id 44942611C7 for &lt;user@test.com&gt;; Tue,
    2 May 2017 20:50:42 +0000 (UTC)
  DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mpx.test.com; s=ggmx2; t=1493758242; bh=3VXQqSI3TifRPzriUPH4q0lpgRebD6P3c0kkEvLMTp0=; h=Date:To:Subject:MIME-Version:Content-Type:
       Content-Transfer-Encoding:Message-Id:From; b=N2mX5xGHWXkO/6AkBCL7V9Ugue3EF7z4FFJmOvtD86yzyqZztJU1biL9R1pZf2iuh
       TMb4joXJZVUXB+rwajy2vLLcWzL7zdk/2os5uNqBS75UgMy3p28vev8tuHPkZ2L+6a
       +9uyIQ+BtTXl1utlqMWyUINDUz5y8jugp/EKVAC4=
  Received: by mongobkp3.prod.ec2.test.local (Postfix, from userid 1085) id 40ED541C8D; Tue,
    2 May 2017 20:50:42 +0000 (GMT)
  Date: Tue, 02 May 2017 20:50:42 +0000
  To: user@test.com
  Subject: Yas
  User-Agent: Heirloom mailx 12.4 7/29/08
  MIME-Version: 1.0
  Content-Type: text/plain; charset=us-ascii
  Content-Transfer-Encoding: 7bit
  Message-Id: &lt;20170502205042.40ED541C8D@mongo.test.local&gt;
  From: User Is Awesome &lt;user@mpx.test.com&gt;
  
  Yas.
  </code></pre>
  
  <p>When I send the email via Telnet this is what I see:</p>
  
  <pre><code>Delivered-To: user@test.com
  Received: by 10.100.177.142 with SMTP id j14csp86725pjb;
          Wed, 3 May 2017 06:46:37 -0700 (PDT)
  X-Received: by 10.55.7.18 with SMTP id 18mr2837811qkh.272.1493819197454;
          Wed, 03 May 2017 06:46:37 -0700 (PDT)
  Return-Path: &lt;user@mpx.test.com&gt;
  Received: from mex1.mpx.test.com (ec2-XX-XX-XX-XX.compute-1.amazonaws.com. [XX.XX.XX.XX])
          by mx.google.com with ESMTPS id s14si19801592qtb.69.2017.05.03.06.46.37
          for &lt;user@test.com&gt;
          (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
          Wed, 03 May 2017 06:46:37 -0700 (PDT)
  Received-SPF: pass (google.com: domain of user@mpx.test.com designates XX.XX.XX.XX as permitted sender) client-ip=XX.XX.XX.XX;
  Authentication-Results: mx.google.com;
         dkim=pass header.i=@mpx.test.com;
         spf=pass (google.com: domain of user@mpx.test.com designates XX.XX.XX.XX as permitted sender) smtp.mailfrom=user@mpx.test.com;
         dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=test.com
  Received: from mex1.mpx.test.com (mongobkp3.prod.ec2.test.local [XX.XX.XX.XX]) by mex1.mpx.test.com (Postfix) with ESMTP id 5595B61135 for &lt;user@test.com&gt;; Wed,
    3 May 2017 13:46:06 +0000 (UTC)
  DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mpx.test.com; s=ggmx2; t=1493819197; bh=fdkeB/A0FkbVP2k4J4pNPoeWH6vqBm9+b0C3OY87Cw8=; h=From:To:Subject:Message-Id:Date; b=TWvjEk3INAcLa9INdkzTvUihEbMQz5ri95AkG3tP9CiVqvhspMn5rfqXK5PrdzQgp
       hd67/rtKwnoh7DtShOmriMHIiS46zi+6btvOigx631Zfdhkakz+UdTg55IH47mn+JG
       BpPhTT7sBNvnwsWIYeQ8UxlyLGEzIsXRyMZm2UWU=
  From: &lt;user@mpx.test.com&gt;
  To: &lt;user@test.com&gt;
  Subject: Test
  Message-Id: &lt;20170503134613.5595B61135@mex1.mpx.test.com&gt;
  Date: Wed,
    3 May 2017 13:46:06 +0000 (UTC)
  
  Test
  </code></pre>
  
  <p>If you notice in the message ID in the case of Telnet the message ID shows the relay server, which in the mailx message it shows the host that the message generated from. In both cases the message generated from the same server. My question is what can I change in mailx so that it acts like telnet and sends the message as my relayhost? Or what do I need to change in postfix so on and so forth?</p>