I've recently set up a mail server with Postfix, Dovecot, Mysql and I'm able to send mail from the server. I am unable to recieve mail however. When testing, I send an email my my gmail account to the server email account and I recieve: Recipient address rejected: User unknown in virtual mailbox table (state 13)

UPDATE: OK the fix for this was to change the user_query in /etc/dovecot/dovecot-sql.conf.ext to the following
user_query = \
SELECT '/var/vmail/%d/%n' as home, 'maildir:/var/vmail/%d/%n' as mail, \
150 AS uid, 8 AS gid, concat('dirsize:storage=', quota) AS quota \
FROM mailbox WHERE username = '%u' AND active = '1'

UPDATE: Everything is fixed and working. Unfortunately I ran into about a million problems after this one and went on a bug fix spree so I'm not sure how I fixed this problem at the moment. I'll try to help anyway though if anyone comes across this.

This error was due to me not giving the ability for users to auth with the server. I had ssl and plain text login turned off, configuration error on my part. I enabled those and this problem went away. You'll have to dig around in the dovecot conf to find the exact settings to do it but start there.