title: Postfix SMTP on Remote Server Responds 554 Relay Access Denied for rcpt (recipient). Works okay on 'localhost' smtp server
body: <p>I'm trying to send e-mail through  a remote vm running <code>postfix</code> as an smtp server.</p>
  
  <p>However, I'm receiving a <code>554 - Relay access denied</code> error when sending the <code>rcpt</code> cmd.</p>
  
  <pre><code>(554, b'5.7.1 &lt;xxxxx@xyz.org&gt;: Relay access denied')
  </code></pre>
  
  <p>I understand that it is denying the e-mail address I'm attempting to set as a recipient, but I don't understand why.</p>
  
  <p><br></p>
  
  <p>The socket connection itself establishes fine, and I'm able to send a <code>mail</code> cmd prior to attempting <code>rcpt</code>.</p>
  
  <p><br></p>
  
  <p>Environment Details:</p>
  
  <p>Host Machine:</p>
  
  <blockquote>
    <p>Windows 7 machine / Language: Python 3.</p>
  </blockquote>
  
  <p>Guest VM:</p>
  
  <blockquote>
    <p>Docker container (Ubuntu) VM running <code>postfix</code>, <code>ssh</code> -- with dhcp-assigned ip address <code>10.35.50.166</code>.</p>
  </blockquote>
  
  <p><br></p>
  
  <p>This is the <code>python</code> code running:</p>
  
  <p>(on host machine):</p>
  
  <pre><code>import smtplib
  server = smtplib.SMTP(host='10.35.50.166', port=8025)
  
  server.mail('xxxxx@xyz.org')
  (250, b'2.1.0 Ok')
  
  server.rcpt('xxxxx@xyz.org')
  (554, b'5.7.1 &lt;xxxxx@xyz.org&gt;: Relay access denied')
  </code></pre>
  
  <p>Running from the guest machine, the <em>error does not occur</em>:</p>
  
  <pre><code>import smtplib
  server = smtplib.SMTP(host='localhost', port=8025)
  
  server.mail('xxxxx@xyz.org')
  (250, b'2.1.0 Ok')
  
  server.rcpt('xxxxx@xyz.org')
  (250, b'2.1.5 Ok')
  </code></pre>