1 PUSHDIVERT(-1)
   2 #
   3 # Copyright (c) 1998-2001 Proofpoint, Inc. and its suppliers.
   4 #       All rights reserved.
   5 # Copyright (c) 1983 Eric P. Allman.  All rights reserved.
   6 # Copyright (c) 1988, 1993
   7 #       The Regents of the University of California.  All rights reserved.
   8 #
   9 # By using this file, you agree to the terms and conditions set
  10 # forth in the LICENSE file which can be found at the top level of
  11 # the sendmail distribution.
  12 #
  13 #
  14 
  15 ifdef(`UUCP_MAILER_PATH',, `define(`UUCP_MAILER_PATH', /usr/bin/uux)')
  16 ifdef(`UUCP_MAILER_ARGS',, `define(`UUCP_MAILER_ARGS', `uux - -r -a$g -gC $h!rmail ($u)')')
  17 _DEFIFNOT(`UUCP_MAILER_FLAGS', `')
  18 ifdef(`UUCP_MAILER_MAX',,
  19         `define(`UUCP_MAILER_MAX',
  20                 `ifdef(`UUCP_MAX_SIZE', `UUCP_MAX_SIZE', 100000)')')
  21 define(`_UUCP_QGRP', `ifelse(defn(`UUCP_MAILER_QGRP'),`',`', ` Q=UUCP_MAILER_QGRP,')')dnl
  22 POPDIVERT
  23 #####################################
  24 ###   UUCP Mailer specification   ###
  25 #####################################
  26 
  27 VERSIONID(`$Id: uucp.m4,v 8.45 2013-11-22 20:51:14 ca Exp $')
  28 
  29 #
  30 #  envelope and header sender rewriting
  31 #
  32 SFromU
  33 
  34 # handle error address as a special case
  35 R<@>                              $n                      errors to mailer-daemon
  36 
  37 # list:; syntax should disappear
  38 R:; <@>                           $@
  39 
  40 R$* < @ $* . > $*         $1 < @ $2 > $3            strip trailing dots
  41 R$* < @ $=w >                     $1                      strip local name
  42 R<@ $- . UUCP > : $+              $1 ! $2                 convert to UUCP format
  43 R<@ $+ > : $+                     $1 ! $2                 convert to UUCP format
  44 R$* < @ $- . UUCP >               $2 ! $1                 convert to UUCP format
  45 R$* < @ $+ >                      $2 ! $1                 convert to UUCP format
  46 R$&h ! $+ ! $+                      $@ $1 ! $2              $h!...!user => ...!user
  47 R$&h ! $+                   $@ $&h ! $1         $h!user => $h!user
  48 R$+                             $: $U ! $1              prepend our name
  49 R! $+                           $: $k ! $1              in case $U undefined
  50 
  51 #
  52 #  envelope recipient rewriting
  53 #
  54 SEnvToU
  55 
  56 # list:; should disappear
  57 R:; <@>                           $@
  58 
  59 R$* < @ $* . > $*         $1 < @ $2 > $3            strip trailing dots
  60 R$* < @ $=w >                     $1                      strip local name
  61 R<@ $- . UUCP > : $+              $1 ! $2                 convert to UUCP format
  62 R<@ $+ > : $+                     $1 ! $2                 convert to UUCP format
  63 R$* < @ $- . UUCP >               $2 ! $1                 convert to UUCP format
  64 R$* < @ $+ >                      $2 ! $1                 convert to UUCP format
  65 
  66 #
  67 #  header recipient rewriting
  68 #
  69 SHdrToU
  70 
  71 # list:; syntax should disappear
  72 R:; <@>                           $@
  73 
  74 R$* < @ $* . > $*         $1 < @ $2 > $3            strip trailing dots
  75 R$* < @ $=w >                     $1                      strip local name
  76 R<@ $- . UUCP > : $+              $1 ! $2                 convert to UUCP format
  77 R<@ $+ > : $+                     $1 ! $2                 convert to UUCP format
  78 R$* < @ $- . UUCP >               $2 ! $1                 convert to UUCP format
  79 R$* < @ $+ >                      $2 ! $1                 convert to UUCP format
  80 R$&h ! $+ ! $+                      $@ $1 ! $2              $h!...!user => ...!user
  81 R$&h ! $+                   $@ $&h ! $1         $h!user => $h!user
  82 R$+                             $: $U ! $1              prepend our name
  83 R! $+                           $: $k ! $1              in case $U undefined
  84 
  85 
  86 ifdef(`_MAILER_smtp_',
  87 `#
  88 #  envelope sender rewriting for uucp-dom mailer
  89 #
  90 SEnvFromUD
  91 
  92 # handle error address as a special case
  93 R<@>                              $n                      errors to mailer-daemon
  94 
  95 # pass everything to standard SMTP mailer rewriting
  96 R$*                             $@ $>EnvFromSMTP $1
  97 
  98 #
  99 #  envelope sender rewriting for uucp-uudom mailer
 100 #
 101 SEnvFromUUD
 102 
 103 # handle error address as a special case
 104 R<@>                              $n                      errors to mailer-daemon
 105 
 106 # do standard SMTP mailer rewriting
 107 R$*                             $: $>EnvFromSMTP $1
 108 
 109 R$* < @ $* . > $*         $1 < @ $2 > $3            strip trailing dots
 110 R<@ $- . UUCP > : $+              $@ $1 ! $2              convert to UUCP format
 111 R<@ $+ > : $+                     $@ $1 ! $2              convert to UUCP format
 112 R$* < @ $- . UUCP >               $@ $2 ! $1              convert to UUCP format
 113 R$* < @ $+ >                      $@ $2 ! $1              convert to UUCP format',
 114 `errprint(`*** MAILER(`smtp') must appear before MAILER(`uucp')
 115     if uucp-dom should be included.')
 116 ')
 117 
 118 PUSHDIVERT(4)
 119 # resolve locally connected UUCP links
 120 R$* < @ $=Z . UUCP. > $*  $#uucp-uudom $@ $2 $: $1 < @ $2 .UUCP. > $3
 121 R$* < @ $=Y . UUCP. > $*  $#uucp-new $@ $2 $: $1 < @ $2 .UUCP. > $3
 122 R$* < @ $=U . UUCP. > $*  $#uucp-old $@ $2 $: $1 < @ $2 .UUCP. > $3
 123 POPDIVERT
 124 
 125 #
 126 #  There are innumerable variations on the UUCP mailer.  It really
 127 #  is rather absurd.
 128 #
 129 
 130 # old UUCP mailer (two names)
 131 Muucp,          P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`DFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
 132                 M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
 133                 A=UUCP_MAILER_ARGS
 134 Muucp-old,      P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`DFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
 135                 M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
 136                 A=UUCP_MAILER_ARGS
 137 
 138 # smart UUCP mailer (handles multiple addresses) (two names)
 139 Msuucp,         P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
 140                 M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
 141                 A=UUCP_MAILER_ARGS
 142 Muucp-new,      P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhuUd', UUCP_MAILER_FLAGS), `UUCP'), S=FromU, R=EnvToU/HdrToU,
 143                 M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
 144                 A=UUCP_MAILER_ARGS
 145 
 146 ifdef(`_MAILER_smtp_',
 147 `# domain-ized UUCP mailer
 148 Muucp-dom,      P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhud', UUCP_MAILER_FLAGS), `UUCP'), S=EnvFromUD/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'),
 149                 M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
 150                 A=UUCP_MAILER_ARGS
 151 
 152 # domain-ized UUCP mailer with UUCP-style sender envelope
 153 Muucp-uudom,    P=UUCP_MAILER_PATH, F=_MODMF_(CONCAT(`mDFMhud', UUCP_MAILER_FLAGS), `UUCP'), S=EnvFromUUD/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'),
 154                 M=UUCP_MAILER_MAX, _OPTINS(`UUCP_MAILER_CHARSET', `C=', `, ')T=X-UUCP/X-UUCP/X-Unix,_UUCP_QGRP
 155                 A=UUCP_MAILER_ARGS')
 156 
 157