Chapter 15
Sendmail+IDA


D.M.Z CONTENT PRE NEXT

15.1 Introduction to Sendmail+IDA
15.2 Configuration Files - Overview
15.3 The sendmail.cf File
15.4 A Tour of Sendmail+IDA Tables
15.5 Installing sendmail
15.6 Administrivia and Stupid Mail Tricks
15.7 Mixing and Matching Binary Distribution
15.8 Where to Get More Information

15.1 Introduction to sendmail+IDA

sendmail.cf ϱ Unix ý ڰ ƴ϶ ִ. װ õѴٸ ģ ̶ ִ. :-)

Sendmail ŭ α׷̴. װ κ 鿡 ־ ŭ ̱⵵ ϴ. ִ ۷(Sendmail, O'Reilly and Associates ) 792 Ǿ ٺκ ̸԰ Ѵ.

Sendmail+IDA ٸ. װ ׻ ȣȭ sendmail.cf ؾϴ ʿ伺 ϰ, ϱ tables̶ Ͽ ڰ Ʈ Ư ð 巹 ְ Ѵ. sendmail+IDA ٲٴ ۾ ð Ʈ ٿ ̴.

ٸ Ʈ sendmail+IDA غ , ̺ ܼ ̴. UUCP ͳ Ʈ ϸ鼭 ʿ ͵ ̷. ص ϱ⵵ .

sendmail5.67b+IDA1.5 vixen.cso.uiuc.edu anonymous FTP ִ. ġ ʿ ϵȴ.

Sendmail+IDA ҽ , νϰ ϴµ ʿ newspak-2.2.tar.gz ԵǾ ִ. ̴ sunsite.unc.edu /pub/Linux/system/Mail 丮 anonymous FTP ִ.


15.2 Configuration Files - Overview

sendmail ý ( /etc/sendmail.cf Ǵ /usr/lib/sendmail.cf ¾Ǵµ,  ͵ ̴. sendmail.cf Ͽ ϴ´ ϰ 뽺 ̴.

Sendmail+IDA ɼǵ ټ ̺ ְ ν ׷ . ɼǵ m4(ũ μ) Ǵ dbm(ͺ̽ μ), ҽ Ǵ Makefile  Ͽ ν ȴ.

sendmail.cf ý Ʈ ۸ Ѵ. Ŀ͸¡ sendmail.cf ϴ  ɼ ̺ ̷. ׸ 15.1 sendmail ̺ ش.

mailertable Ʈ ȣƮ ο Ư Ѵ.
uucpxtable UUCP delivery DNS ȣƮ Ѵ
pathtable UUCP bang path Ʈ ȣƮ Ѵ.
uucprelays н ٸ, path ˷ Ʈ ȣƮ鸸 Ἥ ª .
genericfrom internal address ܺο ִ generic address ȯѴ.
xaliases generic address internal address ȯϰų Ǵ ݴ Ѵ.
decnetxtable RFC 822 ּҸ DECnet Ÿ ּҷ ȯѴ.

׸ 15.1: sendmail


15.3 The Sendmail.cf File

Sendmil+IDA sendmail.cf ʰ, ý ڿ Ǵ m4 Ͽ ȴ. װ sendmail.m4 Īϱ Ѵ.

ణ Ǹ ϰų, ܼ Ǵ ̺ ġ Ų. , ׵鸸 ָȴ.

  • ýۿ Ǵ нӰ ϳ

  • e-mail ϴ, Ʈ

  •  Ʈ Ϸ(Ǵ Ʈ ȣƮ) ʿϴ.

Ʈ Ȯϰų compile-in ̵ϱ ִ ĶͰ Ѵ. ɼǵ ҽ 丮 ida/cf/OPTIONS ִ.

ּ ( ƴ Ʈ ȣƮ ̵Ǵ UUCP SMTP) sendmail.m4 ּ 10 15ۿ ȵȴ.

15.3.1 An Example sendmail.m4 File

Virtual Brewery vstout sendmail.m4 Ʒ ִ. vstout Brewery LAN ȣƮ SMTP Ͽ ϰ, UUCP ȣƮ moria .

15.3.2 Typically Used sendmail.m4 Parameters

sendmail.m4 ʿ ణ ̰, ͵ Ʈ ֹ õǴ ͵̴. sendmail.m4 Ͽ ִ ۿ ؼ, ڼ ٷ.

Items that Define Paths

     dnl #define(LIBDIR,/usr/local/lib/mail)dnl  # where all support files go

LIBDIR sendmail+IDA , dbm ̺ Ư ǻ ã 丮 Ѵ. ̳ʸ ǿ, ̴ sendmail̳ʸ compile-inǾ Ƿ sendmail.m4 Ͽ ʿ .

տ dul ٴµ, ̴ ٺ ּ ǹѴ.

ġ ٸ ϱؼ, ξտ dnl ϰ ϴ ġ н , sendmail.cf ٽ buildϰ 缳ġϸ ȴ.

     dnl #------------------ SAMPLE SENDMAIL.M4 FILE ------------------
     dnl # (the string 'dnl' is the m4 squivalent 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
     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 -----
׸ 15.2: vstout sendmail.m4

Defining the Local Mailer

     #define(LOCAL_MAILER_DEF, mailers.linux)dnl # mailer for local delivery

κ ü local delivery ڵϱ α׷ ϴµ, Unix α׷ ̹ sendmail ̳ʸ Ǿ ִ.

, ν ǿ local delivery α׷ ִ° ƴϱ mailer ʿ䰡 ִ. ̴ sendmail.m4 ϳ LOCAL_MAILER_DEF Ͽ ִ.

, Ϲ ̴ deliver α׷ 񽺸 ϰ Ϸ, LOCAL_MAILER_DER mailers.linux ָ ȴ.

LIBDIR Ű 丮 mailers.linux ̸ ġǾ Ѵ. װ sendmail ý Ÿ ùٸ ְ ϴ paramater Բ, internal Mlocal mailer deliver α׷ Ѵ. sendmail õ ʾҴٸ, ü ʿ並 ̴.

     # -- /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

sendmail.cf Ͽ includeǴ Sendmail.mc deliver bulit-in Ʈ Ѵ. װ ϱ , mailers.linux ʰ, sendmail.m4 Ͽ ִ.

     dnl --- (in sendmail.m4) ---
     define(LOCAL_MAILER_DEF, DELIVER)dnl       # mailer for local delivery

ϰԵ, Sendmail.mc deliver /bin ġǾ ִٰ ϴµ, Slackware1.1.1 ׷ ʴ(/usr/bin ġǾ ִ). ׷ ũ Ͽ ̰ų, deliver ҽ rebuildϿ /bin ֵ簡 ؾ ȴ.

Dealing with Bounced Mail

     define(POSTMASTERBOUNCE)dnl                # postmaster gets bounces

Ʈ ־, 100% ۼ ȴٰ Ȯϴ ߿ ̴. ڴ ޵ Ǽ, Ǵ ý ϳ ϱ bounce ϴµ, syslog(8) α׸ ϴ ͵ ȴ.

POSTMASTERBOUNCE ϰ Ǹ, bounce ޽ 纻 ýۿ Postmaster ǵ .

ϰԵ, Ķ͸ ϰ Ǹ bounce ޽ ؽƮ Postmaster Ǿ ýۿ ϴ ̹ø ħϰԵǴ ʷѴ.

postmaster ڽſ ƴϸ ʵ ڱ θ ƷýѾѴ. (Ǵ bounce ޽ ؽƮ κ ũƮ ׷ ִ.)

Domain Name Service Related Items

     define(PSEUDODOMAINS, BITNET UUCP)dnl      # don't try DNS on these

DNS յ , ּҳ ޵Ǵ  ˷ Ʈ ִ. PSEUDODOMAINS ϸ, ϱ⸸ ϴ DNS ˻õ ʵ Ѵ.

Defining Names the Local SYstem is Known by

     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

, ý ڽ ¥ identity ų, Ʈ̷ ϰų, Ǵ ׵ ˷ '' ̸ ϰ ó 찡 ִ.

PSEUDONYMS ý ޾Ƶ ȣƮ Ʈ Ѵ.

DEFAULT_HOST ȣƮ ߻ ޽ ȣƮ Ѵ. Ķ͸ , ϵǴ ޵ ʱ ߿ ̴.

UUCP-Related Items

     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

, ý DNS ϳ Ӱ UUCP Ǵٸ ˷µ, UUCPNAME outgoing UUCP ٸ ȣƮ ְ Ѵ.

UUCPNODES UUCP Ŀؼ ý۵ ȣƮ Ʈ ϴ Ŀǵ带 Ѵ.

BANGIMPLIESUUCP BANGONLYUUCP UUCP 'bang' systax ǥ ּҰ ó ͳ 󿡼 Ǵ, ο Domain Name Service ۹ , UUCP ۹Ŀ ٰ ϴ Ѵ.

Relay Systems and Mailers

     define(RELAY_HOST, moria)dnl               # our smart relay host
     define(RELAY_MAILER, UUCP-A)dnl            # we reach moria via UUCP

ý ڵ ׵ ý world-wide Ը Ʈ Ʈ(׸ ý) reachable ϴµ ʿ Ϸ ð ϰ ̴. ׸Ͽ, ׵ outgoing , "smart"ϴٰ ˷ ٸ ý relay Ѵ.

RELAY_HOST ׷ ̿ Ʈ ý UUCP ȣƮ Ѵ.

RELAY_MAILER ޽ relayϴµ Ǵ Ϸ Ѵ.

Ķ͵ ϴ outgoing Ǵ ý ε忡 ִ ʷѴٴ Ϳ ؾѴٴ ߿ϴ. ý ٸ ý Ϲ ȣƮ ϱ⿡ ռ, Ʈ Postmaster ιޱ⸦ ٶ.

The Various Configuration Tables

     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(UUCPTABLE, LIBDIR/uucpxtable)dnl    # paths to hosts we feed
     define(UUCPRELAYS, LIBDIR/uucprelays)dnl   # short-circuit paths

ũε, ý sendmail+IDA "" ϴ dbm ã ġ ִ. Ϲ , װ LIBDIR ׷ ܵδ ϴ.

The Master Sendmail.mc File

     include(Sendmail.mc)dnl                    # REQUIRD ENTRY !!!

Sendmail+IDA ڵ sendmail.cf Ǵ ¥ "˸" ϴ Sendmail.mc ̶ Ѵ. ֱ, full ҽ sendmail ʰ bug fix Ǵ ߰ ȴ.

ʴ´ٴ ߿ϴ

So Which Entries are Really Required?

ɼǰ dbm Ϻ  ͵ , sendmail+IDA sendmail.cf ϴµ ϴ sendmail.m4 Ͽ ǵ DEFAULT_MAILER(RELAY_HOST, RELAY_MAILER ϴ) Ѵ. domaintable̳ uucpxtable Ʈ ̷ override ִ.

ͳ 󿡼 Domain Name Service ϴ Ϲ Ʈ, Ǵ UUCP Ͽ Ʈ RELAY_HOST UUCP ϴ Ʈ, Ƹ Ư ̺ Ʈ ʿ ̴.

̷ ý canonical Ʈ Ӱ ٸ ϴ DEFAULT_HOST PSEUDONYMS ũθ Ѵ. ׷ ִ ȣƮ Ϸ ̶, װ͵ ˾Ƽ ϹǷ ̷ Ʈ ʾƵ ȴ.

Ƹ UUCP ȣƮ UUCPNAME ׵ UUCP ̴. ̸ Ʈ ȣƮ ϰϴ RELAY_MAILER RELAY_HOST ó Ѵ. Ǵ transport RELAY_MAILER ǵǸ UUCP Ʈ UUCP-A .

Ʈ SMTP Ͽ 'Domain Name Service' ̿Ѵٰ , DEFAULT_MAILER TCP-A ġ, RELAY_MAILER RELAY_HOST ϸ ȴ.


15.4 A Tour of Sendmail+IDA Tables

sendmail+IDA sendmail Ʈ (sendmail.m4Ͽ ǵ) overrideϰ Ư Ȳ, Ʈ ý, ׸ Ʈ Ư ϵ ϴ  ̺ Ѵ. ̵ ̺ ǰ Բ Ǵ Makefile ̿Ͽ ó(post-process)ȴ.

κ Ʈ ̵ ̺ ʿġ ʴ. Ʈ ̺ ʴ´ٸ, Makefile ü Ʈϴ ͺ, LIBDIR Ʈ Makefile ״ ϰ, ̺ zero length (touch Ŀǵ带 Ͽ) δ ̴.

15.4.1 mailertable

mailertable, Ʈ ȣƮ Ʈ ӿ Ͽ ƯȣƮ ο Ư ޹ Ѵ. װ ͳ Ʈ, Ʈ Ʈ ٴٸ ְ ߰ ִ ȣƮ Ʈ̸ , Ư (UUCP SMTP) ϴµ ȴ. Ϲ UUCP Ʈ ʿ䰡 .

߿ ̴. sendmail Ʒ а ޽ ġϴ ù° 꿡 װ óѴ. ׷Ƿ ֻܿ ġŰ, Ϲ Ʒ ϴ.

Groucho Marx University Computer Science ȣƮ ada UUCP ϱ Ѵٰ غ. ׷ Ϸ mailertable Ʈ .

     # (in mailertable)
     #
     # forward all mail for the domain .cs.groucho.edu via UUCP to ada
     UUCP-A,ada          .cs.groucho.edu

ū groucho.edu ȣƮ bighub , ű⼭ address resolution delivery ϱ Ѵٰ . Ȯ mailertable Ʈ ϴ.

     # (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

Ѵ, ߿ϴ. ڹٲٸ, .cs.groucho.edu ϴ ada , Ϲ bighub θ ϰ Ǿ.

     # (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
     UUCP-A,ada          .cs.groucho.edu
     #

mailertable , UUCP-A sendmail ȭ Բ UUCP delivery ϰ .

Ϸ Ʈ ý۰ ǥ address resolution delivery ޽ ada ϰ ˸ Ѵ.

mailertable Ʈ ̷.

    mailer delimiter relayhost host_or_domain

ִ  Ϸ ϴµ, װ͵ ּҸ  ٷ ̴. Ǵ Ϸδ, TCP-A(ͳ Ÿ ּҷ TCP/IP), TCP-U(UUCP Ÿ ּҷ TCP/IP), ׸ UUCP-A(ͳ Ÿ ּҷ UUCP) ִ.

mailertable ʿ Ϸ ȣƮ ϴ ij(delimiter) ּҰ mailertable  Ǵ ϴ Ѵ. ߿ , ̰ (Ʈ ý ) envelope rewriteϱ⸸ Ѵٴ ϴ ̴. envelope ͵ rewriteϴ ߸ ɼ ϴ.

! ǥ Ϸ ϱ ȣƮ Ѵ. ̴ ߸Ǿ ִ Ʈ Ʈ ִµ ִ.
, ǥ ּҿ ʴ´. ޽ ܼ Ϸ Ͽ ȣƮ .
: ݷ Ű ߰ ϴ ȣƮ 쿡 ȣƮ . ׸Ͽ foo!bar!joe foo ŵ ̰ xyzzy:janet ȭ ̴.

15.4.1 uucpxtable

, FQDN ȣƮ Domain Name Service (DNS) ͳ Ÿ(SMTP) delivery, Ǵ ȣƮ ޵ȴ. uucpxtable ȭ UUCP Ÿ ȭ Ʈ ȣƮ ȯϿ UUCP Ͽ ϵ Ѵ.

װ Ʈ ο (forwarder)̰ų, hop ִ Ʈ Ϸ ߰ ý۰ Ʈ ϴ ͺ ̰ ŷڼִ UUCP ũ ȴ.

ȭ(domainized) ϴ ̿ UUCP ϴ UUCP Ʈ, RELAY_MAILER RELAY_HOST , Ǵ DEFAULT_MAILER ϴ Ʈ ϴ , ý۰ direct UUCP point-to-point ũ Ͽ ϵ ϴµ, Ѵ.

UUCP ʴ ͳ Ʈ uucpxtable ʿ䰡 .

DNS sesame.com, UUCP ʿ sesame ýۿ 񽺸 Ѵٰ غ. , ȣƮ ̷Ʈ UUCP Ŀؼ Բ ϱ ؼ uucpxtable Ʈ ʿ ϰ ̴.

     #============== /usr/local/lib/mail/uucpxtable =============
     # Mail sent to joe@sesame.com is rewritten to sesame!joe and
     # therefore delivered via UUCP
     #
     sesame    sesame.com
     #
     #-----------------------------------------------------------

15.4.3 pathtable

pathtable Ʈ ȣƮ̳ Ʈ ϴµ ȴ. pathtable нٸ Ÿ ý , ꐼ ĵǾ ־ Ѵ. ʵ TAB ϸ, ׷ dbm ϴ Ҹ ̴.

κ ýۿ  pathtable Ʈ ʿ ʴ´.

     #=============== /usr/local/lib/mail/pathtable ================
     #
     # this is a pathalias-style paths file to let you kick mail to
     # UUCP neighbors to hte 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
     #
     # 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 repectively
     #
     %s@uugate.groucho.edu      .UUCP
     byte!%s@mail.shift.com     .BITNET
     #
     #=================== end of pathtable =======================

15.4.4 domaintable

domaintable Ϲ DNS ˻ Ͼ , Ư ϴµ ȴ. װ ڵ shorthand üν, ޵Ǵ ý̳ ο shorthand ڰ ְ 鵵 Ѵ. װ ùٸ ȣƮ "ùٸ" üϴµ ִ.

κ Ʈ domaintable Ʈ ʿġ ̴.

ùٸ ּҸ,  ùٸ ּҷ üϴ ش.

     #============= /usr/local/lib/mail/domaintable =================
     #
     #
     brokenhost.correct.domain         brokenhost.wrong.domain
     #
     #
     #=================== end of domaintable ========================

15.4.5 aliases

ٸ ؼ ִ  ִ.

  • װ shorthand Ǵ ˱ ̸ Ǵ ̻ ְ Ѵ.

  • װ ޽ α׷ Է Ἥ α׷ ȣѴ.

  • װ Ϸ .

ý RFC Postmaster MAILER-DAEMON ٸ Ѵ.

α׷ ȣϰų α׷ ٸ , sendmail root setuidǾ ȿ ص ؾ Ѵ.

aliases ȭ Ŀǵ带 ϱ ġ ʴ´.

     # /usr/lib/sendmail -bi

̴ ʿ dbm ̺ buildѴ. cron Ǵ newaliases Ŀǵ带 ִ.

ٸ aliases(5) Ŵ ִ.

     #--------------------- /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:     /val/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
     #
     #--------------------------------------------------------------------

15.4.6 Rarely Used Tables

̺ 밡ϳ, ʴ ͵̴. λ ؼ sendmail+IDA ҽ ִ ϶.

uucprelays uucprelays, pathalias UUCP map óϴµ Ǵ multiple hop(İ ȣƮ -) Ǵ ŷڼ θ ʰ, Ư ˷ Ʈ UUCP н "short-circuit"ϴµ ȴ.
genericfrom xaliases
genericfrom , ڵ Ӱ ġ ʴ Ϲ ۽ ּҷ ȯϹǷν ܺμ迡 Ӱ ּҸ Ѵ.

õ xalparse ƿƼ genericfrom xaliases ڵȭϹǷ, incomingoutgoing Ʈ xaliases Ͽ Ͼ.

decnetxtable decnetxtable domaintable ȭ ּҸ ȭ SMTP Ÿ ּҷ rewriteϴ Ͱ ϰ, ȭ ּҸ decnet Ÿ ּҷ rewriteѴ.


15.5 Installing sendmail

 sendmail+IDA ̳ʸ ġϴ 캸, װ ÿ ϰ ùٸ ϰ µ ʿ Ѵ.

sendmail+IDA ̳ʸ sunsite.unc.edu /pub/Linux/system/Mail ִ. ̹ sendmail ִ ϴ, sendmail5.76b+IDA1.5 ٲٱ⸦ ϰ ǰѴ. ֳϸ ʿ Ư ġ vanilla ҽ , 1993 12 1 ־ Ƶξ ̴.

ҽ sendmail buildϰ Ѵٸ, ҽ ǿ Ե README ÿ Ѵ. sendmail+IDA ҽ vixen.cso.uiuc.edu ִ. sendmail+IDA buildϰ Ѵٸ, newspak-2.2.tar.gz Ư ϵ ʿѵ, װ sunsite.unc.edu /pub/Linux/system/Mail 丮 ִ.

smail̳ mail delivery agent ġ Ҵٸ, smail (Ǵ rename) ָ ȴ.

15.5.1 Extracting the binary distribution

ҿ Ǭ.

     $ gunzip -c sendmail5.65b+IDA1.5+mailx5.3b.tgz | tar xvf -

ֱ ǿ ִ "modern" tar ִٸ, tar -zxvf filename.tgz ־ ִ.

Ǯ sendmail5.65b+IDA1.5+mailx5.3b 丮 ȴ. 丮 sendmail+IDA ġǰ mailx Ʈ ִ. 丮 н ġǴ ġ ݿǹǷ, װ͵ űµ tar Ŀǵ带 ϴ.

     # cd sendmail5.65b+IDA1.5+mailx5.3b
     # tar cf - . | (cd /; tar xvvpoof -)

15.5.2 Building sendmail.cf

Ʈ ˸°Բ sendmail.cf buildϷ, sendmail.m4 ۼϿ װ m4 óؾѴ. /usr/local/lib/mail/CF sendmail.m4 ִ. װ yourhostname.m4 ϰ, Ʈ ˸°Բ ϶.

ǿ ؾ ũο Ѵ. װ  ϴ ϰ ˰ ʹٸ, sendmail.m4 ߴ κ ϶.

LOCAL_MAILER_DEF
local mail delivery Ϸ Ѵ. ̰ "Defining the Local Mailer" κ ϶.
PSEUDONYMS
ȣƮ Ѵ
DEFAULT_HOST
FQDN ִ´. outgoingϿ ȣƮ ̴.
UUCPNAME
ȣƮ ִ´.
RELAY_HOST RELAY_MAILER
Ʈ ȣƮ UUCP Ѵٸ, RELAY_HOST 'smart relay' neighbor UUCP UUCP Ѵ. ȭ Ѵٸ UUCP-A Ϸ ϶.
DEFAULT_MAILER
ͳ 󿡼 DNS Ѵٸ, ̸ TCP-A ϶. ̴ sendmail TCP-A Ϸ ϶ ϴµ, Ϸ envelope Ϲ RFC Ÿ 巹 ϴ SMTP ϴ ̴. ͳ Ʈ ̸ RELAY_HOST RELAY_MAILER ʿ䰡 ̴.

sendmail.cf ؼ Ŀǵ带 ϶.

     # make yourhostname.cf

̴ yourhostname.m4 óϿ yourhostname.cf Ѵ.

, ϴ´ ϴ ׽Ʈؾϴµ, ̴ ǿ ̴.

ۿ Ѵٸ, װ ġ ϶.

     # cp yourhostname.cf /etc/sendmail.cf

sendmail ۵ų غ Ǿ. startup ( /etc/rc.inet2) . μ ǰ ռ ų ִ.

     # /usr/lib/sendmail -bd -q1h


15.5.3 Testing the sendmail.cf file

sendmail ׽Ʈ ؼ -bt ÷׸ ְ ϸ ȴ. Ʈ ýۿ ġ sendmail.cf ̳, -Cfilename ɼ ٸ ׽Ʈ ִ.

, ׸ 15.2 vstout.m4 vstout.cf ׽ƮѴ.

     # /usr/lib/sendmail -bt -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [Note: No initial ruleset 3 call]
     >
׽Ʈ sendmail ý 鿡 Ѵ. 쿡, ׽Ʈ ϰ, LOCAL Ϸ ϴ ý ų ̴.

ù°, Ǵ ׽ƮѴ.

     # /usr/lib/sendmail -bd -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [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
     rewrite: ruleset  0 returns: $# LOCAL $@ vstout . vbrew . com $: me

sendmail  ּҸ óϴ ش. ruleset ּҸ Ѱָ װ ٸ ruleset ʷ ȣϿ мϰ, Ʈ ߰ .

me ּҸ ruleset 3 0 Ѱ ־. (̴ ּ 3,0 ǹ̴). ޽ ϴ Ϸ, Ϸ ȣƮ Ե ּҸ ruleset 0 ش.

, UUCP syntax , ý ׽Ʈ غ.

     # /usr/lib/sendmail -bt -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [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
     >

, FQDN ȣƮ Ͽ ͳ ּҷ , ý ׽Ʈغ.

     # /usr/lib/sendmail -bt -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [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
	 >

sendmail.m4 PSEUDONYMS DEFAULT_NAME ĶͿ ӿ Ͽ ׽Ʈ ݺؾ Ѵ.

, ȣƮ ִ ׽Ʈ غ.

     # /usr/lib/sendmail -bt -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [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 returns: < @ moria . com > , fred
     rewrite: ruleset  0 returns: $# UUCP-A $@ moria $: < @ moria . com > , fred
     >

15.5.4 Putting it all together - Integration Testing sendmail.cf and the tables

, ϴ Ʈ ϰ, ּȭ ۼ ִٴ ȮϿ. ġ Ϸϱؼ, ϴ dbm ̺ ؾ ʿ䰡 ִ.

Ʈ ʿ ̺ , ̺ ִ 𷺷θ make ԷϿ dbm װ óϰ ־Ѵ.

UUCP Ѵٸ, README.linux ϴ  ̺ ʿ䰡 , Makefile ϰԲ ϵ touchֱ⸸ ϸȴ.

UUCP ϸ鼭 Ʈ ȣƮ ȣƮ Ѵٸ, uucpxtable Ʈ ߰ ־ ϰ(׷ ׵ Ʈ ȣƮ ȴ), uucpxtable dbm Ѵ.

, RELAY_HOST ϴ RELAY_MAILER Ἥ ȮؾѴ.

     # /usr/lib/sendmail -bt -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [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
     >

RELAY_HOST ƴ, UUCP neighbor ִٸ, ׵ ϴ Ȯ ʿ䰡 ִ. UUCP ϴ ȣƮ UUCP-style syntax ּҰ ݵ ׵鿡Է ̴ (׷ʴٸ domaintable Ʈ ν װ ؾ Ѵ). swim Ǵ neighbor UUCP غ. ׷ swim!fred sendmail ָ ̴.

     # /usr/lib/sendmail -bt -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [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
     >

ͳ ŸϷ ȭ Ἥ Ư neighbor UUCP, UUCP delivery ϱ uucpxtable Ʈ ־ξٸ װ ׽Ʈ غƾ Ѵ.

     # /usr/lib/sendmail -bt -Cvstout.cf
     ADDRESS TEST MODE
     Enter <ruleset> <address>
     [Note: No initial ruleset 3 call]
     >3,0 dude@swim.2bird.com
     rewrite: ruleset  3   input: dude @ swim . 2bird . com
     [...lines omitted...]
     rewrite: ruleset  0 returns: $# UUCP $@ swim . 2birds $: < > , dude
     >


15.6 Administrivia and Stupid Mail Tricks

ݱ 츮 sendmail+IDA ý ġ, ׸ ׽Ʈ ̷ Ͽ. ð ϰ ϻ󿡼 Ͼ ϵ 鿩ٺ .

Ʈ ý . Ǵ ȭ , DNS ΰ Ǽ ùٸ ǵDZ⵵ Ѵ. ƴ϶ Ʈ ڱ ٿȴ. ̷ , ϰڴ ϸ Ʈ ý Ǵ ڰ 񽺸 , ȿ̸鼭 ϰ ٸ Ʈ 귯 ġϴ ˾ƾ ʿ䰡 ִ.

κ δĥ ִ "electronic mail emergencies" ش ϰ Ѵ.

15.6.1 Forwarding Mail to a Relay Host

Ư ȣƮ Ǵ ο õ ý ϱ ؼ, ַ mailertable Ѵ.

, backwood.org , װ UUCP Ʈ ý backdoor Ͽ Ʈ maildertable ȴ.

     UUCP-A,backdoor	backwood.org

15.6.2 Forcing Mail into Misconfigured Remote Sites

, ͳ ȣƮ ߸ Ʈ Ʈ ִ . ̷ , Ϲ Ʈ ȣƮ bounceǰų, ʴ ̴.

̷ ý ڸ ʴ 忡 ߸µ, world-wide ý ʴ´ٴ (Ǵ, ٷ Ʈ ڿ  ƴ°) Ű ʴ´ٴ ̴. ׵ ٸ ϴ ο ʴ´ٴ Ͱ, ̿ ؾߵ ̶ ̴.

Ʈ Ʈ ׵ , ƴϴ. 쿡 ־ Ʋ , ߸ Ʈ Ʈ ϱؼ Ʈ ߸ ϵ ؼ ȵȴٴ ̴. Ʈ Ʈ Postmaster ϳ ׵ ٷ ٸ, ΰ ִ.

  • Ʈ ý () Ǿ ִ ϴ, Ʈ ýۿ ִ ϴ. Ʈ ʰ װ Ʈ ̴.

    outgoing ޽ envlope bad header ٷµ ׵ ȣƮ/ο domaintable Ʈ Ͽ, Ʈ ġ ٷ ϸȴ.

         braindead.correct.domain.com	braindead.wrong.domain.com
    
    

  • , Ʈ ý bounceϿ " Ʈ ƴϴ" ϴµ, ̰ ׵ ϳ PSEUDONYMS ׿ ͵ ʱ ̴. Ʈ ׵ ޽ envelope ȣƮӰ ϴ ϴ.

    mailertable ! Ʈ Ʈ ׵ ýۿ û ó ̰ ν Ʈ Ʈ Ѵ. , ̰ envelope ּҸ ϹǷ, ޽ return ּҰ ִٴ ̴.

         TCP!braindead.correct.domain.com	braindead.wrong.domain.com
    
    
׵ ýۿ , ׵ ޽ ٴ ٴ ǿ(׵ ý ư ִ. ϶...) ġ ٶ. ̷ԵǸ ſ ̰, װ͵ ׵ ý۰ڿ ̴.

15.6.3 Forcing Mail to Transferred via UUCP

̻ 迡 (ͳ ), ȣƮ Domain Name Service (DNS) ڵ带 ְ FQDN Ͽ ̴.

׷ Ʈ UUCP ؾ ִٸ, uucpxtable ȣƮ "undomainizing" ν, Ʈ Ϸ ƴ point-to-point UUCP Ŀؼ ִ.

sesame.com UUCP delivery ϰ Ѵٸ, uucpxtable ȴ.

     # un-domainize sesame.com to force UUCP delivery
     sesame	sesame.com

, sendmail (sendmail.m4 UUCPNODES ) Ʈ ýۿ Ǿٰ ϰ, UUCP ޵ queue ̴.

Preventing Mail from Being Delivered via UUCP

ݴ 쵵 ִ. ̵ݾ, ʰų ŷڼ Ʈ Ϸ ȣƮ ͵ UUCP Ŀؼ ִ.

, þƲ anonymous UUCP ȯϴ ý۵ Ѵٰ . ̵ ý ʿ UUCP ϹǷ, ŷڵ hop(mail ִ ȣƮ - ) (׸ 밡) ȣƮ Ϲ ŷڵ .

ȣƮ UUCP deliveryʰ . Ʈ Ʈ FQDN ִٸ, domainxtable Ʈ ϳ ߰ϸ ȴ.

     # prevent mail delivery via UUCP to a neighbor
     snorkel.com	snorkel

̴ UUCP FQDN üν, sendmail.m4 ϳ UUCPNODESΰ ġǴ ´. , RELAY_MAILER RELAY_HOSTDEFAULT_MAILER) Ͽ ȴ.

15.6.5 Running the Sendmail Queue on Demand

queue ޽ óϱ ؼ, ܼ '/usr/lib/runq' ġ ȴ. ̴ ɼ ְ sendmail ȯν, sendmail ٵ ٸ , job queue Ⱦ Ѵ.

15.6.6 Reporting Mail Statistics

Ʈ ڵ (׸ ׵ ) Ʈ, Ʈ, Ǵ Ʈ ϴ 翡 ̴. Ʈ ϴµ  ִ.

  • sendmail mailstats ƿƼ µ, ̴ /usr/local/lib/mail/sendmail.st о ޽ , sendmail.cf ϳ Ϸ ۵ Ʈ ش. sendmail.st sendmail ̰Ϳ α׸ ⵵ ڰ ־Ѵ. Ѱ sendmail.st ų ν ŵȴ. Ѱ .

         # cp /dev/null /usr/lib/local/mail/sendmail.st
    	
    

  • ϰ 󸶸ŭ ýۿ// ϴ ϱ syslogd(8) Ἥ Ѵ ̴. Ϲ, ̴ /etc/syslogd ŸƮ Ͽ (·簣 ̷ ϰ), /etc/syslog.conf ߰ ǹѴ.

         mail.debug				/var/log/syslog.mail
    
    

    mail.debug ϴ ߿ ޴´ٸ syslog ¹  Ŀ ̴. syslogd Ϲ crond(8)ƾ Ͽ ȯǰų ûҵ ʿ䰡 ִ.

    Ϲ 밡, syslogd ¹ ƿƼ  Ѵ. ˷ ƿƼ ϳ syslog-stat.pl, sendmail+IDA ҽ Բ Ǵ perl ũƮ̴.


15.7 Mixing and Matching Binary Distributions

ڸ transport agent delivery agent ǥ̶ , "¥ 丮 " ͵ .

, ý (USENET , , TCP/IP) delivery α׷ (rmail), ׸ α׷(sendmail Ǵ smail) ġ ϴ Ȯ ʿ䰡 ִ. strings Ŀǵ带 Ͽ,  ϰ 丮 ϰ ִ ұϰ, ׷ Ϲ ȭ Ǿ ʴ. 츮 Ϲ ִ ̳ʸ ǰ ҽ ߿ ̴.

  • TCP/IP NET-2 sendmail ƴ umail̶ α׷ ǵ 񽺸 ϰ ִ.

  • elm mailx Ƽǵ sendmail /usr/bin/smail delivery agent ã´.

  • sendmail+IDA Ϸ deliver ϰ Ǿ , /usr/bin ƴ /bin ġ ϰ ִ.

Ŭ̾Ʈ ҽ buildϸ鼭 ϴ , Ϲ Ʈũ ɾ װ ̰ Ѵ.


15.8 Where to Get More Information

sendmail ã ִ ó ηִ. Ѵٸ, comp.answers Ǵ Linux MAIL Howto . װ rtfm.mit.edu anonymous FTPε ִ. ׷ Ҵ sendmail+IDA ҽ̴. ҽ 丮 ida/cfDBM-GUIDE, OPTIONS, ׸ Sendmail.mc ̴.

Other Chapters

1. Introduction to Networking
2. Issues of TCP/IP Networking
3. Configuring the Networking Hardware
4. Setting up the Serial Hardware
5. Configuring TCP/IP Networking
6. Name Service and Resolver Configuration
7. Serial Line IP
8. The Point-to-Point Protocol
9. Various Network Applications
10. The Network Information System
11. The Network File System
12. Managing Taylor UUCP
13. Electronic Mail
14. Getting smail Up and Running
15. Sendmail+IDA
16. Netnews
17. C News
18. A Description of NNTP
19. Newsreader Configuration

Appendix

A. A Null Printer Cable for PLIP
B. Sample smail Configuration Files
C. The GNU General Public License