Hello, I need to redirect all the email coming to one domain to another like this:

@alias-domain.com -> @real-domain.com

which means when a mail is coming to my.n...@alias-domain.com, it's first translated to my.n...@real-domain.com and later delivered to the mailbox.

I have found this in the virtual(5) doc:

-----
@domain address, address, ...
...
              Note:  @domain is a wild-card. With this form, the Postfix SMTP
              server accepts mail for any recipient in domain, regardless of
              whether that recipient exists.  This may turn your mail system
              into a backscatter source:  Postfix first accepts mail for
              non-existent recipients and then tries to return that mail as
              "undeliverable" to the often forged sender address.

              To avoid backscatter with mail for a wild-card domain, replace
              the wild-card mapping with explicit 1:1 mappings, or add a
              reject_unverified_recipient restriction for that domain:

                  smtpd_recipient_restrictions =
                      ...
                      reject_unauth_destination
                      check_recipient_access
                          inline:{example.com=reject_unverified_recipient}
                  unverified_recipient_reject_code = 550

              In the above example, Postfix may contact a remote server if the
              recipient is aliased to a remote address.
-----

I'd like to go the way with the "check_recipient_access" option, but don't know how to do it with databased map:

smtpd_recipient_restrictions =
        ...
        reject_unauth_destination
        check_recipient_access pgsql:map_file ?????
        unverified_recipient_reject_code = 550

What is the correct settings instead of those "?????" please? Any hint?

Thanks, Tomas

Reply via email to