Sergej Vakulenko. Primer sendmail.cf na russkom
###########
# Makrosy #
###########
# Versiya konfiguracii sendmail. V dannom sluchae
# Copyright (C) 1992-1994 Sergej Vakulenko, .
DVvak/1.9
# Ssylki na makrosy imeyut vid $X. Makrosy a-z ispol'zuyutsya sistemoj,
# A-Z ostavleny dlya pol'zovatelya.
# Sleduyushchie makrosy opredeleny vnutri sendmail:
# a - data soobshcheniya v formate RFC 822
# b - tekushchaya data v formate RFC 822
# c - schetchik zaciklivaniya (hop count)
# d - tekushchaya data v formate Unix
# f - adres otpravitelya (from)
# g - adres otpravitelya otnositel'no poluchatelya
# h - host poluchatelya
# i - identifikator ocheredi
# k - UUCP-shnoe imya dannogo hosta
# m - neobrabotannyj adres poluchatelya
# p - nomer processa sendmail
# r - ispol'zuemyj protokol
# s - host otpravitelya
# t - chislennoe predstavlenie tekushchego vremeni
# u - imya pol'zovatelya poluchatelya
# v - nomer versii sendmail
# w - imya dannogo hosta (hostname)
# x - polnoe imya otpravitelya
# y - imya upravlyayushchego terminala dannogo processa (basename)
# z - domashnij katalog poluchatelya
# Ne vse iz nih mogut byt' opredeleny, dlya proverki
# ispol'zuetsya uslovnoe vyrazhenie vida "$?X tekst1 $| tekst2 $.".
# Priglashenie dlya SMTP.
De$j $v$?V/$V$. Sendmail is ready at $b
# "Oficial'noe" imya domena dlya dannoj mashiny.
# Opredelyaetsya avtomaticheski.
Dj$w
# Format stroki "From_".
DlFrom $g $d
# Imya pochtovogo demona dlya vozvrata oshibok marshrutizacii.
DnMAILER-DAEMON
# Spisok "operatorov" v adresah.
Do.:%@!^=/[]
# Format adresa otpravitelya.
Dq$g$?x ($x)$.
###############
# Klassy imen #
###############
# Imeyut vid:
# CXimya1 imya2...
# FXfajl
# V etom fajle nahoditsya spisok vseh domennyh imen dannoj mashiny.
Fw/etc/mail/myhostnames
# Klass razdelitelej, zapreshchennyh v imeni domena.
CB! % @ : ^
#########################
# Sostavlenie zagolovka #
#########################
# Zagolovki (v sootvetstvii s RFC 822) dolzhny idti
# v sleduyushchem poryadke: "Return-Path", "Received",
# "Date", "From", "Subject", "Sender", "To", "Cc".
#
# Format polya Received:
# ["from" domain] ; kto peredal
# ["by" domain] ; kto prinyal
# ["via" atom] ; sreda peredachi
# *("with" atom) ; protokol svyazi
# ["id" msg-id] ; receiver msg id
# ["for" addr-spec] ; initial form
# ";" date-time ; time received
#
# Nekotorye polya zagolovka imeet smysl dobavlyat' tol'ko dlya
# opredelennyh mejlerov, upravlyaya sootvetstvuyushchimi flagami mejlera,
# primer: P - dobavit' pole Return-Path, H?P?Return-Path: <$g>
# Polya "Date", "From", "Message-Id" dobavlyaem prinuditel'no, esli ih net.
HReceived: $?sfrom $s $.by $j$?r with $r$. id $i;
($v$?V/$V$.) $b
HDate: $a
HFrom: $q
HMessage-Id: <$t.$i@$j>
################################
# "Blagonadezhnye" pol'zovateli #
################################
# Sleduyushchim gospodam my verim i razreshaem
# podmenyat' adres From: posredstvom flaga -f.
Troot daemon uucp
###########################
# Opredelenie starshinstva #
###########################
# Pis'ma so sleduyushchimi znacheniyami polya Precedence:
# budut dostavlyat'sya tem bystree, chem bol'she sootvetstvuyushchee
# znachenie stanshinstva. Esli starshinstvo men'she 0,
# soobshchenij ob oshibkah ne budet.
# Po umolchaniyu pis'ma imeyut starshinstvo 0.
#Pbulk=-60
#Pfirst-class=0
#Pjunk=-100
#Pspecial-delivery=100
####################
# Ustanovka flagov #
####################
# Flag 'r' - vremya ozhidaniya vvoda pri rabote po SMTP.
# Delo v tom, chto pri rabote po SMTP v global'noj seti
# byvayut dovol'no bol'shie zaderzhki.
# Obychno - dva chasa, hotya eto i protivorechit
# tradicionnym protokolam.
# Po umolchaniyu ne ogranicheno.
Or2h
# Flag 'T' - vremya ozhidaniya dostavki, obychno tri dnya.
# Posle etogo pis'mo vozvrashchaetsya nazad.
OT3d
# Flag 'Y' - nuzhno li vetvit'sya (fork) pered obrabotkoj
# ocherednogo pis'ma iz ocheredi. Pri etom mozhno sekonomit'
# na operativnoj pamyati, t.k. roditel'skij process ne budet
# rasti po mere obrabotki ocheredi. Zato teryaetsya vozmozhnost'
# otslezhivat' nedostizhimye hosty.
# Po umolchaniyu vyklyucheno (ne vetvit'sya).
#OY
# Flagi 'y', 'z' i 'Z' - upravlenie prioritetom soobshchenij.
# Prioritet vychislyaetsya po formule:
# prioritet = ob®em - (klass * z) + (tirazh * y) + (popytka * Z)
# Zdes' 'ob®em' - razmer soobzheniya v bajtah,
# 'klass' - klass soobshcheniya (sm. komandy 'P'),
# 'tirazh' - kolichestvo adresatov- poluchatelej soobshcheniya,
# 'popytka' - nomer popytki ustanovleniya svyazi (0, 1...).
# CHem nizhe prioritet, tem bystree budet dostavleno soobshchenie.
# Po umolchaniyu y=1000, z=1800, Z=9000.
#Oy1000
#Oz1800
#OZ9000
# Flagi 'x', 'q' i 'X' - ogranichenie zagruzki processora.
# Soobshchenie ne obrabatyvaetsya, a ostaetsya v ocheredi,
# v sluchae, esli zagruzka processora prevyshaet x i
# vypolnyaetsya sleduyushchee uslovie:
# q
# prioritet > ----------------
# zagruzka - x + 1
# Esli zagruzka processora prevyshaet X, sendmail
# perestaet obrabatyvat' vhodyashchie SMTP-soedineniya.
# Po umolchaniyu x=8, q=10000, X=12.
#Ox8
#Oq10000
#OX12
# Flag 'd' - rezhim obrabotki soobshcheniya.
# Varianty: interactive - sinhronnaya dostavka (po umolchaniyu),
# background - asinhronnaya dostavka (fonovym processom),
# queue - otlozhennaya dostavka (zanesenie v ochered').
Odbackground
# Flag 'L' - uroven' diagnostiki, po umolchaniyu 9.
#OL9
# Flagi 'u' i 'g' - identifikatory pol'zovatelya i gruppy,
# ot imeni kotoryh proishodit zapusk mejlerov.
# Po umolchaniyu u=1, g=1.
#Ou1
#Og1
# Flag 'D' - perestraivat' bazu dannyh aliases.{pag,dir}
# avtomaticheski po mere obnovleniya fajla aliases.
# Po umolchaniyu vyklyucheno.
#OD
# Flag 'A' - imya bazy dannyh sinonimov.
# Po umolchaniyu - ./aliases.
OA/etc/mail/aliases
# Flag 'Q' - imya kataloga ocheredi soobshchenij.
# Po umolchaniyu - ./mqueue.
OQ/var/spool/mqueue
# Flag 'H' - imya help-fajla dlya SMTP.
# Po umolchaniyu - ./sendmail.hf.
OH/usr/share/misc/sendmail.hf
# Flag 'S' - imya fajla dlya zapisi statistiki.
# Po umolchaniyu - ./sendmail.st.
OS/var/log/sendmail.st
# Flag 'B' - simvol dlya zapolneniya pustyh polej v adresah.
# Vse nezashchishchennye probely v adresah zamenyayutsya etim simvolom.
# Po umolchaniyu - probel.
#OB.
# Flag 'F' - rezhim dostupa dlya sozdavaemyh fajlov.
# Po umolchaniyu - 0644.
OF0600
# Flag 'a' - vremya ozhidaniya gotovnosti bazy aliases.{pag,dir}
# v minutah (poisk zapisi @:@).
# Po umolchaniyu - ne proveryat' gotovnost' bazy.
# Obychno stavyat 5 minut.
Oa5
# Flag 'o' - obrabatyvat' zagolovki v "starom" formate,
# t.e. adresa razdelyayutsya probelami. V ishodyashchih zagolovkah
# adresa vsegda razdelyayutsya zapyatymi.
# Po umolchaniyu vyklyucheno.
Oo
# Flag 's' - "supernadezhnost'", sohranyat' pis'mo v ocheredi
# dazhe v sluchae nemedlennoj (sinhronnoj) dostavki.
# Po umolchaniyu vyklyucheno.
Os
# Flag 'I' - vsegda oprashivat' name-server (BIND), ne doveryat' fajlu /etc/hosts.
# Neobhodimo, esli /etc/hosts zavedomo nepolon ili trebuetsya obrabatyvat'
# MX-zapisi. Esli vyklyuchit', to snachala budet oprashivat'sya name-server,
# a pri otlupe budem zhit' po /etc/hosts.
# Po umolchaniyu vyklyucheno.
#OI
# Flag 'c' - esli mejler pomechen kak medlennyj (expensive),
# ne vyzyvat' ego nemedlenno, a otlozhit' zadanie v ochered'.
# Po umolchaniyu vyklyucheno.
Oc
# Flag 'e' - rezhim obrabotki oshibok. Vozmozhnye varianty:
# print - pechat' soobshchenij ob oshibkah (po umolchaniyu),
# quiet - nikakih soobshchenij, tol'ko kod otveta,
# mail - vernut' pis'mo s soobshcheniem,
# write - pechat' soobshcheniya na terminal pol'zovatelya ili pis'mom,
# esli pol'zovatelya net v dannyj moment,
# exit - vernut' pis'mo s soobshcheniem i nulevoj kod otveta.
#Oeprint
# Flag 'f' - sohranyat' stroki "From_". Po umolchaniyu vyklyucheno.
Of
# Flag 'i' - ignorirovat' stroki, soderzhashchie tol'ko tochku.
# Po umolchaniyu vyklyucheno.
#Oi
# Flag 'm' - "sebe tozhe". Slat' pis'ma avtoru soobshcheniya,
# esli ego adres prisutstvuet v spiskah rassylki.
# Po umolchaniyu vyklyucheno.
Om
# Flag 'v' - rezhim trassirovki. Po umolchaniyu vyklyuchen.
#Ov
# Flag 'K' - zagruzka dopolnitel'noj bazy dannyh.
# Format: KXfile. Baza dannyh file otkryvaetsya pod imenem X.
# Baza aliases vsegda otkryta s imenem @.
# Zagruzhaem bazu marshrutizacii pod imenem R.
# Dlya IDA sendmail:
#OKR/etc/mail/routes
# Dlya sendmail 8.5:
KR hash /etc/mail/routes
###########
# Mejlery #
###########
# Sintaksis opredeleniya mejlera:
# Mimya, Path=put', Argv=argumenty, Eol=konec-stroki, Maxsize=maks-razmer,
# Flags=flagi, Sender=pravilo-otpr, Recipient=pravilo-poluch,
# Linelimit=maks-dlina-stroki
# Path zadaet polnyj put' komandy, naprimer, /bin/mail,
# ili odin iz chastnyh sluchaev:
# [IPC] ili [TCP] - SMTP seans s udalennym mejlerom,
# [LPC] (local person communication) - SMTP na standartnyj vvod/vyvod,
# dlya otladki. Ne dlya chajnikov. :-)
# Predopredelennye flagi:
# C - esli v adresah poluchatelej net '@', pripisyvat' im domen otpravitelya
# E - preobrazovyvat' stroki From_ v >From
# e - "medlennyj" mejler, vyzyvat' tol'ko pri obrabotke ocheredi (asinhronno)
# f - nuzhno dobavlyat' flag "-f from", esli ot root
# h - ne preobrazovyvat' domen v malen'kie bukvy
# I - etot mejler - SMTP soedinenie s drugim sendmail
# l - lokal'nyj mejler (dostavka konechnomu adresatu)
# L - ogranichivat' dlinu stroki v sootvetstvii s RFC821
# m - vozmozhna posylka neskol'kim adresatam za odin vyzov
# n - ne nuzhno dobavlyat' stroku "From_" v nachalo soobshcheniya
# p - ukazyvat' obratnyj put' v MAIL FROM:
# r - to zhe, chto i -f, no -r
# S - mozhno zapuskat' mejler ot root
# s - udalyat' kavychki " iz adresov
# u - ne preobrazovyvat' v imeni pol'zovatelya bol'shie bukvy v malen'kie
# U - vydavat' stroku "From_" s dobavkoj "remote from " v konce
# X - k kazhdoj stroke, nachinayushchejsya s tochki, pripisyvat' eshche odnu tochku
# Lokal'naya dostavka pol'zovatelyam na dannoj mashine.
Mlocal, Path=/usr/libexec/mail.local, Argv=mail -r $g $u,
Flags=lsmn, Sender=11/10, Recipient=12
# Vypolnenie programm na lokal'noj mashine (dlya fil'trov).
Mprog, Path=/bin/sh, Argv=sh -c $u,
Flags=lse, Sender=11/10, Recipient=12
# Dostavka po SMTP.
Mtcp, Path=[IPC], Argv=IPC $h, Eol=\r\n,
Flags=umeXC, Linelimit=990, Sender=11/10, Recipient=12
# Dostavka po UUCP.
Muucp, Path=/usr/bin/uux, Argv=uux - -z -r $h!rmail ($u),
Flags=Uupm, Maxsize=1000000, Sender=11/10, Recipient=12
# Dostavka po UUCP v bangovoj notacii.
Muucpb, Path=/usr/bin/uux, Argv=uux - -z -r $h!rmail ($u),
Flags=Uupm, Maxsize=1000000, Sender=11, Recipient=13
##########################
# Pravila preobrazovaniya #
##########################
# Imeetsya pyat' osnovnyh (zarezervirovannyh) pravil:
# 1 - obrabotka adresa otpravitelya,
# 2 - obrabotka adresa poluchatelya,
# 3 - predvaritel'naya obrabotka,
# 4 - zaklyuchitel'naya obrabotka,
# 0 - marshrutizaciya.
# Adres lokal'nogo otpravitelya (pol'zovatelya) obrabatyvaetsya
# po sheme 3 -> 1 -> 4.
# Adres udalennogo otpravitelya obrabatyvaetsya po sheme 3 -> 1 -> X -> 4,
# gde X - nomer pravila, ukazannyj v pole Sender sootvetstvuyushchego mejlera.
# Adres poluchatelya obrabatyvaetsya po sheme 3 -> 2 -> Y -> 4,
# gde Y - nomer pravila, ukazannyj v pole Recipient sootvetstvuyushchego mejlera.
# Vybor mejlera proishodit po sheme 3 -> 0.
# Esli opredelen flag '/', to pri obrabotke adresov zagolovkov
# (v otlichie ot konvertov) budut vmesto pravil 1 i 2 primenyat'sya
# pravila 5 i 6 sootvetstvenno.
# Komanda S# zadaet nomer nabora pravil, v diapazone 0..29.
# Komanda R opredelyaet ocherednoe pravilo:
# Rlevaya-chast' pravaya-chast' kommentarij
# Levaya i pravaya chasti razdelyayutsya tabulyaciyami.
# V levoj chasti dopustimy sleduyushchie simvoly:
# $* - nol' i bolee termov
# $+ - odin i bolee term
# $- - rovno odin term
# $=x - nepustaya posledovatel'nost' termov iz klassa X
# $~x - nepustaya posledovatel'nost' termov, ne prinadlezhashchih klassu X
# $%D - nepustaya posledovatel'nost' termov-klyuchej iz DBM-fajla D
# $^D - nepustaya posledovatel'nost' termov, ne vhodyashchih v DBM-fajl D
# Metasimvoly pravoj chasti:
# $1 $2 $2 i t.d. - stroki, sootvetstvuyushchie metasimvolam levoj chasti
# $&X - tekushchee soderzhimoe makro X
# $[ imya $: umolch $] - kanonizaciya imeni (zapros k name-serveru, BIND)
# $(D klyuch $@ arg $: umolch $) - poisk v DBM-fajle
# $>7 - zapusk nabora pravil
# $#mejler - vybor mejlera, tol'ko dlya nabora 0
# $@host - vybor hosta, tol'ko dlya nabora 0
# $:adres - vybor adresa, tol'ko dlya nabora 0
# V nachale pravoj chasti metasimvol $@ oznachaet vozvrat iz tekushchego
# nabora pravil (analog return), metasimvol $: oznachaet
# perehod k sleduyushchemu pravilu (analog break).
# Pravila 1, 2, 5, 6 - pustye, chtoby ne bylo problem s sendmail versii 5.
#------------------------------
# Pravilo 3: kanonizaciya adresa
#------------------------------
S3
# Obrabatyvaem pustoj adres kak vyrozhdennyj sluchaj.
R$*<>$* $@@ nekij specsimvol
# Vytaskivaem adres iz uglovyh skobok. Dvazhdy i dazhe trizhdy. Zachem eto vse?
R$*<$*<$*<$+>$*>$*>$* $4 trojnoj uroven' <<<>>>
R$*<$*<$+>$*>$* $3 dvojnoj uroven' <<>>
R$*<$+>$* $2 normal'nyj adres RFC821/822
# Vse ^ zamenyaem na !.
R$*^$* $1!$2 davno ustarelo
# RFC 1123 ne rekomenduet vypolnyat' marshrutizaciyu vida <@a,@b,@c:user@d>.
# Perepishem kak @a,@b,@c:user<@d>. V pravile 0 otbrosim vse, chto
# do dvoetochiya. No ono mozhet prigodit'sya dlya "From_".
R$*@$*@$* $1^$2@$3 zamenim levye @ na ^
# Obychnyj adres v stile internet.
R$+@$+ $:$1<@$2> domen zaklyuchaem v
R$*^$* $1@$2 obratno ^ => @
R$+<$+@$+> $1$2<@$3> a => ab<@c>
# Privedenie sinonimov k polnym imenam. Obrashchenie k BIND.
R$*<@$-> $:$1<@$[$2$:$2$]> ishchem zapisi tipa CNAME
# Kanonicheskij vid gotov.
R$+<@$+> $@$1<@$2> poluchilos' ab<@c>
# UUCP-pereadresaciya cherez sebya
R$=w!$* $2 myname!addr => addr
# Tipichnyj UUCP-adres, dobavlyaem ".uucp".
R$~B!$* $@$2<@$1.uucp> ab!cd => cd<@ab.uucp>
# UUCP-adres v domennoj adresacii, preobrazuem v internet.
R$*.$~B!$* $@$3<@$1.$2> ab.c!de => de<@ab.c>
# Adres vida user%host, privedem k vidu a%b%c@d.
R$*%$* $1@$2 vse @ zamenim na %
R$*@$*@$* $1%$2@$3 poslednij % na @
R$*@$* $@$1<@$2> postavim skobki
# Prosto user. Dopisyvaem svoj domen.
R$* $@$1<@$w> dobavlyaem svoj domen
#-------------------------------------------
# Pravilo 4: preobrazovanie vo vneshnyuyu formu
#-------------------------------------------
S4
R@ $@ pustoj <> adres
# Preobrazovanie adresa vida 1.2.3.4 v imya domena. Obrashchenie k BIND.
R$*<@[$+]> $:$1<@$[[$2]$]> privedenie chislennogo adresa
# Eshche odno obrashchenie k BIND. Privedenie sinonimov k polnym imenam.
# V principe, mozhno etogo ne delat', esli relay sdelaet eto za nas,
# no pri etom pis'mo mozhet pojti po ves'ma strannomu puti.
R$*<@$-> $:$1<@$[$2$:$2$]> ishchem zapisi tipa CNAME
# Ubiraem uglovye skobki.
R$*<@$+.uucp> $2!$1 privodim v chelovecheskij vid
R$*<$+> $1$2 privodim v chelovecheskij vid
# Udalyaem povtoryayushchiesya domeny.
R$+%$=w@$=w $1@$w u%host@host => u@host
#-------------------------------------
# Pravilo 7: poisk v tablice marshrutov
#-------------------------------------
S7
# Nash domen - lokal'naya pochta.
R$*<@$=w> $@$1<@$w> privodim k standartnomu domenu
# Zaprashivaem v tablice marshrutov.
R$*<@$*> $:$1<@$2^$(R$2$:%$)> stavim marker ^
# Perebiraem vse subdomeny.
# <@addr^%> - ne nashli.
R$*<@$*.$-.$-.$-.$-.$-^%> $:$1<@$2.$3.$4.$5.$6.$7^$(R.$3.$4.$5.$6.$7$:%$)>
R$*<@$*.$-.$-.$-.$-^%> $:$1<@$2.$3.$4.$5.$6^$(R.$3.$4.$5.$6$:%$)>
R$*<@$*.$-.$-.$-^%> $:$1<@$2.$3.$4.$5^$(R.$3.$4.$5$:%$)>
R$*<@$*.$-.$-^%> $:$1<@$2.$3.$4^$(R.$3.$4$:%$)>
R$*<@$*.$-^%> $:$1<@$2.$3^$(R.$3$:%$)>
R$*<@$*^%> $:$1<@$2^$(R.$:%$)> ishchem default (.)
R$*<@$*^%> $@$1<@^%No route to $2>
R$*<@$*^%$*> $@$1<@$2^%$3> oshibka
R$*<@$*^:$*> $@$1<@$2^:$3> zapusk fil'tra
R$*<@$*^/$*> $@$1<@$2^/$3> zapis' v fajl
R$*<@$*^=$*@> $@$1<@$2^=$3@$w> zamena domena
R$*<@$*^=$*> $@$1<@$2^=$3> zamena domena
# Dobavlyaem imya mejlera, esli ne ukazano.
R$*<@$*^!!$*> $1<@$2^uucpb!!$3> <@addr^!!host> mejler uucpb
R$*<@$*^!$*> $1<@$2^uucp!$3> <@addr^!host> mejler uucp
R$*<@$*^@$*> $1<@$2^tcp@$3> <@addr^@> mejler tcp
# Dobavlyaem imya hosta, esli ne ukazano.
R$*<@$*^$*!> $:$1<@$2^$3!$2> <@addr^m!> pravil'nyj marshrut
R$*<@$*^$*@> $:$1<@$2^$3@$2> <@addr^m@> pravil'nyj marshrut
# Udalyaem .uucp dlya UUCP-mejlerov.
R$*<@$*^$*!$+.uucp> $1<@$2^$3!$4> <@addr^m!host.uucp>
# Vozvrashchaem:
# <@addr^mailer@host>, mailer=uucp|tcp, cherez host v internet-adresacii,
# <@addr^mailer!host>, mailer=uucp|tcp, cherez host s udaleniem domena iz adresa,
# <@addr^%message> - oshibka.
R$*<@$*^$*!!$*> $@$1<@$2^$3!$4> <@addr^m!!host> uucp bez domenov
R$*<@$*^$*!$*> $@$1<@$2^$3@$4> privodim uucp k obshchemu vidu
R$*<@$*^$*@$*> $@$1<@$2^$3@$4> gotovyj internet-adres
R$* $@<@^%Invalid route table>
#-----------------------------------
# Pravilo 8: povtornaya marshrutizaciya
#-----------------------------------
#
S8
R$* $:$>3$1 kanonizaciya
R$* $:$>0$1 marshrutizaciya
#------------------------------------------
# Pravilo 9: obrabotka global'nyh sinonimov
#------------------------------------------
# Na vhod podaetsya kanonizirovannyj adres.
S9
# Ishchem global'nyj sinonim v /etc/mail/routes.
R$*<@$*> $:$(R$1@$2$:$1<@$2>$) esli nashli, skobok <> ne budet
R$*<@$*> $@$1<@$2> net takogo sinonima
R$*@ $1@$w lokal'nyj adres
R$* $:$>3$1 kanoniziruem rezul'tat
#-------------------------
# Pravilo 0: marshrutizaciya
#-------------------------
S0
# RFC 1123 ne rekomenduet vypolnyat' marshrutizaciyu vida @a,@b,@c:user<@d>.
# SHlem srazu na user@d.
R@$+:$+ $2 tak gorazdo proshche
# Marshrutizaciya cherez nas.
R$*<@listserv.$=w> $#prog$:/etc/mail/listserv $1 $&f
R$*<@$=w> $:$1<@$w> "svoj" domen - k standartu
# Obrabatyvaem global'nye sinonimy.
R$*<@$*> $:$>9$1<@$2> zapuskaem pravilo 9
# Adres vida [1.2.3.4], preobrazuem v imya, zaprashivaya name-server.
R$*<@[$+]> $:$1<@$[[$2]$]> obrashchenie k BIND
# S name-serverom nichego ne poluchilos'.
R$*<@[$+]> $#tcp$@[$2]$:$1@[$2] vybiraem SMTP
# Zaprashivaem v tablice marshrutov.
R$*<@$*> $:$>7$1<@$2> zapuskaem pravilo 7
# <@oldaddr^=newaddr> - pereadresaciya na drugoj domen.
# Zamenim domen i eshche raz projdem pravilo 7.
R$*<@$*^=$*@$*> $:$>7$3<@$4> a<@old^=b@new> -> b<@new>
R$*<@$*^=$*> $:$>7$1<@$3> <@old^=new> -> <@new>
R$*<@$*^=$*> $#error$:Loop in routes
# Oshibka: <@addr^%stroka>.
R$*<@$*^%$*> $#error$:$3
# <@addr^:path> - zapusk fil'tra.
# Fil'tr vyzyvaetsya s dvumya argumentami, pervyj - imya pol'zovatelya,
# kotoromu poslano pis'mo, vtoroj - adres otpravitelya.
R$*<@$*^:$*> $#prog$:$3 $1 $&f
# Proveryaem ogranichenie po hostu otpravitelya.
# Ishchem routes zapisi vida:
# !host.from:host.to tekst_soobshcheniya_ob_oshibke
# - nel'zya posylat' ot na
R$*<@$*^$*!$*> $:$1<@$2^$3!$4>$(R!$&s:$4$:$)
R$*<@$*^$*@$*> $:$1<@$2^$3@$4>$(R!$&s:$4$:$)
R$*<@$*^$*!$*> $:$1<@$2^$3!$4>$(R!$&s$:$)
R$*<@$*^$*@$*> $:$1<@$2^$3@$4>$(R!$&s$:$)
R$*<@$*^$*!$*>$+ $:$1<@$2^$3!$4>$(R!$&s%$4$:$5$)
R$*<@$*^$*@$*>$+ $:$1<@$2^$3@$4>$(R!$&s%$4$:$5$)
R$*<$*>$+ $#error$:$3
# <@addr^m!host> - pereadresaciya s udaleniem domena.
R$*<@$*^$*!$*> $#$3$@$4$:$1 poehalo bez domena
# <@addr^m@host> - pereadresaciya v stile internet.
R$*<@$*^$*@$*> $#$3$@$4$:$1<@$2> user@host.domain
# Pereadresaciya cherez lokal'nuyu mashinu.
# Povtoryaem vse snachala cherez pravila 3 i 0.
R$*!$*<@$w> $@$>8$1!$2 host!user@myname => host!user
R$*%$*<@$w> $@$>8$1%$2 host%user@myname => host%user
# Pustoj adres - oshibka
R@ $#error$:Invalid address
# Lokal'naya dostavka.
R$*<@$w> $#local$:$1
R$*<@> $#local$:$1
R$+ $#local$:$1 lokal'nyj mejler
#-------------------
# Pravilo 10: pustoe
#-------------------
S10
#------------------------------------
# Pravilo 11: otpravitel' na konverte
#------------------------------------
# Perevod adresov From_ v bangovuyu notaciyu
# dlya otslezhivaniya marshruta statistikoj.
S11
# Iz mnozhestv "imen sobstvennyh" vybiraem standartnoe.
R$*<@$=w> $:$1<@$w> "svoj" domen - k standartu
# Privedenie sinonimov k polnym imenam. Obrashchenie k BIND.
#R$*<@$-> $:$1<@$[$2$:$2$]> ishchem zapisi tipa CNAME
# Marshrut vida @a,@b,@c:user<@d>.
R$*@$*,@$*:$*<$*> $1$2!@$3:$4<$5> @a,@b:u<@h> -> a!@b:u<@h>
R$*@$*:$*<$*> $1$2:$3<$4> a!@b:u<@h> -> a!b!u<@h>
# Teper' razberem obychnuyu formu
R$*@$*<@$*> $1%$2<@$3> lishnie @ na %
R$*:$*<@$*> $1!$3!$2 ubrali vse @ i :
R$*<@$*> $2!$1 ubrali vse @
# Stavim marker ^ i peredvigaem ego na imya pol'zovatelya.
R$* $:^$1^ postavili ^
R$*^$*!$* $1$2!^$3 dvigaem vpravo
# Marshrut vida u%a%b%c.
R$*^$*%$*^$* $1^$3^!$2$4 a%b%c -> c!b!a
R$*^$* $1$2 ubiraem ^
# Ubiraem svoe imya iz puti.
R$=w!$* $2 ubiraem svoe imya
Rlocalhost!$* $1 otrezaem localhost
# Ubiraem ".uucp" iz adresov.
R$~B.uucp!$* $1!$2
R$*!$~B.uucp!$* $1!$2!$3
# Dobavlyaem svoe imya.
R$* $:$w!$1
#-----------------------------------
# Pravilo 12: poluchatel' na konverte
#-----------------------------------
S12
# RFC 1123 ne rekomenduet vypolnyat' marshrutizaciyu vida @a,@b,@c:user<@d>.
# SHlem srazu na user@d.
R@$+:$+ $2 zhit' stalo veselej
#-------------------------------------------------------
# Pravilo 13: poluchatel' na konverte, v bangovoj notacii
#-------------------------------------------------------
S13
R$* $:$>12$1 zapuskaem pravilo 12
# Vozvrat v bangovuyu notaciyu. Primenyaetsya dlya pereadresacii v set',
# ne ponimayushchuyu adresov v stile internet.
R$+<@$+.uucp> $2!$1 u@h.uucp => h!u
R$+<@$*> $2!$1 u@h => h!u
Last-modified: Tue, 11 Aug 1998 05:51:46 GMT