I have Ubuntu Server 22.04, Postfix, Dovecot, MariaDB and Roundcube Webmail.
I’ve created two mailboxes: [email protected] and [email protected]. If I try to send a message to each other or to itself I’ll get the error: “SMTP Error (550): Failed to add recipient… (5.1.1…: Recipient address rejected: User unknown in virtual alias table)
.”
In /var/log/mail.log I saw the warning
“postfix/trivial-rewrite[113120]: warning: do not list domain epam.tr in BOTH virtual_alias_domains and virtual_mailbox_domains”.
Of course, I’ve googled it and checked postconf parameters.
ilya@relay:~$ postconf mydestination virtual_mailbox_domains virtual_alias_domains
mydestination = localhost.$mydomain, localhost, localhost.localdomain
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_domains = $virtual_alias_maps
and content of these files
/etc/postfix/mysql_virtual_domains_maps.cf
user = postfix
password = 123
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%u'
/etc/postfix/mysql_virtual_alias_maps.cf
user = postfix
password = 123
hosts = localhost
dbname = postfix
query = SELECT domain FROM domain WHERE domain='%u'
Also I’ve commented the option myorigin
in /etc/postfix/main.cf
, but it hasn’t helped. I think there is a mistake in the domain name or the hostname in the postfix config, but I can’t catch it.
ilya@relay:~$ hostname --fqdn
relay.epam.tr.local
The full postconf output is
ilya@relay:~$ postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
compatibility_level = 3.6
dovecot_destination_recipient_limit = 1
inet_interfaces = all
inet_protocols = ipv4
mailbox_size_limit = 0
mydestination = localhost.$mydomain, localhost, localhost.localdomain
mydomain = epam.tr.local
myhostname = relay.epam.tr.local
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_helo_required = yes
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/mail/public.pem
smtpd_tls_key_file = /etc/ssl/mail/private.key
smtpd_tls_security_level = may
smtpd_use_tls = yes
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:1024
virtual_mailbox_base = /home/mail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 1024
virtual_transport = dovecot
virtual_uid_maps = static:1024
About proxymap:
Aug 29 10:21:33 relay postfix/trivial-rewrite[118618]: warning: dict_proxy_lookup: service proxymap: Connection reset by peer
0 Answers