On Sat, Jun 25, 2022 at 10:16:59PM -0300, Luc GMail wrote:
> On Sun, Jun 26, 2022 at 2022-06-26 0:37:16, Viktor Dukhovni wrote:
> 
> > A "catch all" handles mail for all names at a domain,
> > even ones you never shared with anyone
> 
> Not all names. Only those that have no clear destination, i.e. no
> known user account or virtual mailbox. How do I achieve exactly that,
> please?

It matches all names not matched in full (user@domain) the same set of
rewriting tables.  The existence or non-existence of an underlying
account has nothing to do with it.

    main.cf:
        indexed = ${default_database_type}:${config_directory}/
        virtual_alias_maps = ${indexed}virtual

    virtual:
        # Catch all for all addresses not explicitly listed here
        @example.com    catchall@...
        # Some non-catchall alias
        f...@example.com b...@example.com
        # Identity map to avoid recursively hitting the catchall
        b...@example.com b...@example.com

Note that "b...@example.com" may exist and be a real user, provided
that "example.com" is not a virtual alias domain, while
"b...@example.com" may not exist and then mail to "foo@" and "bar@"
will bounce.

But you don't need a catchall for the problem at hand.  Why not just

    main.cf:
        mailbot_destination_recipient_limit = 1

    virtual:
        l...@example.com     luc@hidden.invalid

    transport:
        hidden.invalid      mailbot

    master.cf
        mailbot unix n ... pipe
            flags=... argv=...

> Every working email server and account is a spam magnet since the 90s.
> My system is not pointless. It's tried, it's tested and it's approved
> with flying colors.

There's no reason that you've explained for catching mail for all
possible addresses at the domain, even ones you've never shared:

    luc-wants-s...@example.com
    luc-loves-...@example.com
    ...

> How do I achieve that, please?

You can redirect mail to a script by setting up a pipe(8)
transport that runs the script.  The command arguments can
include various snippets of envelope data.

-- 
    Viktor.

Reply via email to