3 # Copyright (c) 2014 Proofpoint, Inc. and its suppliers.
6 # By using this file, you agree to the terms and conditions set
7 # forth in the LICENSE file which can be found at the top level of
8 # the sendmail distribution.
15 # - empty/none: default map bcctable
16 # - `access': to use access_db (with bcc: as tag)
18 # The map contains domain names and the RHS should be simply "ok".
19 # If the access map is used, then its lookup algorithm is used.
22 # matches anything@domain
24 # matches any subdomain, e.g., l@sub.domain and l@sub.dom.domain
25 # On a match, the original address will be used as bcc address unless
27 # 2: Name of host ([mailer:]host)
28 # 3: Default bcc address: if set, this will be always used.
29 # Only one of 2/3 can be empty.
30 # Note: if Bcc address is used then only one copy will be sent!
31 # (due to duplicate elimination)
32 # 4: Map definition for canonicalRcpt map of address rewriting to
33 # apply to the added bcc envelope recipients.
34 # The option -T<TMPF> is required to handle temporary map failures.
36 # The ruleset must return either
37 # - an e-mail address (user@dom.ain) which is then added as "bcc" recipient.
38 # - an empty string: do not add a "bcc" recipient, or
39 # - $#error: fail the SMTP transaction (e.g., temporary lookup failure)
41 # This feature sets O AddBcc=true
43 ifelse(lower(_ARG_),`access',`define(`_BCC_ACCESS_', `1')')
44 define(`_ADD_BCC_', `1')
46 ifdef(`_BCC_ACCESS_', `dnl
47 ifdef(`_ACCESS_TABLE_', `',
48 `errprint(`*** ERROR: FEATURE(`bcc') requires FEATURE(`access_db')
51 ifdef(`_BCC_ACCESS_', `', `
53 Kbcctable ifelse(defn(`_ARG_'), `', DATABASE_MAP_TYPE MAIL_SETTINGS_DIR`bcctable', `_ARG_')')
57 ifelse(len(X`'_ARG2_),`1', `', `
60 ifelse(len(X`'_ARG4_), `1', `',
61 `define(`_CANONIFY_BCC_', `1')dnl
62 define(`_NEED_SMTPOPMODES_', `1')dnl
63 # canonical address look up for AddBcc recipients
70 ifdef(`_BCC_ACCESS_', `dnl
71 R$+ @ $+ $: $1@$2 $| $>SearchList <! bcc> $| <D:$2> <>',
72 `R$+ @ $+ $: $1@$2 $| $>BCC $2')
74 R$* $| $* $: ifelse(len(X`'_ARG3_),`1', `$1', `_ARG3_')
76 ifdef(`_CANONIFY_BCC_', `dnl
77 R$+ @ $+ $: $1@$2 $| <$(canonicalRcpt $1 @ $2 $: $)>
79 R$* $| <$* <TMPF>> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
80 R$* $| <$+> $@ $2 map matched?
84 ifdef(`_BCC_ACCESS_', `', `
86 R$+ $: $1 < $(bcctable $1 $: ? $) >
87 R$- . $+ <?> $: $2 < $(bcctable .$2 $: ? $) >
88 R$- . $+ <?> $: $>BCC $2