SPDX: Mass-update to GPL-2.0-or-later
[exim.git] / src / util / unknownuser.sh
1 #! /bin/sh
2 # Copyright (c) The Exim Maintainers 2022
3 # SPDX-License-Identifier: GPL-2.0-or-later
4
5 # This is a sample script for demonstrating how to handle unknown users in
6 # a more friendly way than just returning a "user unknown" error. It can
7 # be called from a pipe transport set up like this:
8
9 # unknownuser_pipe:
10 #   driver = pipe;
11 #   command = "/opt/exim/util/unknownuser.sh",
12 #   ignore_status,
13 #   return_output,
14 #   user = nobody
15
16 # which is specified by a smartuser director set up like this:
17
18 # unknownuser:
19 #   transport = unknownuser_pipe,
20 #   no_verify,
21 #   driver = smartuser;
22
23 # Any output generated by this script is then returned to the sender of
24 # the message. You can run any commands you like at this point, for example,
25 # to attempt fuzzy matches on the local part of the address. Here we just
26 # give a bland message, demonstrating the availability of the variables
27 # $LOCAL_PART and $DOMAIN.
28
29 cat <<End
30 "$LOCAL_PART" is not a known user mailbox in the domain "$DOMAIN".
31 End
32
33
34