Not sure where I got it wrong.
I've configured postfix so that it works well when doing:
- Relaying/redirecting email from external sources to users' virtual mailboxes (e.g., to their Gmail account)
- Sending email from internal sources (e.g., server alert) to external mailboxes (e.g., to my personal email)
But it failed doing:
Sending email from internal sources (aforementioned server alert) to users' virtual mailboxes.
I got errors like this:
Jan 08 03:21:16 hermes postfix/qmgr[153]: CDBB11BC1A1F: from=<alerter@noreply.mycompany.com>, size=1012, nrcpt=1 (queue active)
Jan 08 03:21:16 hermes postfix/virtual[5307]: CDB4C1BC165E: to=<pepoluan@mycompany.com>, relay=virtual, delay=25790, delays=25790/0/0/0, dsn=4.3.5, status=deferred (mail system configuration error)
pepoluan@mycompany.com
is relayed/redirected through virtual table to my personal mailbox.
Any pointers on where I should troubleshoot?
EDIT 1: Here's my main.cf
:
maillog_file = /dev/stdout
smtp_helo_name = hermes
myorigin = localhost
myhostname = hermes.mycompany.com
mydestination = noreply.dto.kemkes.go.id
mydomain = noreply.mycompany.com
smtpd_banner = $myhostname ESMTP
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
smtpd_tls_session_cache_database = lmdb:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = lmdb:${data_directory}/smtp_scache
smtpd_tls_chain_files =
${config_directory}/star_mycompany_com.pem
smtpd_tls_security_level = may
transport_maps =
sqlite:/etc/postfix/transport-sqlite.cf
# Don't accept mail from domains that don't exist.
smtpd_sender_restrictions =
check_sender_access sqlite:/etc/postfix/sender-sqlite.cf
reject_unknown_sender_domain
smtpd_relay_restrictions =
permit_sasl_authenticated
reject_unauth_destination
# Consult database on how to 'canonicalize' sender address.
# If database lookup fails, consult the milter. (In our case, is postsrsd)
# Refs:
# - https://github.com/roehling/postsrsd
# - https://serverfault.com/a/780367/15440
sender_canonical_maps = sqlite:/etc/postfix/canonical-sqlite.cf, tcp:127.0.0.1:10001
sender_canonical_classes = envelope_sender
# For receiving emails
smtpd_recipient_restrictions =
permit_sasl_authenticated
check_recipient_access sqlite:/etc/postfix/recipients-sqlite.cf
permit_auth_destination
virtual_mailbox_domains = mycompany.com
virtual_mailbox_maps = sqlite:/etc/postfix/virtual-sqlite.cf
virtual_mailbox_base = /var/mail
virtual_alias_maps = sqlite:/etc/postfix/alias-sqlite.cf
# alias_maps = lmdb:/etc/aliases
# alias_database = lmdb:/etc/aliases
relayhost =
mynetworks = 127.0.0.0/8 192.168.0.0/16
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
smtpd_tls_auth_only = no
smtp_use_tls = no
smtpd_use_tls = no
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
# DKIM
milter_default_action = accept
milter_protocol = 2
smtpd_milters = unix:/run/opendkim/opendkim.sock
postscreen_upstream_proxy_protocol = haproxy