I recently have been moving from Centos to Debian. A few weeks ago I setup up a server with Postfix / Dovecot and it went fine. I'm doing the same again today but keep getting bounces with the error:
Recipient address rejected: User unknown in local recipient table (in reply to RCPT TO command)
This happens if I send remotely or via sendmail locally.
The users are setup in /etc/postfix/virtual-mailbox
as normal; e-mail address then a space then the domain. I have run postmap /etc/postfix/virtual-mailbox
to create the db file successfully.
This is the result of postconf -n
showing my config changes:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
compatibility_level = 2
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/lib/postfix/sbin
data_directory = /var/lib/postfix
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
inet_interfaces = all
inet_protocols = ipv4
local_recipient_maps = unix:passwd.byname $alias_maps
mail_owner = postfix
mailbox_size_limit = 1073741824
mailq_path = /usr/bin/mailq
message_size_limit = 10485760
mydomain = domain.net
myhostname = domain.net
mynetworks = 127.0.0.0/8, 10.0.0.0/24
mynetworks_style = subnet
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
sendmail_path = /usr/sbin/postfix
setgid_group = postdrop
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_security_level = may
smtpd_banner = $myhostname ESMTP
smtpd_recipient_restrictions = permit_mynetworks,reject_invalid_hostname, reject_unknown_recipient_domain,reject_unauth_destination,reject_rbl_client sbl.spamhaus.org,permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.domain.net/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.domain.net/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
unknown_local_recipient_reject_code = 550
virtual_alias_domains = virtual.host
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_gid_maps = static:20000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = domain.net
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_uid_maps = static:20000
I can see no other errors in the logs just the same Recipient address rejected: User unknown in local recipient table
.
Although it's possible I still haven't got Clam AV / Amavis and Dovecot setup 100% correctly yet, this reject seems like a purely Postfix problem. I can connect to the account's mailbox by the way, so Dovecot appears to be working.