I'm not active these days, but waking up because this thread is getting out of 
hands :-)

Reponses inlined:

April 14, 2022 7:20 AM, "Beau Ford" <bf...@0x.co> wrote:

> On Mon, 11 Apr 2022, Reio Remma wrote:
> 
>>> Am I misremembering or is that a possibility - to implement the '@' >> 
>>> catchall directly inside
>>> smtpd.conf without reference to lookup tables or >> virtusers (or aliases) 
>>> ? >
>> 
>> There's this format for inline tables:
>> 
>> table "barbaz" { foo = bar, baz = qux }
> 
> OK, I added this line to my (working) smtpd.conf:
> 
> table catchall { "@" = username }
> 
> ... so there is the static table ... and "username" is a real, actual UNIX 
> user in the passwd file.
> Not a virtual user.
> 

virtual means virtual domains, not virtual users:

https://www.mail-archive.com/misc@opensmtpd.org/msg04752.html



> Then I added this line:
> 
> accept for any virtual <catchall> deliver to mbox
> 
> ... and that line bombs out my configuration ... here is my entire 
> configuration *including* these
> two additional lines. This config works great if I remove the two new lines:
> 

That's not a valid rule for smtpd.conf, this syntax was that used pre-2018,
it should be rewritten as follows because actions and matching are now disjoint 
concepts:

action "foobar" mbox virtual <catchall>
match for any action "foobar"

> 
> My goal is to add exactly one catchall rule and keep my config simple inside 
> smtpd.conf without
> dealing with virtual users and virtusertable, etc.
> 

what you want is:

    action "catchall" mbox virtual { "@" = username }
    
    match from any for any action "catchall"

where username is the username of your local user that will catch all mails.
again, this is not virtual users as virtual does not mean what you think it 
means here,
virtual users are handled through the `userbase` option to provide an alternate 
userbase.

Note however that you should really add a catchall to domains, such as:

    action "catchall" mbox virtual { "@poolp.org" = username }

or restrict the domains with an rcpt-to clause on the match rule:

    match for rcpt-to { "@poolp.org" } action "catchall"

otherwise your MX will _seem_ to be an open-relay for some mailers since you're 
going to
be accepting mail for any domain even though you won't be relaying them 
afterwards. This
might still impact the reputation of your domain.

Cheers,

Reply via email to