"Recipient address rejected" when sending an email with sendgrid

2

In postfix, I'm using relay_host to send an email to an external address using sendgrid, but I get an error about local ricipient table when sending an email from my PHP code.

This is my main.cf in /postfix/

## -- Sendgrid
smtp_sasl_auth_enable = yes 
smtp_sasl_password_maps = static:username:password 
smtp_sasl_security_options = noanonymous 
smtp_tls_security_level = may 
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587

This is the error message from the log:

postfix/smtpd[53598]: [ID 197553 mail.info] NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 Recipient address rejected: User unknown in local recipient table; from=<help@mydomain.com> to=<john@mydomain.com> proto=ESMTP helo=<localhost.localdomain>

One interesting thing is when I use "sendmail john@mydomain.com" from the command line, the email is delivered successfully using SendGrid. I think it's because this uses postfix/smtp instead of postfix/smtpD

the log for this says,

postfix/smtp[18670]: [ID 197553 mail.info] AAF7313A7E: to=, relay=smtp.sendgrid.net[50.97.69.148]:587, delay=4.1, delays=3.5/0.02/0.44/0.18, dsn=2.0.0, status=sent (250 Delivery in progress)

Thank you

WJB

Posted 2012-10-13T08:31:52.660

Reputation: 23

I am also facing similar issue. The error I see in /var/log/mail.log is Feb 3 22:57:29 vsempprdapp11 postfix/error[24019]: 327A4441481: to=<DistU_MyAdmin@mydomain.com>, relay=none, delay=193633, delays=193632/1/0/0.01, dsn=4.3.0, status=deferred (unknown mail transport error) – swapab – 2016-02-04T06:58:23.563

Check your formatting please. You have to indent code by 4 spaces or press Ctrl-K for it to display correctly. – slhck – 2012-10-13T08:36:57.023

No answers