]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/sendmail/cf/m4/nullrelay.m4
unfinished sblive driver, playback/mixer only for now - not enabled in
[FreeBSD/FreeBSD.git] / contrib / sendmail / cf / m4 / nullrelay.m4
1 divert(-1)
2 #
3 # Copyright (c) 1998 Sendmail, Inc.  All rights reserved.
4 # Copyright (c) 1983, 1995 Eric P. Allman.  All rights reserved.
5 # Copyright (c) 1988, 1993
6 #       The Regents of the University of California.  All rights reserved.
7 #
8 # By using this file, you agree to the terms and conditions set
9 # forth in the LICENSE file which can be found at the top level of
10 # the sendmail distribution.
11 #
12 #
13 divert(0)
14
15 VERSIONID(`@(#)nullrelay.m4     8.19 (Berkeley) 5/19/1998')
16
17 #
18 #  This configuration applies only to relay-only hosts.  They send
19 #  all mail to a hub without consideration of the address syntax
20 #  or semantics, except for adding the hub qualification to the
21 #  addresses.
22 #
23 #       This is based on a prototype done by Bryan Costales of ICSI.
24 #
25
26 ######################################################################
27 ######################################################################
28 #####
29 #####                   REWRITING RULES
30 #####
31 ######################################################################
32 ######################################################################
33
34 ###########################################
35 ###  Rulset 3 -- Name Canonicalization  ###
36 ###########################################
37 S3
38
39 # handle null input
40 R$@                     $@ <@>
41
42 # strip group: syntax (not inside angle brackets!) and trailing semicolon
43 R$*                     $: $1 <@>                       mark addresses
44 R$* < $* > $* <@>       $: $1 < $2 > $3                 unmark <addr>
45 R$* :: $* <@>           $: $1 :: $2                     unmark node::addr
46 R:`include': $* <@>     $: :`include': $1                       unmark :`include':...
47 R$* : $* <@>            $: $2                           strip colon if marked
48 R$* <@>                 $: $1                           unmark
49 R$* ;                      $1                           strip trailing semi
50 R$* < $* ; >               $1 < $2 >                    bogus bracketed semi
51
52 # null input now results from list:; syntax
53 R$@                     $@ :; <@>
54
55 # basic textual canonicalization -- note RFC733 heuristic here
56 R$*                     $: < $1 >               housekeeping <>
57 R$+ < $* >                 < $2 >               strip excess on left
58 R< $* > $+                 < $1 >               strip excess on right
59 R<>                     $@ < @ >                MAIL FROM:<> case
60 R< $+ >                 $: $1                   remove housekeeping <>
61
62 ifdef(`_NO_CANONIFY_', `dnl',
63 `# eliminate local host if present
64 R@ $=w $=: $+           $@ @ $M $2 $3                   @thishost ...
65 R@ $+                   $@ @ $1                         @somewhere ...
66
67 R$=E @ $=w              $@ $1 @ $2                      leave exposed
68 R$+ @ $=w               $@ $1 @ $M                      ...@thishost
69 R$+ @ $+                $@ $1 @ $2                      ...@somewhere
70
71 R$=w ! $=E              $@ $2 @ $1                      leave exposed
72 R$=w ! $+               $@ $2 @ $M                      thishost!...
73 R$+ ! $+                $@ $1 ! $2 @ $M                 somewhere ! ...
74
75 R$=E % $=w              $@ $1 @ $2                      leave exposed
76 R$+ % $=w               $@ $1 @ $M                      ...%thishost
77 R$+ % $+                $@ $1 @ $2                      ...%somewhere
78
79 R$=E                    $@ $1 @ $j                      leave exposed
80 R$+                     $@ $1 @ $M                      unadorned user')
81
82
83 ######################################
84 ###   Ruleset 0 -- Parse Address   ###
85 ######################################
86
87 S0
88
89 R$*:;<@>                $#error $@ USAGE $: "List:; syntax illegal for recipient addresses"
90
91 # pass everything else to a relay host
92 R$*                     $#_RELAY_ $@ $H $: $1
93
94
95 ##################################################
96 ###  Ruleset 4 -- Final Output Post-rewriting  ###
97 ##################################################
98 S4
99
100 R$* <@>                 $@                              handle <> and list:;
101
102 # strip trailing dot off before passing to nullclient relay
103 R$* @ $+ .              $1 @ $2
104
105 #\f
106 ######################################################################
107 ######################################################################
108 #####
109 `#####                  MAILER DEFINITIONS'
110 #####
111 ######################################################################
112 ######################################################################
113 undivert(7)dnl