xref: /freebsd/contrib/sendmail/cf/feature/check_other.m4 (revision 2fb4f839f3fc72ce2bab12f9ba4760f97f73e97f)
1*2fb4f839SGregory Neil Shapirodivert(-1)
2*2fb4f839SGregory Neil Shapiro#
3*2fb4f839SGregory Neil Shapiro# Copyright (c) 2021 Proofpoint, Inc. and its suppliers.
4*2fb4f839SGregory Neil Shapiro#	All rights reserved.
5*2fb4f839SGregory Neil Shapiro#
6*2fb4f839SGregory Neil Shapiro# By using this file, you agree to the terms and conditions set
7*2fb4f839SGregory Neil Shapiro# forth in the LICENSE file which can be found at the top level of
8*2fb4f839SGregory Neil Shapiro# the sendmail distribution.
9*2fb4f839SGregory Neil Shapiro#
10*2fb4f839SGregory Neil Shapiro#
11*2fb4f839SGregory Neil Shapirodnl bogus Id, just here to show up in the generated cf file
12*2fb4f839SGregory Neil Shapirodivert(0)
13*2fb4f839SGregory Neil ShapiroVERSIONID(`$Id: check_other.m4,v 1.0 2021-04-30 00:01:11 ca Exp $')
14*2fb4f839SGregory Neil Shapirodivert(-1)
15*2fb4f839SGregory Neil Shapirodnl
16*2fb4f839SGregory Neil Shapirodnl Options:
17*2fb4f839SGregory Neil Shapirodnl first arg:
18*2fb4f839SGregory Neil Shapirodnl  empty: use default regex
19*2fb4f839SGregory Neil Shapirodnl  else: use as regex
20*2fb4f839SGregory Neil Shapirodnl  [not implemented: NOREGEX: do not use any regex]
21*2fb4f839SGregory Neil Shapirodnl
22*2fb4f839SGregory Neil Shapirodnl Possible enhancements:
23*2fb4f839SGregory Neil Shapirodnl select which SMTP reply type(s) should be allowed to match?
24*2fb4f839SGregory Neil Shapirodnl maybe add "exceptions":
25*2fb4f839SGregory Neil Shapirodnl   - via an "OK" regex?
26*2fb4f839SGregory Neil Shapirodnl   - access map lookup for clients to be "ok" (Connect:... {ok,relay})
27*2fb4f839SGregory Neil Shapirodnl more args? possible matches for rejections:
28*2fb4f839SGregory Neil Shapirodnl	does not seem to worth the effort: too inflexible.
29*2fb4f839SGregory Neil Shapirodnl
30*2fb4f839SGregory Neil Shapirodnl Note: sendmail removes whitespace before ':' ("tokenization")
31*2fb4f839SGregory Neil Shapiroifelse(
32*2fb4f839SGregory Neil Shapiro   defn(`_ARG_'), `', `define(`CHKORX', `^[[:print:]]+ *:')',
33*2fb4f839SGregory Neil Shapiro   dnl defn(`_ARG_'), `NOREGEX', `define(`CHKORX', `')',
34*2fb4f839SGregory Neil Shapiro  `define(`CHKORX', defn(`_ARG_'))')
35*2fb4f839SGregory Neil ShapiroLOCAL_CONFIG
36*2fb4f839SGregory Neil Shapiroifelse(defn(`CHKORX'), `', `', `dnl
37*2fb4f839SGregory Neil ShapiroKbadcmd regex -m -a<BADCMD> defn(`CHKORX')')
38*2fb4f839SGregory Neil ShapiroLOCAL_RULESETS
39*2fb4f839SGregory Neil ShapiroScheck_other
40*2fb4f839SGregory Neil Shapirodnl accept anything that will be accepted by the MTA
41*2fb4f839SGregory Neil ShapiroR$* $| 2	$@ ok
42*2fb4f839SGregory Neil Shapiroifelse(defn(`CHKORX'), `', `', `dnl
43*2fb4f839SGregory Neil ShapiroR$+ $| 5	$: $(badcmd $1 $)
44*2fb4f839SGregory Neil ShapiroR$*<BADCMD>	$#error $@ 4.7.0 $: 421 bad command')
45*2fb4f839SGregory Neil Shapirodnl terminate on any bad command?
46*2fb4f839SGregory Neil Shapirodnl R$* $| 5	$#error $@ 4.7.0 $: 421 bad command
47