Open SMTPD: Reject sender/force errors at virtual table expansion time?

Hello.

With Exim, in the alias file, I could do this:

foo@bar.com: 550 "Unknown User"

to force 550 (or other) errors.

With OpenSMTPD, in the "virtuals" table, the same syntax results in a

424 4.2.4 Mailing list expansion problem: <foo@bar.com>

...and not a 550. So the sender will keep retrying the 424. The man page teases that what I am trying to do might be possible but is unclear (at least to me!). Nothing I've tried seems to work.

Is there a syntax that works for this? Or is it not possible?

Thanks.
 
Use the source, Luke...

Poked around briefly in the SMTPD source, and alias_is_error() in to.c seems to be looking for an error: or :error: prefix to the error? Or is there some syntax where error: is on the LHS of the expansion?

I played with variants of foo@bar.com: error: 550 Unknown User / foo@bar.com:error:5.5.0 "Unknown User", etc., but no progress.

Don't have time to peruse more now, but seems like a clue. (Some decent docs that don't rely on assumed knowledge of past formats would sure be nice.)
 
Ah ha. Using the source and the docs, the format is:

foo@bar.com: error:550 Unknown User (or whatever message)

Note that the error code must be right up against the colon in error.

Judging by the source, foo@bar:error:500 Unknown User should also work. (No space between the LHS label and the RHS.)
 
Back
Top