home *** CD-ROM | disk | FTP | other *** search
/ ftp.ac-grenoble.fr / 2015.02.ftp.ac-grenoble.fr.tar / ftp.ac-grenoble.fr / pub / slis / updates_rsync / sendmail.cf < prev    next >
Text File  |  2000-06-07  |  24KB  |  868 lines

  1.  
  2. ######################################################################
  3. ######################################################################
  4. #####
  5. #####        SENDMAIL CONFIGURATION FILE
  6. #####
  7. ##### built by bzeznik@terre.ac-grenoble.fr on Tue May 19 11:37:18 CEST 1998
  8. ##### in /home/bzeznik/sendmail-8.8.8/cf
  9. ##### using as configuration include directory
  10. #####
  11. ##### Sendmail.cf destinΘ aux serveurs d'Θtablissements de l'acadΘmie
  12. ##### de Grenoble.
  13. ##### Tous messages non locaux sont relayΘs α pluton.ac-grenoble.fr.
  14. #####
  15. ######################################################################
  16. ######################################################################
  17.  
  18. #####  @(#)cfhead.m4    8.9 (Berkeley) 1/18/97  #####
  19. #####  @(#)cf.m4    8.24 (Berkeley) 8/16/95  #####
  20. #####  @(#)proxy.mc    0.1 (CARMI) 5 mai 1998  #####
  21.  
  22. #####  @(#)linux.m4    8.2 (Berkeley) 8/21/93  #####
  23.  
  24.  
  25. #####  @(#)local_procmail.m4    8.6 (Berkeley) 10/20/96  #####
  26.  
  27.  
  28.  
  29. #####  @(#)proto.m4    8.151 (Berkeley) 7/31/97  #####
  30.  
  31.  
  32. # level 7 config file format
  33. V7/Berkeley
  34.  
  35. ##################
  36. #   local info   #
  37. ##################
  38.  
  39. Cwlocalhost
  40.  
  41. # my official domain name
  42. # ... define this only if sendmail cannot automatically determine your domain
  43. #Dj$w.Foo.COM
  44.  
  45.  
  46. CP.
  47.  
  48. # "Smart" relay host (may be null)
  49. DSpluton.ac-grenoble.fr
  50.  
  51. # place to which unknown users should be forwarded
  52. #Kuser user -m -a<>
  53. #DLname_of_luser_relay
  54.  
  55. # operators that cannot be in local usernames (i.e., network indicators)
  56. CO @ % !
  57.  
  58. # a class with just dot (for identifying canonical names)
  59. C..
  60.  
  61. # a class with just a left bracket (for identifying domain literals)
  62. C[[
  63.  
  64. # Mailer table (overriding domains)
  65. #Kmailertable dbm /etc/mailertable
  66.  
  67. # Domain table (adding domains)
  68. #Kdomaintable dbm /etc/domaintable
  69.  
  70. # Generics table (mapping outgoing addresses)
  71. #Kgenerics dbm /etc/genericstable
  72.  
  73. # Virtual user table (maps incoming users)
  74. #Kvirtuser dbm /etc/virtusertable
  75.  
  76. # who I send unqualified names to (null means deliver locally)
  77. DR
  78.  
  79. # who gets all local email traffic ($R has precedence for unqualified names)
  80. DH
  81.  
  82. # dequoting map
  83. Kdequote dequote
  84.  
  85. # class E: names that should be exposed as from this host, even if we masquerade
  86. # class L: names that should be delivered locally, even if we have a relay
  87. # class M: domains that should be converted to $M
  88. #CL root
  89. CE root
  90.  
  91. # who I masquerade as (null for no masquerading) (see also $=M)
  92. DM
  93.  
  94. # my name for error messages
  95. DnMAILER-DAEMON
  96.  
  97.  
  98. # Configuration version number
  99. DZ8.8.8
  100.  
  101.  
  102. ###############
  103. #   Options   #
  104. ###############
  105.  
  106. # strip message body to 7 bits on input?
  107. O SevenBitInput=False
  108.  
  109. # 8-bit data handling
  110. O EightBitMode=pass8
  111.  
  112.  
  113. # wait for alias file rebuild (default units: minutes)
  114. O AliasWait=10
  115.  
  116. # location of alias file
  117. O AliasFile=/etc/aliases
  118.  
  119. # minimum number of free blocks on filesystem
  120. O MinFreeBlocks=100
  121.  
  122. # maximum message size
  123. #O MaxMessageSize=1000000
  124.  
  125. # substitution for space (blank) characters
  126. O BlankSub=.
  127.  
  128. # avoid connecting to "expensive" mailers on initial submission?
  129. O HoldExpensive=False
  130.  
  131. # checkpoint queue runs after every N successful deliveries
  132. #O CheckpointInterval=10
  133.  
  134. # default delivery mode
  135. O DeliveryMode=deferred
  136.  
  137. # automatically rebuild the alias database?
  138. #O AutoRebuildAliases
  139.  
  140. # error message header/file
  141. #O ErrorHeader=/etc/sendmail.oE
  142.  
  143. # error mode
  144. #O ErrorMode=print
  145.  
  146. # save Unix-style "From_" lines at top of header?
  147. #O SaveFromLine
  148.  
  149. # temporary file mode
  150. O TempFileMode=0600
  151.  
  152. # match recipients against GECOS field?
  153. #O MatchGECOS
  154.  
  155. # maximum hop count
  156. #O MaxHopCount=17
  157.  
  158. # location of help file
  159. O HelpFile=/usr/lib/sendmail.hf
  160.  
  161. # ignore dots as terminators in incoming messages?
  162. #O IgnoreDots
  163.  
  164. # name resolver options
  165. #O ResolverOptions=+AAONLY
  166.  
  167. # deliver MIME-encapsulated error messages?
  168. O SendMimeErrors=True
  169.  
  170. # Forward file search path
  171. O ForwardPath=$z/.forward.$w:$z/.forward
  172.  
  173. # open connection cache size
  174. O ConnectionCacheSize=2
  175.  
  176. # open connection cache timeout
  177. O ConnectionCacheTimeout=5m
  178.  
  179. # persistent host status directory
  180. #O HostStatusDirectory=.hoststat
  181.  
  182. # single thread deliveries (requires HostStatusDirectory)?
  183. #O SingleThreadDelivery
  184.  
  185. # use Errors-To: header?
  186. O UseErrorsTo=False
  187.  
  188. # log level
  189. O LogLevel=9
  190.  
  191. # send to me too, even in an alias expansion?
  192. #O MeToo
  193.  
  194. # verify RHS in newaliases?
  195. O CheckAliases=False
  196.  
  197. # default messages to old style headers if no special punctuation?
  198. O OldStyleHeaders=True
  199.  
  200. # SMTP daemon options
  201. #O DaemonPortOptions=Port=esmtp
  202.  
  203. # privacy flags
  204. O PrivacyOptions=authwarnings
  205.  
  206. # who (if anyone) should get extra copies of error messages
  207. #O PostMasterCopy=Postmaster
  208.  
  209. # slope of queue-only function
  210. #O QueueFactor=600000
  211.  
  212. # queue directory
  213. O QueueDirectory=/var/spool/mqueue
  214.  
  215. # timeouts (many of these)
  216. #O Timeout.initial=5m
  217. #O Timeout.connect=5m
  218. #O Timeout.iconnect=5m
  219. #O Timeout.helo=5m
  220. #O Timeout.mail=10m
  221. #O Timeout.rcpt=1h
  222. #O Timeout.datainit=5m
  223. #O Timeout.datablock=1h
  224. #O Timeout.datafinal=1h
  225. #O Timeout.rset=5m
  226. #O Timeout.quit=2m
  227. #O Timeout.misc=2m
  228. #O Timeout.command=1h
  229. #O Timeout.ident=30s
  230. #O Timeout.fileopen=60s
  231. O Timeout.queuereturn=5d
  232. #O Timeout.queuereturn.normal=5d
  233. #O Timeout.queuereturn.urgent=2d
  234. #O Timeout.queuereturn.non-urgent=7d
  235. O Timeout.queuewarn=4h
  236. #O Timeout.queuewarn.normal=4h
  237. #O Timeout.queuewarn.urgent=1h
  238. #O Timeout.queuewarn.non-urgent=12h
  239. #O Timeout.hoststatus=30m
  240.  
  241. # should we not prune routes in route-addr syntax addresses?
  242. #O DontPruneRoutes
  243.  
  244. # queue up everything before forking?
  245. O SuperSafe=True
  246.  
  247. # status file
  248. O StatusFile=/etc/sendmail.st
  249.  
  250. # time zone handling:
  251. #  if undefined, use system default
  252. #  if defined but null, use TZ envariable passed in
  253. #  if defined and non-null, use that info
  254. #O TimeZoneSpec=
  255.  
  256. # default UID (can be username or userid:groupid)
  257. O DefaultUser=1:1
  258.  
  259. # list of locations of user database file (null means no lookup)
  260. #O UserDatabaseSpec=/etc/userdb
  261.  
  262. # fallback MX host
  263. #O FallbackMXhost=fall.back.host.net
  264.  
  265. # if we are the best MX host for a site, try it directly instead of config err
  266. #O TryNullMXList
  267.  
  268. # load average at which we just queue messages
  269. #O QueueLA=8
  270.  
  271. # load average at which we refuse connections
  272. #O RefuseLA=12
  273.  
  274. # maximum number of children we allow at one time
  275. #O MaxDaemonChildren=12
  276.  
  277. # maximum number of new connections per second
  278. #O ConnectionRateThrottle=3
  279.  
  280. # work recipient factor
  281. #O RecipientFactor=30000
  282.  
  283. # deliver each queued job in a separate process?
  284. #O ForkEachJob
  285.  
  286. # work class factor
  287. #O ClassFactor=1800
  288.  
  289. # work time factor
  290. #O RetryFactor=90000
  291.  
  292. # shall we sort the queue by hostname first?
  293. #O QueueSortOrder=priority
  294.  
  295. # minimum time in queue before retry
  296. #O MinQueueAge=30m
  297.  
  298. # default character set
  299. #O DefaultCharSet=iso-8859-1
  300.  
  301. # service switch file (ignored on Solaris, Ultrix, OSF/1, others)
  302. O ServiceSwitchFile=/etc/service.switch
  303.  
  304. # hosts file (normally /etc/hosts)
  305. O HostsFile=/etc/hosts
  306.  
  307. # dialup line delay on connection failure
  308. #O DialDelay=10s
  309.  
  310. # action to take if there are no recipients in the message
  311. #O NoRecipientAction=add-to-undisclosed
  312.  
  313. # chrooted environment for writing to files
  314. #O SafeFileEnvironment=/arch
  315.  
  316. # are colons OK in addresses?
  317. #O ColonOkInAddr
  318.  
  319. # how many jobs can you process in the queue?
  320. #O MaxQueueRunSize=10000
  321.  
  322. # shall I avoid expanding CNAMEs (violates protocols)?
  323. #O DontExpandCnames
  324.  
  325. # SMTP initial login message (old $e macro)
  326. O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
  327.  
  328. # UNIX initial From header format (old $l macro)
  329. O UnixFromLine=From $g  $d
  330.  
  331. # delimiter (operator) characters (old $o macro)
  332. O OperatorChars=.:%@!^/[]+
  333.  
  334. # shall I avoid calling initgroups(3) because of high NIS costs?
  335. #O DontInitGroups
  336.  
  337. # are group-writable :include: and .forward files (un)trustworthy?
  338. #O UnsafeGroupWrites
  339.  
  340. # where do errors that occur when sending errors get sent?
  341. #O DoubleBounceAddress
  342.  
  343. # what user id do we assume for the majority of the processing?
  344. #O RunAsUser=sendmail
  345.  
  346. ###########################
  347. #   Message precedences   #
  348. ###########################
  349.  
  350. Pfirst-class=0
  351. Pspecial-delivery=100
  352. Plist=-30
  353. Pbulk=-60
  354. Pjunk=-100
  355.  
  356. #####################
  357. #   Trusted users   #
  358. #####################
  359.  
  360. # this is equivalent to setting class "t"
  361. #Ft/etc/sendmail.ct
  362. Troot
  363. Tdaemon
  364. Tuucp
  365.  
  366. #########################
  367. #   Format of headers   #
  368. #########################
  369.  
  370. H?P?Return-Path: <$g>
  371. HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
  372.     $.by $j ($v/$Z)$?r with $r$. id $i$?u
  373.     for $u; $|;
  374.     $.$b
  375. H?D?Resent-Date: $a
  376. H?D?Date: $a
  377. H?F?Resent-From: $?x$x <$g>$|$g$.
  378. H?F?From: $?x$x <$g>$|$g$.
  379. H?x?Full-Name: $x
  380. # HPosted-Date: $a
  381. # H?l?Received-Date: $b
  382. H?M?Resent-Message-Id: <$t.$i@$j>
  383. H?M?Message-Id: <$t.$i@$j>
  384. #
  385. ######################################################################
  386. ######################################################################
  387. #####
  388. #####            REWRITING RULES
  389. #####
  390. ######################################################################
  391. ######################################################################
  392.  
  393. ############################################
  394. ###  Ruleset 3 -- Name Canonicalization  ###
  395. ############################################
  396. S3
  397.  
  398. # handle null input (translate to <@> special case)
  399. R$@            $@ <@>
  400.  
  401. # strip group: syntax (not inside angle brackets!) and trailing semicolon
  402. R$*            $: $1 <@>            mark addresses
  403. R$* < $* > $* <@>    $: $1 < $2 > $3            unmark <addr>
  404. R@ $* <@>        $: @ $1                unmark @host:...
  405. R$* :: $* <@>        $: $1 :: $2            unmark node::addr
  406. R:include: $* <@>    $: :include: $1            unmark :include:...
  407. R$* [ $* : $* ] <@>    $: $1 [ $2 : $3 ]        unmark IPv6 addrs
  408. R$* : $* [ $* ]        $: $1 : $2 [ $3 ] <@>        remark if leading colon
  409. R$* : $* <@>        $: $2                strip colon if marked
  410. R$* <@>            $: $1                unmark
  411. R$* ;               $1                strip trailing semi
  412. R$* < $* ; >           $1 < $2 >            bogus bracketed semi
  413.  
  414. # null input now results from list:; syntax
  415. R$@            $@ :; <@>
  416.  
  417. # strip angle brackets -- note RFC733 heuristic to get innermost item
  418. R$*            $: < $1 >            housekeeping <>
  419. R$+ < $* >           < $2 >            strip excess on left
  420. R< $* > $+           < $1 >            strip excess on right
  421. R<>            $@ < @ >            MAIL FROM:<> case
  422. R< $+ >            $: $1                remove housekeeping <>
  423.  
  424. # make sure <@a,@b,@c:user@d> syntax is easy to parse -- undone later
  425. R@ $+ , $+        @ $1 : $2            change all "," to ":"
  426.  
  427. # localize and dispose of route-based addresses
  428. R@ $+ : $+        $@ $>96 < @$1 > : $2        handle <route-addr>
  429.  
  430. # find focus for list syntax
  431. R $+ : $* ; @ $+    $@ $>96 $1 : $2 ; < @ $3 >    list syntax
  432. R $+ : $* ;        $@ $1 : $2;            list syntax
  433.  
  434. # find focus for @ syntax addresses
  435. R$+ @ $+        $: $1 < @ $2 >            focus on domain
  436. R$+ < $+ @ $+ >        $1 $2 < @ $3 >            move gaze right
  437. R$+ < @ $+ >        $@ $>96 $1 < @ $2 >        already canonical
  438.  
  439. # do some sanity checking
  440. R$* < @ $* : $* > $*    $1 < @ $2 $3 > $4        nix colons in addrs
  441.  
  442. # convert old-style addresses to a domain-based address
  443. R$- ! $+        $@ $>96 $2 < @ $1 .UUCP >    resolve uucp names
  444. R$+ . $- ! $+        $@ $>96 $3 < @ $1 . $2 >        domain uucps
  445. R$+ ! $+        $@ $>96 $2 < @ $1 .UUCP >    uucp subdomains
  446.  
  447. # if we have % signs, take the rightmost one
  448. R$* % $*        $1 @ $2                First make them all @s.
  449. R$* @ $* @ $*        $1 % $2 @ $3            Undo all but the last.
  450. R$* @ $*        $@ $>96 $1 < @ $2 >        Insert < > and finish
  451.  
  452. # else we must be a local name
  453. R$*            $@ $>96 $1
  454.  
  455.  
  456. ################################################
  457. ###  Ruleset 96 -- bottom half of ruleset 3  ###
  458. ################################################
  459.  
  460. S96
  461.  
  462. # handle special cases for local names
  463. R$* < @ localhost > $*        $: $1 < @ $j . > $2        no domain at all
  464. R$* < @ localhost . $m > $*    $: $1 < @ $j . > $2        local domain
  465. R$* < @ localhost . UUCP > $*    $: $1 < @ $j . > $2        .UUCP domain
  466. R$* < @ [ $+ ] > $*        $: $1 < @@ [ $2 ] > $3        mark [a.b.c.d]
  467. R$* < @@ $=w > $*        $: $1 < @ $j . > $3        self-literal
  468. R$* < @@ $+ > $*        $@ $1 < @ $2 > $3        canon IP addr
  469.  
  470. # look up domains in the domain table
  471. #R$* < @ $+ > $*         $: $1 < @ $(domaintable $2 $) > $3
  472.  
  473.  
  474. # if really UUCP, handle it immediately
  475.  
  476. # try UUCP traffic as a local address
  477. R$* < @ $+ . UUCP > $*        $: $1 < @ $[ $2 $] . UUCP . > $3
  478. R$* < @ $+ . . UUCP . > $*        $@ $1 < @ $2 . > $3
  479.  
  480. # pass to name server to make hostname canonical
  481. R$* < @ $* $~P > $*        $: $1 < @ $[ $2 $3 $] > $4
  482.  
  483. # local host aliases and pseudo-domains are always canonical
  484. R$* < @ $=w > $*        $: $1 < @ $2 . > $3
  485. R$* < @ $j > $*            $: $1 < @ $j . > $2
  486. R$* < @ $=M > $*        $: $1 < @ $2 . > $3
  487. R$* < @ $* $=P > $*        $: $1 < @ $2 $3 . > $4
  488. R$* < @ $* . . > $*        $1 < @ $2 . > $3
  489.  
  490.  
  491. ##################################################
  492. ###  Ruleset 4 -- Final Output Post-rewriting  ###
  493. ##################################################
  494. S4
  495.  
  496. R$* <@>            $@                handle <> and list:;
  497.  
  498. # strip trailing dot off possibly canonical name
  499. R$* < @ $+ . > $*    $1 < @ $2 > $3
  500.  
  501. # eliminate internal code -- should never get this far!
  502. R$* < @ *LOCAL* > $*    $1 < @ $j > $2
  503.  
  504. # externalize local domain info
  505. R$* < $+ > $*        $1 $2 $3            defocus
  506. R@ $+ : @ $+ : $+    @ $1 , @ $2 : $3        <route-addr> canonical
  507. R@ $*            $@ @ $1                ... and exit
  508.  
  509. # UUCP must always be presented in old form
  510. R$+ @ $- . UUCP        $2!$1                u@h.UUCP => h!u
  511.  
  512. # delete duplicate local names
  513. R$+ % $=w @ $=w        $1 @ $2                u%host@host => u@host
  514.  
  515.  
  516.  
  517. ##############################################################
  518. ###   Ruleset 97 -- recanonicalize and call ruleset zero   ###
  519. ###           (used for recursive calls)           ###
  520. ##############################################################
  521.  
  522. S97
  523. R$*            $: $>3 $1
  524. R$*            $@ $>0 $1
  525.  
  526.  
  527. ######################################
  528. ###   Ruleset 0 -- Parse Address   ###
  529. ######################################
  530.  
  531. S0
  532.  
  533. R$*            $: $>Parse0 $1        initial parsing
  534. R$*            $: $>98 $1        handle local hacks
  535. R$*            $: $>Parse1 $1        final parsing
  536.  
  537. SParse0
  538. R<@>            $#local $: <@>        special case error msgs
  539. R$* : $* ; <@>        $#error $@ 5.1.3 $: "list:; syntax illegal for recipient addresses"
  540. R<@ $+>            $#error $@ 5.1.1 $: "user address required"
  541. R$*            $: <> $1
  542. R<> $* < @ [ $+ ] > $*    $1 < @ [ $2 ] > $3
  543. R<> $* <$* : $* > $*    $#error $@ 5.1.1 $: "colon illegal in host name part"
  544. R<> $*            $1
  545. R$* < @ . $* > $*    $#error $@ 5.1.2 $: "invalid host name"
  546. R$* < @ $* .. $* > $*    $#error $@ 5.1.2 $: "invalid host name"
  547.  
  548. # handle numeric address spec
  549. R$* < @ [ $+ ] > $*    $: $>98 $1 < @ [ $2 ] > $3    numeric internet spec
  550. R$* < @ [ $+ ] > $*    $#esmtp $@ [$2] $: $1 < @ [$2] > $3    still numeric: send
  551.  
  552. # now delete the local info -- note $=O to find characters that cause forwarding
  553. R$* < @ > $*        $@ $>Parse0 $>3 $1        user@ => user
  554. R< @ $=w . > : $*    $@ $>Parse0 $>3 $2        @here:... -> ...
  555. R$- < @ $=w . >        $: $(dequote $1 $) < @ $2 . >    dequote "foo"@here
  556. R< @ $+ >        $#error $@ 5.1.1 $: "user address required"
  557. R$* $=O $* < @ $=w . >    $@ $>Parse0 $>3 $1 $2 $3    ...@here -> ...
  558.  
  559. SParse1
  560. # handle virtual users
  561. #R$+ < @ $=w . >     $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
  562. #R<@> $+ + $* < @ $* . >
  563.             $: < $(virtuser $1 + * @ $3 $@ $1 $: @ $) > $1 + $2 < @ $3 . >
  564. #R<@> $+ + $* < @ $* . >
  565.             $: < $(virtuser $1 @ $3 $@ $1 $: @ $) > $1 + $2 < @ $3 . >
  566. #R<@> $+ < @ $+ . >    $: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
  567. #R<@> $+            $: $1
  568. #R< error : $- $+ > $*     $#error $@ $( dequote $1 $) $: $2
  569. #R< $+ > $+ < @ $+ >    $: $>97 $1
  570.  
  571. # short circuit local delivery so forwarded email works
  572. #R$+ . USENET < @ $=w . >    $#usenet $: $1        handle usenet specially
  573. R$=L < @ $=w . >    $#local $: @ $1        special local names
  574. R$+ < @ $=w . >        $#local $: $1            regular local name
  575.  
  576. # not local -- try mailer table lookup
  577. #R$* <@ $+ > $*        $: < $2 > $1 < @ $2 > $3    extract host name
  578. #R< $+ . > $*        $: < $1 > $2            strip trailing dot
  579. #R< $+ > $*        $: < $(mailertable $1 $) > $2    lookup
  580. #R< $~[ : $+ > $*     $>95 < $1 : $2 > $3        check -- resolved?
  581. #R< $+ > $*        $: $>90 <$1> $2            try domain
  582.  
  583. # resolve remotely connected UUCP links (if any)
  584.  
  585. # resolve fake top level domains by forwarding to other hosts
  586.  
  587.  
  588.  
  589. # pass names that still have a host to a smarthost (if defined)
  590. R$* < @ $* > $*        $: $>95 < $S > $1 < @ $2 > $3    glue on smarthost name
  591.  
  592. # deal with other remote names
  593. R$* < @$* > $*        $#esmtp $@ $2 $: $1 < @ $2 > $3        user@host.domain
  594.  
  595. # if this is quoted, strip the quotes and try again
  596. R$+            $: $(dequote $1 $)        strip quotes
  597. R$+ $=O $+        $@ $>97 $1 $2 $3            try again
  598.  
  599. # handle locally delivered names
  600. R$=L            $#local $: @ $1            special local names
  601. R$+            $#local $: $1            regular local names
  602.  
  603. ###########################################################################
  604. ###   Ruleset 5 -- special rewriting after aliases have been expanded   ###
  605. ###########################################################################
  606.  
  607. S5
  608.  
  609. # deal with plussed users so aliases work nicely
  610. R$+ + *            $#local $@ $&h $: $1
  611. R$+ + $*        $#local $@ + $2 $: $1 + *
  612.  
  613. # prepend an empty "forward host" on the front
  614. R$+            $: <> $1
  615.  
  616. # send unrecognized local users to a relay host
  617. #R< > $+         $: < $L . > $( user $1 $)    look up user
  618. #R< $* > $+ <> $*    $: < > $2 $3            found; strip $L
  619. #R< $* . > $+        $: < $1 > $2            strip extra dot
  620.  
  621. # see if we have a relay or a hub
  622. R< > $+            $: < $H > $1            try hub
  623. R< > $+            $: < $R > $1            try relay
  624. R< > $+            $: < > < $1 $(dequote "" $&h $) >    nope, restore +detail
  625. R< > < $+ + $* > $*       < > < $1 > + $2 $3        find the user part
  626. R< > < $+ > + $*    $#local $@ $2 $: @ $1        strip the extra +
  627. R< > < $+ >        $@ $1                no +detail
  628. R$+            $: $1 $(dequote "" $&h $)    add +detail back in
  629. R< local : $* > $*    $: $>95 < local : $1 > $2    no host extension
  630. R< error : $* > $*    $: $>95 < error : $1 > $2    no host extension
  631. R< $- : $+ > $+        $: $>95 < $1 : $2 > $3 < @ $2 >
  632. R< $+ > $+        $@ $>95 < $1 > $2 < @ $1 >
  633.  
  634. ###################################################################
  635. ###  Ruleset 90 -- try domain part of mailertable entry     ###
  636. ###################################################################
  637.  
  638. S90
  639. #R$* <$- . $+ > $*    $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
  640. #R$* <$~[ : $+ > $*        $>95 < $2 : $3 > $4    check -- resolved?
  641. #R$* < . $+ > $*         $@ $>90 $1 . <$2> $3    no -- strip & try again
  642. #R$* < $* > $*        $: < $(mailertable . $@ $1$2 $) > $3    try "."
  643. #R< $~[ : $+ > $*        $>95 < $1 : $2 > $3    "." found?
  644. #R< $* > $*            $@ $2            no mailertable match
  645.  
  646. ###################################################################
  647. ###  Ruleset 95 -- canonify mailer:[user@]host syntax to triple    ###
  648. ###################################################################
  649.  
  650. S95
  651. R< > $*                $@ $1            strip off null relay
  652. R< error : $- $+ > $*        $#error $@ $( dequote $1 $) $: $2
  653. R< local : $* > $*        $>CanonLocal < $1 > $2
  654. R< $- : $+ @ $+ > $*<$*>$*    $# $1 $@ $3 $: $2<@$3>    use literal user
  655. R< $- : $+ > $*            $# $1 $@ $2 $: $3    try qualified mailer
  656. R< $=w > $*            $@ $2            delete local host
  657. R< $+ > $*            $#relay $@ $1 $: $2    use unqualified mailer
  658.  
  659. ###################################################################
  660. ###  Ruleset CanonLocal -- canonify local: syntax        ###
  661. ###################################################################
  662.  
  663. SCanonLocal
  664. # strip trailing dot from any host name that may appear
  665. R< $* > $* < @ $* . >        $: < $1 > $2 < @ $3 >
  666.  
  667. # handle local: syntax -- use old user, either with or without host
  668. R< > $* < @ $* > $*        $#local $@ $1@$2 $: $1
  669. R< > $+                $#local $@ $1    $: $1
  670.  
  671. # handle local:user@host syntax -- ignore host part
  672. R< $+ @ $+ > $* < @ $* >    $: < $1 > $3 < @ $4 >
  673.  
  674. # handle local:user syntax
  675. R< $+ > $* <@ $* > $*        $#local $@ $2@$3 $: $1
  676. R< $+ > $*             $#local $@ $2    $: $1
  677.  
  678. ###################################################################
  679. ###  Ruleset 93 -- convert header names to masqueraded form    ###
  680. ###################################################################
  681.  
  682. S93
  683.  
  684. # handle generics database
  685. #R$+ < @ $=G . >    $: < $1@$2 > $1 < @ $2 . > @    mark
  686. #R$+ < @ *LOCAL* >    $: < $1@$j > $1 < @ *LOCAL* > @    mark
  687. #R< $+ > $+ < $* > @    $: < $(generics $1 $: $) > $2 < $3 >
  688. #R< > $+ < @ $+ >     $: < $(generics $1 $: $) > $1 < @ $2 >
  689. #R< $* @ $* > $* < $* >    $@ $>3 $1 @ $2            found qualified
  690. #R< $+ > $* < $* >    $: $>3 $1 @ *LOCAL*        found unqualified
  691. #R< > $*            $: $1                not found
  692.  
  693. # special case the users that should be exposed
  694. R$=E < @ *LOCAL* >    $@ $1 < @ $j . >        leave exposed
  695. R$=E < @ $=M . >    $@ $1 < @ $2 . >
  696. R$=E < @ $=w . >    $@ $1 < @ $2 . >
  697.  
  698. # handle domain-specific masquerading
  699. R$* < @ $=M . > $*    $: $1 < @ $2 . @ $M > $3    convert masqueraded doms
  700. R$* < @ $=w . > $*    $: $1 < @ $2 . @ $M > $3
  701. R$* < @ *LOCAL* > $*    $: $1 < @ $j . @ $M > $2
  702. R$* < @ $+ @ > $*    $: $1 < @ $2 > $3        $M is null
  703. R$* < @ $+ @ $+ > $*    $: $1 < @ $3 . > $4        $M is not null
  704.  
  705. ###################################################################
  706. ###  Ruleset 94 -- convert envelope names to masqueraded form    ###
  707. ###################################################################
  708.  
  709. S94
  710. #R$+            $@ $>93 $1
  711. R$* < @ *LOCAL* > $*    $: $1 < @ $j . > $2
  712.  
  713. ###################################################################
  714. ###  Ruleset 98 -- local part of ruleset zero (can be null)    ###
  715. ###################################################################
  716.  
  717. S98
  718. #
  719. ######################################################################
  720. ######################################################################
  721. #####
  722. #####            MAILER DEFINITIONS
  723. #####
  724. ######################################################################
  725. ######################################################################
  726.  
  727.  
  728. ##################################################
  729. ###   Local and Program Mailer specification   ###
  730. ##################################################
  731.  
  732. #####  @(#)local.m4    8.23 (Berkeley) 5/31/96  #####
  733.  
  734. Mlocal,        P=/usr/bin/procmail, F=lsDFMAw5:/|@qrmn9, S=10/30, R=20/40,
  735.         T=DNS/RFC822/X-Unix,
  736.         A=mail -d $u
  737. Mprog,        P=/bin/sh, F=lsDFMoqeu9, S=10/30, R=20/40, D=$z:/,
  738.         T=X-Unix,
  739.         A=sh -c $u
  740.  
  741. #
  742. #  Envelope sender rewriting
  743. #
  744. S10
  745. R<@>            $n            errors to mailer-daemon
  746. R$+            $: $>50 $1        add local domain if needed
  747. R$*            $: $>94 $1        do masquerading
  748.  
  749. #
  750. #  Envelope recipient rewriting
  751. #
  752. S20
  753. R$+ < @ $* >        $: $1            strip host part
  754.  
  755. #
  756. #  Header sender rewriting
  757. #
  758. S30
  759. R<@>            $n            errors to mailer-daemon
  760. R$+            $: $>50 $1        add local domain if needed
  761. R$*            $: $>93 $1        do masquerading
  762.  
  763. #
  764. #  Header recipient rewriting
  765. #
  766. S40
  767. R$+            $: $>50 $1        add local domain if needed
  768. #R$*            $: $>93 $1        do all-masquerading
  769.  
  770. #
  771. #  Common code to add local domain name (only if always-add-domain)
  772. #
  773. S50
  774. #R$* < @ $* > $*     $@ $1 < @ $2 > $3        already fully qualified
  775. #R$+            $@ $1 < @ *LOCAL* >        add local qualification
  776.  
  777. #####################################
  778. ###   SMTP Mailer specification   ###
  779. #####################################
  780.  
  781. #####  @(#)smtp.m4    8.33 (Berkeley) 7/9/96  #####
  782.  
  783. Msmtp,        P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n, L=990,
  784.         T=DNS/RFC822/SMTP,
  785.         A=IPC $h
  786. Mesmtp,        P=[IPC], F=mDFMuXa, S=11/31, R=21, E=\r\n, L=990,
  787.         T=DNS/RFC822/SMTP,
  788.         A=IPC $h
  789. Msmtp8,        P=[IPC], F=mDFMuX8, S=11/31, R=21, E=\r\n, L=990,
  790.         T=DNS/RFC822/SMTP,
  791.         A=IPC $h
  792. Mrelay,        P=[IPC], F=mDFMuXa8, S=11/31, R=61, E=\r\n, L=2040,
  793.         T=DNS/RFC822/SMTP,
  794.         A=IPC $h
  795.  
  796. #
  797. #  envelope sender rewriting
  798. #
  799. S11
  800. R$+            $: $>51 $1            sender/recipient common
  801. R$* :; <@>        $@                list:; special case
  802. R$*            $: $>61 $1            qualify unqual'ed names
  803. R$+            $: $>94 $1            do masquerading
  804.  
  805.  
  806. #
  807. #  envelope recipient rewriting --
  808. #  also header recipient if not masquerading recipients
  809. #
  810. S21
  811. R$+            $: $>51 $1            sender/recipient common
  812. R$+            $: $>61 $1            qualify unqual'ed names
  813.  
  814.  
  815. #
  816. #  header sender and masquerading header recipient rewriting
  817. #
  818. S31
  819. R$+            $: $>51 $1            sender/recipient common
  820. R:; <@>            $@                list:; special case
  821.  
  822. # do special header rewriting
  823. R$* <@> $*        $@ $1 <@> $2            pass null host through
  824. R< @ $* > $*        $@ < @ $1 > $2            pass route-addr through
  825. R$*            $: $>61 $1            qualify unqual'ed names
  826. R$+            $: $>93 $1            do masquerading
  827.  
  828.  
  829. #
  830. #  convert pseudo-domain addresses to real domain addresses
  831. #
  832. S51
  833.  
  834. # pass <route-addr>s through
  835. R< @ $+ > $*        $@ < @ $1 > $2            resolve <route-addr>
  836.  
  837. # output fake domains as user%fake@relay
  838.  
  839. # do UUCP heuristics; note that these are shared with UUCP mailers
  840. R$+ < @ $+ .UUCP. >    $: < $2 ! > $1            convert to UUCP form
  841. R$+ < @ $* > $*        $@ $1 < @ $2 > $3        not UUCP form
  842.  
  843. # leave these in .UUCP form to avoid further tampering
  844. R< $&h ! > $- ! $+    $@ $2 < @ $1 .UUCP. >
  845. R< $&h ! > $-.$+ ! $+    $@ $3 < @ $1.$2 >
  846. R< $&h ! > $+        $@ $1 < @ $&h .UUCP. >
  847. R< $+ ! > $+        $: $1 ! $2 < @ $Y >        use UUCP_RELAY
  848. R$+ < @ $+ : $+ >    $@ $1 < @ $3 >            strip mailer: part
  849. R$+ < @ >        $: $1 < @ *LOCAL* >        if no UUCP_RELAY
  850.  
  851.  
  852. #
  853. #  common sender and masquerading recipient rewriting
  854. #
  855. S61
  856.  
  857. R$* < @ $* > $*        $@ $1 < @ $2 > $3        already fully qualified
  858. R$+            $@ $1 < @ *LOCAL* >        add local qualification
  859.  
  860.  
  861. #
  862. #  relay mailer header masquerading recipient rewriting
  863. #
  864. S71
  865.  
  866. R$+            $: $>61 $1
  867. R$+            $: $>93 $1
  868.