0

I'm using a Python smptd server on an AWS instance. It's listening on localhost, port 25. I can send mail to it through a Python smtp client on the same instance. I have an elastic IP associated with the instance. I'm calling that IP address 54.xx.xxx.x.

When I try to send from my laptop like this:

echo "Hello" | mail -s "Test" info@54.xx.xxx.x

I get a bounce:

Final-Recipient: rfc822; info@54.xx.xxx.x
Action: failed
Status: 5.1.3
Diagnostic-Code: X-Postfix; bad address syntax

The security group for the instance has port 25 open:

enter image description here

How can I debug this?

  • Are you actually enclosing the Elastic IP address in square brackets, like info@[192.0.2.1]? In that case I'd suggest editing your question, illustrating it using the address 192.0.2.1 (which is an address that can be used for documentation and examples) to make your question more clear. – Per von Zweigbergk Jul 28 '14 at 06:53
  • @PervonZweigbergk Edited. –  Jul 28 '14 at 16:47

2 Answers2

0

Ask postx for more detailed delivery report via email:
http://www.postfix.org/DEBUG_README.html#trace_mail

#!/bin/sh
/usr/sbin/sendmail -i -v 'info@[Elastic IP address]' <<END 
Subject: test 

Hello
END
AnFi
  • 5,883
  • 1
  • 12
  • 26
0

In order to send an email using an IP address you need to use square brackets around it.

Valid: example@[192.0.2.1]

Invalid: example@192.0.2.1

See this reference: https://www.rfc-editor.org/rfc/rfc5321#section-4.1.3

Per von Zweigbergk
  • 2,615
  • 2
  • 17
  • 27