Empty from address bounce messages postfix


We've got 2 postfix servers. One is a smtp server(server1) and the other is pop/imap server(server2). When I send a message to an unknow user the smtp server(server1) wants to send I bounce message back to me. The bounce message is send to the incoming mailserver(server2)which is correct. I don't recieve that message and when i look at the logs I see the following:
 said: 554 5.7.1 This message has been blocked because the return email domain is invalid.(failed to obtain DNS record for domain ) (in reply to end of DATA command))

The return path is empty thats why I get this message. How can I prevent this?

Hope somebody can help me out.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The rules in you main.cf are not in the correct order or your missing a permit somewhere.
You should permit all mail from server1 to server2.
add server1's ip address to mynetworks or something to allow it to bypass the later checks.

If you're not sure, post your main.cf here and we can take a look.
NetaffairsAuthor Commented:
Hello bevhost,


I found it. This is a part of the main.cf:
smtpd_recipient_restrictions =
   check_client_access hash:/etc/postfix/access,

I want to keep using this part and "whitelist"server1. Is that possible?
if you add the ip address of server1 to mynetworks OR /etc/postfix/access (as a permit)
then the rules below that would never get processed (for that client IP).
NetaffairsAuthor Commented:
I added our iprange and i did a postfix reload but that didn't help. Do i need to stop and start postfix?
When you change an access file, you have to rebuild the database.

# postmap hash:access

This creates a file access.db which is the file postfix actaully uses.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Protocols

From novice to tech pro — start learning today.