Thomas Bohl writes:

> This is the same thing but with a filter and a custom reject message:
>
> filter "ileglfr" phase mail-from match mail-from <ileglfr> reject "550 
> No mails from you pl0x"

Looking through smtpd.conf(5), it seems that the reject keyword
could be changed slightly to make it much more useful.

There are two current use cases: in a 'match' statement, and in a
'filter' statement.  For 'match', the keyword is standalone; for
'filter' it takes a message parameter.

My proposal is to change the grammar so that 'reject' optionally
takes a 3-tuple argument in all cases:

  'reject' [ WS code WS ecode WS message ]

where 'code' is the SMTP XXX response code, ecode is an X.Y.Z
enhanced response code, and 'message' is the text field of the
response.  In the absence of the 3-tuple, a generic 5XX 5.Y.Z failure
response would be returned (as is the existing behaviour in 'match').
This gives us complete control over the command replies we are
sending out.  It does break backwards compatibility for 'filter'
statements that reject, but the one-time fix is pretty trivial.

--lyndon

Reply via email to