I have a mail server that accept emails from any domain. This is accomplished by using the following line in Postfix's main.cf
:
mydestination = regexp:/etc/postfix/mydestinations.reg
and mydestinations.reg
looks like this:
/^.*/ OK
Now, I want to forward emails to a specific user (e.g. to admin
) to an external email address. I added the following line to /etc/aliases
admin: email@externaldomain.com
After running newaliases
and sending an email to admin
the rule is met, but Postfix tries to deliver the email locally instead of remotely. That leads to the following error message in the Postfix log:
status=bounced (unknown user: "email")
My guess is, that Postfix assumes that externaldomain.com
is in its destination since it is configured to accept any domains.
Now my question: How can I tell Postfix to forward the email to the external domain while keeping the catchall mydestination
intact?
Side note: I would like to avoid using virtual aliases if possible.