On Wed, Dec 04, 2019 at 10:16:15AM +0800, Wesley Peng wrote:

> I have a few domains, every domain has a contact email. 
> 
> How to configure postfix to accept every domain and every email on
> domain, and deliver them to a specific mailbox?

It needs to be just your domains, not *every domain*, because otherwise
you won't be able to deliver bounces, or other outbound email.

> I meant, I don’t want to add the virtual domain one by one in postfix,
> but like to have a wildcard configuration for all domains.

That's a bad idea.

> Even if yahoo points its MX to me, I will receive the messages
> normally.

That's a bad idea.

> Surely this won’t be a open relay, but all messages will be delivered
> into a specific local mailbox.

You can map wildcard local parts at specific domains to your catchall
mailbox, and even that's generally a bad idea, but less bad than
capturing every domain.

    virtual:
        @example.com    catchall@localhost
        @example.net    catchall@localhost
        @example.org    catchall@localhost

    vdomains:
        example.com
        example.net
        example.org

    main.cf:
        append_dot_mydomain = yes
        indexed = ${default_database_type}:${config_directory}/
        mydestination = localhost.$mydomain
        virtual_alias_domains = ${config_directory}/vdomains
        virtual_alias_maps = ${indexed}virtual

-- 
    Viktor.

Reply via email to