alificirovannyh imen oblasti. Na Internet -UUCP rele, takie hostname dolzhny byt' otobrazheny v uucp oblast' po umolchaniyu. Drugie izmeneniya adresa - 283 - somnitel'ny. Fajl /usr/lib/smail/qualify soobshchaet smail, kotoraya oblast' opredelyaet put' na kotoryj hostname. Vhody v fajle qualify sostoyat iz hostname v perevom stolbce, soprovozhdaemym imenem oblasti. Stroki, soderzhashchie znak musora kak pervyj simvol rassmatrivayutsya kommentariyami. Vhody ishchutsya v poryadke, v kotorom oni poyavlyayutsya. Esli nikakogo fajla qualify ne sushchestvuet, nikakaya hostname kvalifikaciya ne vypolnyaetsya voobshche. Special'nyj hostname * sootvetstvuet lyubomu hostname, takim obrazom dopuskaya Vam otobrazit' vse glavnye |VM, ne upomyanutye prezhde v zadannuyu po umolchaniyu oblast'. |to dolzhno ispol'zovat'sya tol'ko kak poslednij vhod. V Virtual'nom Pivovarennom zavode, vse glavnye |VM byli ustanovleny tak, chtoby ispol'zovat' polnost'yu kvalificirovannye imena oblasti v adresah otpravitelya. Nekvalificirovannye adresa poluchatelya, kak rassmatrivaetsya, nahodyatsya v uucp oblasti, tak chto neobhodim tol'ko odinochnyj vhod v fajle qualify. # /usr/lib/smail/qualify, last changed Feb 12, 1994 by janet # * uucp 16. Sendmail + IDA 16.1 Vvedenie v Sendmail + IDA Uzhe upominalos', chto Vy ne real'nyj administrator sistemy Unix, poka vy ne redaktirovali sendmail.cf fajl. Takzhe skazhut chto vy sumasshedshij, esli vy popytaetes' sdelat' eto dvazhdy :-) Sendmail - neveroyatno moshchnaya programma. Takzhe neveroyatno trudno uznavat' i ponimat' ee dlya bol'shinstva lyudej. Lyubaya programma, ch'e okonchatel'noe rukovodstvo (Sendmail, izdannyj O'Reilly and Associates) sostoit iz 792 stranic, otpugivaet bol'shinstvo lyudej. Sendmail + IDA - eto drugoe. |to udalyaet potrebnost' redaktirovat' vsegda zagadochnyj sendmail.cf fajl i pozvolyaet administratoru opredelyat' punkt-specificheskuyu marshrutizaciyu i konfiguraciyu adresacii cherez otnositel'no prostye dlya ponimaniya fajly - 284 - podderzhki, nazyvaemye tablicami. sendmail + IDA mozhet sohranyat' Vam mnogo chasov raboty i spokojstviya. Sravnivayas' s drugimi glavnymi sredstvami transporta pochty, ne imeetsya nichego, chto ne mozhet byt' vypolneno bystree i proshche s sendmail + IDA. Tipichnye veshchi, kotorye neobhodimy, chtoby realizovat' UUCP ili Internet uzel, stanut prostymi dlya vypolneniya. Konfiguracii, kotorye obychno yavlyayutsya chrezvychajno trudnymi, prosto sozdavat' i podderzhat'. V etoj zapiisi, tekushchaya versiya sendmail5.67b + IDA1.5 dostupen cherez anonimnyj FTP iz vixen.cso.uiuc.edu. Ona kompiliruetsya bez lyubogo vneseniya ispravlenij, trebuemogo pod Linux. Vse fajly konfiguracii, trebuemye, chtoby poluchit' ishodniki sendmail + IDA, chtoby kompilirovat', ustanavlivat', i vypolnyat' pod upravleniem Linux vklyucheny v newspak-2.2.tar.gz, kotoryj yavlyaetsya dostupnym cherez anonimnyj FTP na sunsite.unc.edu v kataloge /pub/Linux/system/Mail. 16.2 Fajly Konfiguracii --- Kratkij obzor Tradicionnyj sendmail ustanovlen cherez fajl konfiguracii sistemy (obychno /etc/sendmail.cf ili /usr/lib/sendmail.cf), kotoryj - ne otnositsya k lyubomu yazyku, kotoryj vy videli prezhde. Redaktirovanie sendmail.cf fajla, chtoby obespechit' nastroennoe povedenie mozhet byt' horoshim opytom. Sendmail + IDA delaet takuyu rabotu po sushchestvu delom proshlogo pri nalichii vseh opcij konfiguracii, s formirovaniem izobrazhenij pri pomoshchi tablicy s dovol'no prostym, chtoby ponyat' sintaksis. |ti opcii konfiguriruyutsya, vypolneniem m4 (processora makrkomand) ili dbm (processora bazy dannyh) v ryade fajlov dannyh cherez Make-fajly, obespechennye ishodnikami. Sendmail.cf fajl opredelyaet tol'ko zadannoe po umolchaniyu povedenie sistemy. Virtual'no vsya special'naya nastrojka vypolnena cherez ryad neobyazatel'nyh tablic a ne neposredstvenno redaktiruya sendmail.cf fajl. - 285 - 16.3 Sendmail.cf Fajl Sendmail.cf fajl dlya sendmail + IDA ne redaktiruetsya neposredstvenno, a generiruetsya iz m4 fajla konfiguracii, obespechennogo lokal'nym administratorom sistemy. V sleduyushchem, my obratimsya k nemu kak k sendmail.m4. |tot fajl soderzhit neskol'ko opredelenij i inache prosto ukazyvaet na tablicy, gde vypolnyaetsya real'naya rabota. Voobshche, neobhodimo opredelit' tol'ko: + Imena putej i imena fajlov, ispol'zuemye v lokal'noj sisteme. + Imena punkta elektronnoj pochty. + Kotoryj zadannyj po umolchaniyu mailer (i vozmozhno smart host) zhelatelen. Imeetsya bol'shoe raznoobrazie parametrov, kotorye mogut byt' opredeleny, chtoby ustanovit' povedenie lokal'nogo punkta seti. |ti opcii konfiguracii identificirovany v fajle ida/cf/OPTIONS v ishodnom kataloge. Fajl sendmail.m4 dlya minimal'noj konfiguracii (UUCP ili SMTP so vsej ne-lokal'noj pochtoj, peredavaemoj neposredstvenno soedinennomu smart-host) mozhet byt' v 10 ili 15 strok, isklyuchaya kommentarii. Mailertable opredelyaet special'noe povedenie dlya otdalennyh glavnyh |VM ili oblastej. Uucpxtable vklyuchaet poluchenie pochty UUCP na glavnye |VM, kotorye nahodyatsya v formate DNS. Pathtable opredelyaet UUCP puti na otdalennye glavnye |VM ili oblasti. Uucprelays zamykaet pathalias put' na obshcheizvestnye otdalennye glavnye |VM. Genericfrom preobrazovyvaet vnutrennie adresa v obobshchennye, vidimye vneshnemu miru. Xaliases preobrazovyvaet obobshchennye adresa na\iz dopustimyh vnutrennih. Decnetxtable preobrazovyvaet RFC-822 adresa v adresa DECnet-stilya. - 286 - 16.3.1 Primer Fajla Sendmail.m4 Fajl sendmail.m4 dlya vstout na Virtual'nom Pivovarennom zavode pokazyvaetsya nizhe. Vstout ispol'zuet SMTP, chtoby razgovarivat' so vsemi glavnymi |VM na LAN Pivovarennogo zavoda, i posylaet vsyu pochtu dlya drugih adresatov k moria, host rele Internet, cherez UUCP. 16.3.2 Obychno Ispol'zuemye sendmail.m4 Parametry Neskotorye predmety v fajle sendmail.m4 trebuyutsya vsegda; drugie mogut ignorirovat'sya, esli Vy mozhete izbezhat' nepriyatnostej so znacheniyami po umolchaniyu. Sleduyushchie razdely opisyvayut kazhdye iz predmetov v fajle sendmail.m4 bolee podrobno. dnl #------------------ SAMPLE SENDMAIL.M4 FILE ------------------ dnl # (the string 'dnl' is the m4 equivalent of commenting out a line) dnl # you generally don't want to override LIBDIR from the compiled in paths dnl #define(LIBDIR,/usr/local/lib/mail)dnl # where all support files go define(LOCAL MAILER DEF, mailers.linux)dnl # mailer for local delivery define(POSTMASTERBOUNCE)dnl # postmaster gets bounces define(PSEUDODOMAINS, BITNET UUCP)dnl # don't try DNS on these dnl #------------------------------------------------------------- dnl # define(PSEUDONYMS, vstout.vbrew.com vstout.UUCP vbrew.com) dnl # names we're known by define(DEFAULT HOST, vstout.vbrew.com)dnl # our primary 'name' for mail define(UUCPNAME, vstout)dnl # our uucp name dnl # dnl #------------------------------------------------------------- dnl # define(UUCPNODES, |uuname|sort|uniq)dnl # our uucp neighbors define(BANGIMPLIESUUCP)dnl # make certain that uucp define(BANGONLYUUCP)dnl # mail is treated correctly define(RELAY HOST, moria)dnl # our smart relay host define(RELAY MAILER, UUCP-A)dnl # we reach moria via uucp - 287 - dnl # dnl #--------------------------------------------------------------------dnl # dnl # the various dbm lookup tables dnl # define(ALIASES, LIBDIR/aliases)dnl # system aliases define(DOMAINTABLE, LIBDIR/domaintable)dnl # domainize hosts define(PATHTABLE, LIBDIR/pathtable)dnl # paths database define(GENERICFROM, LIBDIR/generics)dnl # generic from addresses define(MAILERTABLE, LIBDIR/mailertable)dnl # mailers per host or domain define(UUCPXTABLE, LIBDIR/uucpxtable)dnl # paths to hosts we feed define(UUCPRELAYS, LIBDIR/uucprelays)dnl # short-circuit paths dnl # dnl #--------------------------------------------------------------------dnl # dnl # include the 'real' code that makes it all work dnl # (provided with the source code) dnl # include(Sendmail.mc)dnl # REQUIRED ENTRY !!! dnl # dnl #------------ END OF SAMPLE SENDMAIL.M4 FILE ------- 16.3.2.1 Predmety, kotorye Opredelyayut Puti dnl #define(LIBDIR,/usr/local/lib/mail)dnl # where all support files go LIBDIR opredelyaet katalog, gde sendmail + IDA ozhidaet nahodit' fajly konfiguracii, razlichnye dbm tablicy, i special'nye lokal'nye opredeleniya. V tipichnom dvoichnom raspredelenii, eto kompiliruetsya v sendmail binary i ne dolzhno byt' yavno ustanovleno v fajle send-mail.m4. Vysheupomyanutyj primer soderzhit dnl, kotoryj oznachaet chto eta stroka - po sushchestvu tol'ko dlya utochneniya infrmacii kommentariya. CHtoby izmenit' raspolozhenie fajlov podderzhki na drugoe, udalite dnl iz vysheupomyanutoj stroki, ustanovite put' k zhelatel'nomu raspolozheniyu, i vosstanovite, i povtorno ustanovite sendmail.cf fajl. - 288 - 16.3.2.2 Opredelenie Lokal'nogo Mailer'a define(LOCAL MAILER DEF, mailers.linux)dnl # mailer for local delivery Bol'shinstvo operacionnyh sistem obespechivaet programmu dlya obrabotki lokal'nogo polucheniya pochty. Programmy takogo roda dlya mnogih iz glavnyh variantov Unix uzhe vstroeny v sendmail binary. V Linux, neobhodimo yavno opredelit' sootvetstvuyushchij lokal'nyj mailer, tak kak takaya lokal'naya programma ne obyazatel'no predostavlena v raspredelenii, kotoroe vy ustanovili. |to opredelyaetsya LOCAL MAILER DEF v fajle sendmail.m4. Naprimer, mozhno ustanovit' LOCAL MAILER DEF kak mailers.linux. Sleduyushchij fajl dolzhen to byt' ustanovlen kak mailers.linux v kataloge, ukazannom LIBDIR. |to yavno opredelyaet programmu v Mlocal mailer s sootvetstvuyushchimi parametrami, chtoby sendmail pravil'no prinimal pochtu, napravlennuyu dlya lokal'noj sistemy. Esli Vy ne ekspert sendmail, Vy vozmozhno ne zahotite izmenyat' sleduyushchij primer. # -- /usr/local/lib/mail/mailers.linux -- # (local mailers for use on Linux ) Mlocal, P=/usr/bin/deliver, F=SlsmFDMP, S=10, R=25/10, A=deliver $u Mprog, P=/bin/sh, F=lsDFMeuP, S=10, R=10, A=sh -c $u Imeetsya takzhe vstroennoe znachenie po umolchaniyu dlya deliver v Sendmail.mc fajle, kotoryj vklyuchaetsya v fajl sendmail.cf. CHtoby opredelit' ego, Vy ne dolzhny ispol'zovat' mailers.linux fajl i vzamen opredelit' sleduyushchee v vashem fajle sendmail.m4: dnl --- (in sendmail.m4) --- define(LOCAL MAILER DEF, DELIVER)dnl # mailer for local delivery K sozhaleniyu, Sendmail.mc prinimaet, chto deliver ustanovlen v /bin, chto ne tak v Slackware1.1.1 (kotoryj ustanavlivaet eto v /usr/bin). V tom sluchae vy nuzhdaetes' v fal'shivke so svyaz'yu ili pereustanovit' deliver iz ishodnikov v /bin. - 289 - 16.3.2.3 Obrabotka Bounced-pochty define(POSTMASTERBOUNCE)dnl # postmaster gets bounces Mnogie abonenty nahodyat, chto vazhno garantirovat', chto by pochta posylalas' i poluchalas' s garantiej 100 %. Pri issledovanii sys-logd fajlov registracii polezen lokal'nyj administrator pochty chtoby opredelit', byla li pochta isporchena iz-za oshibki pol'zovatelya ili oshibki konfiguracii na odnoj iz vklyuchaemyh sistem. Opredelenie POSTMASTERBOUNCE privodit k kopii kazhdogo plohogo soobshcheniya cheloveku, opredelennomu kak Postmaster sistemy. K sozhaleniyu, ustanovka etogo parametra takzhe privodit k rassekrechivaniyu teksta soobshcheniya, posylaemogo Postmasteru. 16.3.2.4 Vozmozhnosti Imeni Oblasti define(PSEUDODOMAINS, BITNET UUCP)dnl # don't try DNS on these Imeyutsya otdel'nye izvestnye seti, kotorye obychno ukazany v adresah pochty po istoricheskim prichinam, no eto ne dopustimo dlya celej DNS. Opredelenie PSEUDODOMAINS predotvrashchaet bespoleznye DNS popytki poiska, kotorye budut vsegda terpet' neudachu. 16.3.2.5 Opredelenie Lokal'noj Sistemy define(PSEUDONYMS, vstout.vbrew.com vstout.UUCP vbrew.com)dnl # names we're known by define(DEFAULT HOST, vstout.vbrew.com)dnl # our primary 'name' for mail CHasto, sistemy zhelayut skryt' ih istinnoe tozhdestvo, i sluzhat kak vorota pochty, ili poluchatyut i obrabatyvayut pochtu, adresovannuyu na " starye " imena. PSEUDONYMS opredelyaet spisok vseh hostname, dlya kotoryh lokal'naya sistema primet pochtu. - 290 - DEFAULT HOST opredelyaet hostname, kotoryj poyavitsya pri vozniknovenii soobshchenij na lokal'nom host. 16.3.2.6 Uucp-zavisimye Aspekty define(UUCPNAME, vstout)dnl # our uucp name define(UUCPNODES, |uuname|sort|uniq)dnl # our uucp neighbors define(BANGIMPLIESUUCP)dnl # make certain that uucp define(BANGONLYUUCP)dnl # mail is treated correctly CHasto, sistemy izvestny pod odnim imenem dlya celej DNS i drugim dlya celej UUCP. UUCPNAME razreshaet Vam opredelyat' razlichnye hostname, kotorye poyavlyayutsya v zagolovkah vyhoda pochty UUCP. UUCPNODES opredelyaet komandy, kotorye vozvrashchayut spisok hostnames dlya sistem, s kotorymi my soedineny neposredstvenno s cherez UUCP soedineniya. BANGIMPLIESUUCP i BANGONLYUUCP garantiruet, chto pochta, adresovannaya s UUCP sintaksisom obrabatyvaetsya soglasno UUCP, a ne bolee sovremennomu DNS, ispol'zuemomu segodnya v Internet. 16.3.2.7 Relay-Sistemy i Mailer'y define(RELAY HOST, moria)dnl # our smart relay host define(RELAY MAILER, UUCP-A)dnl # we reach moria via UUCP RELAY HOST opredelyaet UUCP hostname intellektual'noj sosednej sistemy (sposobnoj poslat' pochty v lyubuyu set' mira). RELAY MAILER opredelyaet mailer, ispol'zuemyj, chtoby peredat' tuda soobshcheniya. Vazhno obratit' vnimanie, chto ustanavlivayushchij eti parametry privodit k posylke vashej pochty k etoj otdalennoj sisteme, kotoraya budet vozdejstvovat' na zagruzku ih sistemy. Ubedites', chto vy poluchili yavnoe soglashenie otdalennogo Postmastera prezhde, chem Vy konfiguriruete vashu sistemu, chtoby ispol'zovat' druguyu sistemu kak universal'nyj relay host. - 291 - 16.3.2.8 Razlichnye Tablicy Konfiguracii define(ALIASES, LIBDIR/aliases)dnl # system aliases define(DOMAINTABLE, LIBDIR/domaintable)dnl # domainize hosts define(PATHTABLE, LIBDIR/pathtable)dnl # paths database define(GENERICFROM, LIBDIR/generics)dnl # generic from addresses define(MAILERTABLE, LIBDIR/mailertable)dnl # mailers per host or domain define(UUCPXTABLE, LIBDIR/uucpxtable)dnl # paths to hosts we feed define(UUCPRELAYS, LIBDIR/uucprelays)dnl # short-circuit paths S etimi makrkomandami, Vy mozhete izmenyat' raspolozhenie, gde sendmail + IDA ishchet razlichnye dbm tablicy, kotorye opredelyayut povedenie sistemy. Voobshche nuzhno ostavit' ih v LIBDIR. 16.3.2.9 Glavnyj Fajl Sendmail.mc include(Sendmail.mc)dnl # REQUIRED ENTRY !!! Avtory sendmail + IDA obespechivayut fajl Sendmail.mc, kotoryj soderzhit "vnutrennosti" togo, chto stanovitsya fajlom sendmail.cf. Periodicheski vypuskayutsya novye versii, chtoby ustanovit' oshibki ili dobavlit' funkcional'nye vozmozhnosti bez polnogo vypuska i peretranslyacii sendmail iz ishodnikov. Vazhno ne redaktirovat' etot fajl. 16.3.2.10 Tak kotorye Vhody Dejstvitel'no trebuyutsya? Esli ne ispol'zuyutsya dbm tablicy, sendmail + IDA peredaet pochtu cherez DEFAULT MAILER (i vozmozhno RELAY HOST i RELAY MAILER) opredelennyj v fajle sendmail.m4, ispol'zuemom, chtoby generirovat' sendmail.cf. Legko mozhno otmenit' eto povedenie cherez vhody v domaintable ili uucpxtable. Virtual'no vse sistemy dolzhny ustanovit' DEFAULT HOST, makrkomandy PSEUDONYMS, kotorye opredelyayut kanonicheskioe imya punkta, i DEFAULT MAILER. Esli vse chto Vy imeete - eto relay host i relay mailer, Vy ne dolzhny ustanavlvat' eti znacheniya po umolchaniyu, tak kak eto rabotaet avtomaticheski. - 292 - UUCP glavnye |VM budut vozmozhno takzhe dolzhny ustanovit' UUCPNAME kak ih oficial'noe imya UUCP. Oni takzhe vozmozhno ustanovyat RELAY MAILER, i RELAY HOST, kotorye dayut vozmozhnost' marshrutizacii smart-host cherez relay pochtu. Transport pochty, kotoryj nuzhno ispol'zovat' opredelen v RELAY MAILER i dolzhen obychno byt' UUCP-A dlya UUCP abonenta. Esli vash punkt tol'ko SMTP i ispol'zuet "Domain Name Service ", Vam sleduet zamenit' DEFAULT MAILER na TCP-A i vozmozhno udalit' STROKI RELAY HOST i RELAY MAILER. 16.4 Prosmotr Sendmail + IDA Tablic Sendmail + IDA obespechivaet ryad tablic, kotorye pozvolyayut Vam otmenyat' zadannoe po umolchaniyu povedenie sendmail (zadannoe v fajle sendmail.m4) i opredelyat' special'noe povedenie dlya unikal'nyh situacij, otdalennyh sistem, i Setej. |ti tablicy obrabatyvayutsya dbm ispol'zuya Make-fajl, obespechennyj raspredeleniem. Bol'shinstvo abonentov budet nuzhdat'sya v nekotoryh iz etih tablic. Esli vash punkt ne trebuet etih tablic, samaya prostaya veshch', vozmozhno, sdelat' ih fajlami nulevoj dliny (komandoj touch) i ispol'zovat' zadannyj po umolchaniyu Make-fajl v LIBDIR, a ne redaktirovat' Make-fajl neposredstvenno. 16.4.1 Mailertable Mailertable opredelyaet special'noe obrashchenie dlya specificheskih glavnyh |VM ili oblastej, osnovannyh na otdalennom host ili setevom imeni. |to chasto ispol'zuetsya na abonente Internet, chtoby vybrat' promezhutochnyj relay host dlya pochty ili gateway, chtoby dostignut' otdalennoj seti, i opredelit' specificheskij protokol (UUCP ili SMTP). UUCP abonent voobshche ne dolzhen ispol'zovat' etot fajl. Poryadok vazhen. Sendmail chitaet fajl, nishodyashche i obrabatyvaet soobshcheniya soglasno pervomu pravilu, kotoromu ono sootvetstvuet. Tak chto voobshche nuzhno pomestit' naibolee yavnye pravila naverhu fajla i bolee obobshchennyh pravil nizhe. - 293 - Predpolozhite, chto Vy hotite napravlyat' vsyu pochtu dlya otdeleniya Informatiki v Universitete Groucho Marx cherez UUCP relay host ada. CHtoby sdelat' tak, Vam nuzhen punkt v mailertable, kotoryj pohodit na sleduyushchee: # (in mailertable) # # forward all mail for the domain .cs.groucho.edu via UUCP to ada UUCP- A,ada .cs.groucho.edu Predpolozhite, chto Vy hotite chtoby vsya pochta k groucho.edu oblasti shla k drugomu relay host - bighub. Rasshirennye vhody mailertable vyglyadeli by podobno: # (in mailertable) # # forward all mail for the domain cs.groucho.edu via UUCP to ada UUCP-A,ada .cs.groucho.edu # # forward all mail for the domain groucho.edu via UUCP to bighub UUCP- A,bighub .groucho.edu Kak upomyanuto vyshe, poryadok vazhen. Reversirovanie poryadka iz dvuh pravil, pokazannyh vyshe privodit k peredache vsej pochty k .cs.groucho.edu cherez bolee obobshchennyj bighub put' vmesto yavnogo ada puti, kotoryj dejstvitel'no zhelatelen. # (in mailertable) # # forward all mail for the domain .groucho.edu via UUCP to bighub UUCP- A,bighub .groucho.edu # # (it is impossible to reach the next line because # the rule above will be matched first) UUCP-A,ada .cs.groucho.edu # V primerah mailertable vyshe, UUCP-A mailer zastavit sendmail ispol'zovat' UUCP poluchenie s zagolovkami oblasti. - 294 - Zapyataya mezhdu mailer'om i otdalennoj sistemoj soobshchaet o peredache soobshcheniya k ada dlya polucheniya. Mailertable vhody(punkty) imeyut format: mailer delimiter relayhost host or domain Imeetsya ryad vozmozhnyh mailer'ov. Razlichiya - voobshche v tom, kak oni obrabatyvayut adresa. Tipichnye mailer'y - TCP-A (TCP/IP s adresami - stilya Internet), TCP-U (TCP/IP s adresami uucp-stilya), i UUCP-A (UUCP s adresami -stilya Internet). Simvol, kotoryj otdelyaet mailer ot host sleva v stroke mailertable, opredelyaet, kak adres izmenyaetsya mailertable. ! Otmetka vosklicaniya udalyaet hostname poluchatelya pered peresylkoj k mailer'u. |to mozhet ispol'zovat'sya, kogda Vy hotite poslat' pochtu v nekonfigurirovannyj otdalennyj punkt. , Zapyataya ne izmenyaet adres vsegda. Soobshchenie prosto budet poslano cherez zadannyj mailer zadannomu relay host. : Dvoetochie udalyaet hostname poluchatelya tol'ko, esli imeyutsya promezhutochnye glavnye |VM mezhdu Vami i adresatom. Takim obrazom iz foo!bar!Joe budet udalen foo, v to vremya kak xyzzy!Janet ostanetsya neizmennym. 16.4.2 Uucpxtable Obychno, pochta na glavnye |VM s polnost'yu kvalificirovannymi imenami oblasti peredaetsya v stile Internet (SMTP), ispol'zuya Domain Name Service (DNS), ili cherez relay host. Uucpxtable vynuzhdaet poluchenie cherez marshrutizaciyu UUCP, preobrazuya imya v otdalennyj hostname UUCP-stilya. |to chasto ispol'zuetsya, kogda vash uzel sluzhit dlya prodvizheniya dannyh pochty dlya punkta ili oblasti ili kogda Vy zhelaete poslat' pochtu cherez pryamuyu i nadezhnuyu svyaz' UUCP, a ne cherez mnozhestvo abonentov cherez zadannyj po umolchaniyu mailer i lyubye promezhutochnye sistemy i seti. Abonenty UUCP, kotorye razgovarivayut s sosedyami po UUCP, kotorye ispol'zuyut zagolovki pochty s opredelennym imenem oblasti, ispol'zovali by etot fajl, chtoby vynudit' poluchenie pochty cherez pryamuyu UUCP dvuhtochechnuyu svyaz' mezhdu dvumya sistemami, a ne ispol'zovali by menee - 295 - pryamoj marshrut cherez RELAY MAILER i RELAY HOST ili cherez DEFAULT MAILER. Abonent Internet, kotoryj ne vhodit v UUCP mozhet ne ispol'zovat' uucpxtable. Predpolozhite, chto Vy obespechivaete obsluzhivanie peresylki pochty k sisteme, nazyvaemoj sesame.com v DNS i sesame v kartah UUCP. Vy nuzhdalis' by v sleduyushchem vhode uucpxtable, chtoby vynudit' pochtu dlya ih host projti cherez vashe pryamoe soedinenie UUCP. #============== /usr/local/lib/mail/uucpxtable ============ # Mail sent to joe@sesame.com is rewritten to sesame!joe and # therefore delivered via UUCP # sesame sesame.com # #---------------------------------------------------------- 16.4.3 pathtable Pathtable ispol'zuetsya, chtoby opredelit' yavnuyu marshrutizaciyu na otdalennye glavnye |VM ili seti. Fajl pathtable dolzhen byt' v sintaksise pathalias-stilya, sortiruemom v alfavitnom poryadke. Dva polya na kazhdoj stroke dolzhny otdelit'sya real'noj METKOJ TABULYACII. Bol'shinstvo sistem ne budet nuzhdat'sya v lyubyh vhodah pathtable. #=============== /usr/local/lib/mail/pathtable ================ # # this is a pathalias-style paths file to let you kick mail to # UUCP neighbors to the direct UUCP path so you don't have to # go the long way through your smart host that takes other traffic # # you want real tabs on each line or m4 might complain # # route mail through one or more intermediate sites to a remote # system using UUCP-style addressing. # sesame!ernie!%s ernie # - 296 - # forwarding to a system that is a UUCP neighbor of a reachable # internet site. # swim!%s@gcc.groucho.edu swim # # The following sends all mail for two networks through different # gateways (see the leading '.' ?). # In this example, "uugate" and "byte" are specific systems that serve # as mail gateways to the .UUCP and .BITNET pseudo-domains respectively # %s@uugate.groucho.edu .UUCP byte!%s@mail.shift.com .BITNET # #=================== end of pathtable ======================= 16.4.4 domaintable Domaintable voobshche ispol'zuetsya, chtoby vynudit' nekotoroe povedenie posle togo, kak poisk DNS proizoshel. |to razreshaet administratoru delat' korotkie imena dostupnymi dlya obychno vyzyvaemyh sistem ili oblastej, zamenyaya takoe imya na sootvetstvuyushchee avtomaticheski. |to mozhet takzhe ispol'zovat'sya, chtoby zamenit' nepravil'nyj host ili imena oblasti na " pravil'nye ". Bol'shinstvo abonentov ne budet nuzhdat'sya v lyubyh vhodah domaintable. Sleduyushchij primer pokazyvaet, kak zamenit' nepravil'nye adresa na pravil'nyj adres: #============= /usr/local/lib/mail/domaintable ================= # # brokenhost.correct.domain brokenhost.wrong.domain # # #=================== end of domaintable ======================== 16.4.5 aliases Aliases(special'nye vozmozhnosti) razreshayut ryad veshchej: - 297 - + Oni obespechivayut korotkoe imya ili obshcheizvestnoe imya dlya pochty, kotoraya budet adresovana k odnomu ili bol'shomu kolichestvu lyudej. + Oni vyzyvayut programmu s soobshcheniem pochty kak vvod dlya programmy. + Oni posylayut pochtu v fajl. Vse sistemy trebuyut aliases dlya Postmastera. Vsegda chrezvychajno vazhna zashchita pri opredelenii aliases, kotorye vyzyvayut programmy ili zapis' k programmam, tak kak sendmail voobshche vypolnyaet setuid-root. Izmeneniya v fajle aliases, ne vozdejstvuyut do komandy # /usr/lib/sendmail -bi vypolnyaemoj, chtoby formirovat' trebuemye dbm tablicy. |to mozhet takzhe byt' vypolneno, vypolnyaya komandu newaliases, obychno iz cron. #--------------------- /usr/local/lib/mail/aliases ------------------ # # demonstrate commonly seen types of aliases # usenet: janet # alias for a person admin: joe,janet # alias for several people newspak-users: :include:/usr/lib/lists/newspak # read recipients from a file changefeed: | /usr/local/lib/gup # alias that invokes a program complaints: /var/log/complaints # alias that writes mail to a file # # The following two aliases must be present to be RFC-compliant. # It is important to have them resolve to 'a person' # who reads mail routinely. # postmaster: root # required entry MAILER-DAEMON: postmaster # required entry # - 298 - #------------------------------------------------------------------- 16.4.6 Redko Ispol'zuemye Tablicy Sleduyushchie tablicy dostupny, no dovol'no nechasto ispol'zuyutsya. Konsul'tirujtes' s dokumentaciej, kotoraya prihodit s sendmail + IDA dlya podrobnostej. Uucprelays Fajl uucprelays ispol'zuetsya dlya opredeleniya " korotkogo " puti UUCP k osobenno horosho izvestnomu abonentu, a ne ispol'zuya put' cherez ryad host ili nenadezhnyj put', sgenerirovannyj, obrabatyvaya karty UUCP s pathalias. Genericfrom i xaliases Fajl genericfrom skryvaet lokal'nye usernames i adresa ot vneshnego mira, avtomaticheski preobrazuya(konvertiruya) lokal'nye usernames v obobshchennye adresa otpravitelya, kotorye ne sootvetstvuyut vnutrennemu usernames. Svyazannaya utilita xalparse avtomatiziruet porozhdenie fajla genericfrom i fajla aliases tak, chtoby i vhodyashchie i ishodyashchie username translyacii proizoshli iz glavnogo fajla xaliases. Decnetxtable perezapisyvaet adresa s opredelennym imenem oblasti v adresa decnet-stilya, ochen' pohozhe na domaintable, mozhet ispol'zovat'sya, chtoby perezapisat' adresa s ne opredelennym imenem oblasti v adresa s opredelennym imenem oblasti smtp-stilya. 16.5 Ustanovka sendmail V etom razdele, my rassmotrim kak ustanovit' tipichnoe dvoichnoe raspredelenie sendmail + IDA, i chto dolzhno byt' vypolneno, chtoby sdelat' ego lokalizovannym i funkcional'nym. Tekushchee dvoichnoe raspredelenie sendmail + IDA dlya Linux mozhet byt' polucheno iz sunsite.unc.edu v /pub/Linux/system/Mail. Dazhe esli Vy imeete bolee rannyuyu versiyu sendmail, ya strogo rekomenduyu, chtoby Vy ispol'zovali sendmail5.67b + IDA1.5. Esli Vy formiruete sendmail iz ishodnikov, Vy dolzhny sledovat' sovetam v README, vklyuchennom v ishodnoe raspredelenie. Tekushchie ishodniki sendmail + IDA dostupny iz vixen.cso.uiuc.edu. CHtoby formirovat' - 299 - sendmail + IDA na Linux, Vy takzhe nuzhdaetes' v Linux -specificheskih fajlah konfiguracii iz newspak-2.2.tar.gz, kotoryj yavlyaetsya dostupnym na sun- site.unc.edu v kataloge /pub/Linux/system/Mail. Esli Vy predvaritel'no ustanovili smail ili drugoe sredstvo polucheniya pochty, vam vozmozhno nuzhno udalit' (ili pereimenovat') vse fajly iz smail dlya bezopasnosti. 16.5.1 Izvlechenie dvoichnogo raspredeleniya Snachala, Vy dolzhny razpakovat' fajl arhiva v nekotorom bezopasnom raspolozhenii: $ gunzip -c sendmail5.65b+IDA1.5+mailx5.3b.tgz | tar xvf - Esli Vy imeete "sovremennyj" tar, naprimer iz nedavnego Slackware, Vy mozhete sdelat' tar -zxvf filename.tgz i poluchit' te zhe samye rezul'taty. Raspakovka arhiva sozdaet katalog, imenovannyj sendmail5.65b +IDA1.5+ mailx5.3b. V etom kataloge, Vy nahodite komplektnoe oborudovanie sendmail + IDA plyus mailx. Ves' paths fajl nizhe etogo kataloga otrazhaet raspolozhenie, gde fajly dolzhny byt' ustanovleny, tak chto bezopasno podgotovit' komandu tar: # cd sendmail5.65b+IDA1.5+mailx5.3b # tar cf - . | (cd /; tar xvvpoof -) 16.5.2 Formirovanie sendmail.cf CHtoby sformirovat' fajl sendmail.cf, nastroennyj dlya vashego punkta, Vy dolzhny sshchzdat' fajl sendmail.m4, i obrabotat' ego s m4. V /usr/local/lib/mail/CF, Vy najdete tipovoj fajl nazyvaemyj sample.m4. Kopirujte ego v yourhostname.m4, i redaktirujte, chtoby otrazit' situaciyu vashego punkta. V tekushchem razdele, ya budu davat' korotkij kratkij obzor makrkomand, kotorye Vy dolzhny izmenit'. Dlya polnogo opisaniya togo, chto oni delayut, pozhalujsta, obratites' k bolee rannemu obsuzhdeniyu sendmail.m4. LOCAL MAILER DEF Opredelyaet fajl, kotoryj opredelyaet mailer dlya lokal'nogo polucheniya pochty. Sm. razdel " Opredelenie Lokal'nogo Mailer'a " vyshe. - 300 - PSEUDONYMS Opredelyaet vse imena, vashego lokal'nogo host. DEFAULT HOST Pomeshchaetsya v vashe polnost'yu kvalificirovannoe imya oblasti. |to imya poyavitsya kak vash hostname vo vsej vyhodyashchej pochte. UUCPNAME Pomeshchaetsya v vashe nekvalificirovannoe hostnmae. RELAY HOST i RELAY MAILER Esli Vy govorite UUCP smart-host ustanovit' RELAY HOST dlya UUCP imeni vashego " intellektual'no zavisimogo " uucp soseda. Ispol'zujte UUCP-A mailer, esli Vy hotite zagolovki s opredelennym imenem oblasti. DEFAULT MAILER Esli Vy nahodites' v Internet i ispol'zuete DNS, Vy dolzhny ustanovit' ego kak TCP-A. |to soobshchaet, chtoby sendmail ispol'zoval TCP-A mailer, kotoryj peredaet pochtu cherez SMTP ispol'zuya normal'nuyu RFC adresaciyu dlya konverta. Abonent Internet vozmozhno ne dolzhen opredelyat' RELAY HOST or RELAY MAILER. CHtoby sozdat' fajl sendmail.cf, vypolnite komandu # make yourhostname.cf Ona obrabotaet fajl yourhostname.m4 i sozdast yourhostname.cf iz nego. Zatem, Vy dolzhny proverit', delaet li fajl konfiguracii, kotoryj vy sozdali, to, chto Vy ozhidaete. |to ob®yasnyaetsya v sleduyushchih dvuh razdelah. Esli vy udovletvoreny ego povedeniem, skopirujte ego na mesto komandoj: # cp yourhostname.cf /etc/sendmail.cf Teper' vasha sistema sendmail gotova k dejstviyam. Pomestite sleduyushchuyu stroku v sootvetstvuyushchem fajle zapuska (voobshche /etc/rc.inet2). Vy mozhete takzhe vypolnit' ee vruchnuyu, chtoby zapustit' ego teper'. # /usr/lib/sendmail -bd -q1h 16.5.3 Testirovanie fajla sendmail.cf - 301 - CHtoby vklyuchit' " proverochnyj " rezhim, Vy vyzyvaete sendmail s -bt flagom. Zadannyj po umolchaniyu fajl konfiguracii - fajl sendmail.cf, kotoryj ustanovlen na sisteme. Vy mozhete proveryat' al'ternativnyj fajl, ispol'zuya -Cfilename opciyu. V sleduyushchih primerah, my proveryaem vstout.cf fajl konfiguracii, sgenerirovannyj iz fajla vstout.m4. # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE Enter
[Note: No initial ruleset 3 call] > Sleduyushchie testy garantiruyut, chto sendmail sposoben poluchat' vsyu pochtu pol'zovatelej vashej sistemy. Vo vseh sluchayah rezul'tat testa dolzhen byt' tot zhe samyj i ukazyvat' na lokal'noe imya sistemy s LOKALXNYM mailer'om. Snachala proverite, kak pochta byla by peredana lokal'nomu pol'zovatelyu. # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE Enter
[Note: No initial ruleset 3 call] > 3,0 me rewrite: ruleset 3 input: me rewrite: ruleset 7 input: me rewrite: ruleset 9 input: me rewrite: ruleset 9 returns: < me > rewrite: ruleset 7 returns: < > , me rewrite: ruleset 3 returns: < > , me rewrite: ruleset 0 input: < > , me rewrite: ruleset 8 input: < > , me rewrite: ruleset 20 input: < > , me rewrite: ruleset 20 returns: < > , @ vstout . vbrew . com , me rewrite: ruleset 8 returns: < > , @ vstout . vbrew . com , me rewrite: ruleset 26 input: < > , @ vstout . vbrew . com , me rewrite: ruleset 26 returns: $# LOCAL $@ vstout . vbrew . com $: me - 302 - rewrite: ruleset 0 returns: $# LOCAL $@ vstout . vbrew . com $: me Vyvod pokazyvaet kak sendmail obrabatyvaet adres vnutrenne. On vruchaetsya razlichnym ruleset, kotorye analiziruyut ego, vyzyvayut drugoj ruleset po ocheredi, i razbivayut ego v komponenty. V nashem primere, my peredali moj adres k ruleset 3 i 0 (eto - znachenie iz 3,0 vvedennoe pered adresom). Poslednyaya stroka pokazyvaet analiziruemyj adres vozvrashchaemyj ruleset 0. Zatem, proverite pochtu pol'zovatelya vashej sistemy s sintaksisom UUCP. # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE Enter
[Note: No initial ruleset 3 call] > 3,0 vstout!me rewrite: ruleset 3 input: vstout ! me [...] rewrite: ruleset 0 returns: $# LOCAL $@ vstout . vbrew . com $: me > Zatem, proverite pochtu, adresovannuyu pol'zovatelyu vashej sistemy s sintaksisom Internet k vashemu polnost'yu kvalificirovannomu hostname. # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE Enter
[Note: No initial ruleset 3 call] > 3,0 me@vstout.vbrew.com rewrite: ruleset 3 input: me @ vstout . vbrew . com [...] rewrite: ruleset 0 returns: $# LOCAL $@ vstout . vbrew . com $: me > Vy dolzhny povtorit' vysheupomyanutye dva testa s kazhdym iz imen, kotorye Vy opredelili v PSEUDONYMS i parametrah DEFAULT NAME v vashem fajle sendmail.m4. Nakonec, proverite chto Vy mozhete otpravlyat' pochtu vashemu relay host. # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE - 303 - Enter
[Note: No initial ruleset 3 call] > 3,0 fred@moria.com rewrite: ruleset 3 input: fred @ moria . com rewrite: ruleset 7 input: fred @ moria . com rewrite: ruleset 9 input: fred @ moria . com rewrite: ruleset 9 returns: < fred > @ moria . com rewrite: ruleset 7 returns: < @ moria . com > , fred rewrite: ruleset 3 returns: < @ moria . com > , fred rewrite: ruleset 0 input: < @ moria . com > , fred rewrite: ruleset 8 input: < @ moria . com > , fred rewrite: ruleset 8 returns: < @ moria . com > , fred rewrite: ruleset 29 input: < @ moria . com > , fred rewrite: ruleset 29 returns: < @ moria . com > , fred rewrite: ruleset 26 input: < @ moria . com > , fred rewrite: ruleset 25 input: < @ moria . com > , fred rewrite: ruleset 25 returns: < @ moria . com > , fred rewrite: ruleset 4 input: < @ moria . com > , fred rewrite: ruleset 4 returns: fred @ moria . com rewrite: ruleset 26 retu rns < @ moria . com > , fred rewrite: ruleset 0 returns: $# UUCP-A $@ moria $: < @ moria . com > , fred > 16.5.4 Pomeshchenie vsego vmeste - Integracionnaya proverka sendmail.cf i tablic Vy proverili chto pochta budet imet' zhelatel'noe zadannoe po umolchaniyu povedenie i chto vy budete sposobny i poslat' i poluchit' zakonno adresovannuyu pochtu. CHtoby zavershit' ustanovku, mozhet byt' neobhodimo sozdat' sootvetstvuyushchie dbm tablicy, chtoby poluchit' zhelatel'nye konechnye rezul'taty. Posle sozdaniya tablic, kotorye trebuyutsya dlya vashego punkta, Vy dolzhny, obrabotat' ih cherez dbm sozdaniem make v kataloge, soderzhashchem tablicy. Esli Vy yavlyaetes' tol'ko UUCP uzlom, Vy ne dolzhny sozdvat' tablicy, upomyanutye v README.linux fajle. Vy budete dolzhny tol'ko podpravit' fajly tak, chtoby Make-fajl rabotal. Esli vy v UUCP i Vy razgovarivaete s abonentami v dopolnenie k vashemu smart-host, vy budete dolzhny dobavit' vhody uucpxtable dlya kazhdogo - 304 - (ili pochta k nim takzhe projdet cherez smart host) i vypolnit' dbm dlya peresmotrennogo uucpxtable. Snachala, Vy dolzhny udostoverit'sya chto pochta cherez vash RELAY HOST, posylaetsya im cherez RELAY MAILER. # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE Enter
[Note: No initial ruleset 3 call] > 3,0 fred@sesame.com rewrite: ruleset 3 input: fred @ sesame . com rewrite: ruleset 7 input: fred @ sesame . com rewrite: ruleset 9 input: fred @ sesame . com rewrite: ruleset 9 returns: < fred > @ sesame . com rewrite: ruleset 7 returns: < @ sesame . com > , fred rewrite: ruleset 3 returns: < @ sesame . com > , fred rewrite: ruleset 0 input: < @ sesame . com > , fred rewrite: ruleset 8 input: < @ sesame . com > , fred rewrite: ruleset 8 returns: < @ sesame . com > , fred rewrite: ruleset 29 input: < @ sesame . com > , fred rewrite: ruleset 29 returns: < @ sesame . com > , fred rewrite: ruleset 26 input: < @ sesame . com > , fred rewrite: ruleset 25 input: < @ sesame . com > , fred rewrite: ruleset 25 returns: < @ sesame . com > , fred rewrite: ruleset 4 input: < @ sesame . com > , fred rewrite: ruleset 4 returns: fred @ sesame . com rewrite: ruleset 26 returns: < @ sesame . com > , fred rewrite: ruleset 0 returns: $# UUCP-A $@ moria $: < @ sesame . com > , fred > Esli Vy imeete UUCP sosedej krome vashego RELAY HOST, Vy dolzhny garantirovat', chto pochta k nim imeet sootvetstvuyushchee povedenie. Pochta, adresovannaya s sintaksisom stilya UUCP dlya host, s kotorym Vy govorite po UUCP, dolzhna idti neposredstvenno k nim (esli Vy yavno ne predotvrashchaete eto vhodom domaintable). Primite, chto swim host - pryamoj sosed UUCP vashih sosedej. I pri podache swim!Fred sendmail dolzhen proizvesti sleduyushchij rezul'tat: - 305 - # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE Enter
[Note: No initial ruleset 3 call] > 3,0 swim!fred rewrite: ruleset 3 input: swim ! fred [...lines omitted...] rewrite: ruleset 0 returns: $# UUCP $@ swim $: < > , fred > Esli Vy imeete vhody uucpxtable, chtoby vynudit' poluchenie po UUCP dlya nekotoryh UUCP sosedej, kotorye posylayut pochtu stilya Internet s opredelennym imenem oblasti, eto takzhe dolzhno byt' provereno. # /usr/lib/sendmail -bt -Cvstout.cf ADDRESS TEST MODE Enter
[Note: No initial ruleset 3 call] > 3,0 dude@swim.2birds.com rewrite: ruleset 3 input: dude @ swim . 2birds . com [...lines omitted...] rewrite: ruleset 0 returns: $# UUCP $@ swim . 2birds $: < > , dude > 16.6 Administrirovanie i Glupye Priemy Pochty Teper', kogda my obsudili teoriyu konfigurirovaniya, ustanovki, i testirovaniya sendmail + IDA, davajte rassmotrim neskol'ko momentov, chtoby izuchit' veshchi, kotorye sluchayutsya obychno v zhizni administratora pochty. Otdalennye sistemy inogda lomayutsya. Oshibka modema ili sboj telefonnyh linij, opredeleniya DNS ustanovleny nepravil'no iz-za chelovecheskoj oshibki. Seti padayut neozhidanno. V takih sluchayah, administratory pochty dolzhny znat', kak reagirovat' bystro, dejstvenno, i bezopasno shranit' pochtu, tekushchuyu cherez al'ternativnye marshruty, poka otdalennye sistemy ili postavshchiki uslug ne mogut vosstanovit' normal'nye uslugi. Ostal'naya chast' etoj glavy prednaznachena, chtoby obespechit' Vas resheniyami dlya naibolee chastymi " kriticheskmi sostoyaniyami elektronnoj pochty ". - 306 - 16.6.1 Peresylka Pochty V Otdalennuyu Sistemu CHtoby otpravlyat' pochtu dlya specificheskogo host ili oblasti v oboznachennuyu otdalennuyu sistemu, Vy voobshche ispol'zuete mailertable. Naprimer, chtoby otpravit' pochtu dlya backwood.org k ih zakulisnoj sisteme GATEWAY UUCP, vy pomestili