Debian – Postfix & Dovecot – can’t receive email – status=bounced (unknown user: “some.name”)

debiandovecotpostfix

I have Postfix and Dovecot running. Postfix is set up to use Dovecot as mail transport. Everything is pretty much by book but every received email is bounced back. I am testing the mail server from gmail.

There are some strange queries for each email:

SELECT email FROM users WHERE email ='receiver@domain' (This is ok)
SELECT email FROM users WHERE email ='receiver@domain' (This is ok)
SELECT email FROM users WHERE email ='sender@gmail.com' (Why is postfix checking sender's email against db?)
SELECT email FROM users WHERE email ='@gmail.com' (Why is postfix checking senders domain against db?)

First two mysql queries return a valid result (triple checked).

Bounce message: Diagnostic-Code: X-Postfix; unknown user: "receiver.name"
Only useful bit from maillog: status=bounced (unknown user: "receiver.name")

Any troubleshoot ideas or solutions? I have turned verbose debugging both for Postfix and Dovecot but there is nothing more in the logs.

EDIT:
master.cf – http://pastebin.com/raw.php?i=Yt8QzPfT
main.cf – http://pastebin.com/raw.php?i=rTdEM9m4

Best Answer

We should clarify first that how Postfix works has nothing to do with Dovecot. They certainly cooperate but do not depend on each other.

It is a very common thing to check the sender/recipient and the sender domain for validity. This is a basic guard against spam and all sorts of other "evil" activity.

While not uncommon, your postfix is configured to check against a DB. This makes it slightly more difficult to troubleshoot. What is your configuration main.cf and master.cf? Without them any guess will be a good possibility.