3

I am running Ubuntu 16.04 on Google Cloud Compute. After completing this tutorial on sending Email with SendGrid, I am getting an error when testing sendgrid in command line:

- server3 postfix/trivial-rewrite[15407]: warning:
  hash:/etc/postfix/relayhost_map lookup error for
  "user@server3.<mydomain>.com.au"

server3 postfix/trivial-rewrite[15407]: warning:
sender_dependent_relayhost_maps lookup failure

server3 postfix/error[17434]: B62708488F: to=<recipient@gmail.com>,
relay=none, delay=0.24, delays=0.2/0.02/0/0.02, dsn=4.3.0,
status=deferred (address resolver failure)

Now if I look at this and try to apply some logic to it, I believe that the problem is there is no relayhost_map for my user@server3.<mydomain>.com.au?

Is the relay map missing for the server, or for the user? I seem to get the same error no matter which user I am sending a test email with (I have tried 3 of them that are active).

I am not sure what to do to fix this?

muru
  • 197,895
  • 55
  • 485
  • 740
adam
  • 305
  • Possible, problem in your email address: try to change to 'user@server3.com.au' – Dexter Morganov Oct 03 '17 at 05:44
  • Also, postfix can't detect local address for domain server3..com.au and try to relay mail, then can't find server3..com.au in relay maps and try to contact directly, but no A or MX records configured in DNS. – Dexter Morganov Oct 03 '17 at 05:55

1 Answers1

3

I have figured out what the problem is. This is an important change that needs to be made in /etc/postfix/main.cf. You must ensure that if it exists, the following line is commented out or deleted...

#sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_map

If that line is not commented out, obviously postfix goes looking for a relayhost_map (which does not exist if the tutorials are followed).

Hope this helps someone else... the google cloud tutorial on this is incomplete, as is the sendgrid one.

Zanna
  • 70,465
adam
  • 305