home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Unix / HOWTOs / MAIL-HOW < prev    next >
Text File  |  1999-11-04  |  72KB  |  2,443 lines

  1.   The Linux Electronic Mail HOWTO
  2.   Guylhem Aznar <guylhem at oeil.qc.ca>
  3.   v2.0, January 1998
  4.  
  5.   This document describes the setup, care and feeding of Electronic Mail
  6.   (e-mail) under Linux.  You need to read this if you plan to communi¡
  7.   cate locally or to remote sites via electronic mail.  You probably do
  8.   *not* need to read this document if don't exchange electronic mail
  9.   with other users on your system or with other sites.
  10.   ______________________________________________________________________
  11.  
  12.   Table of Contents
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.   1. Introduction, copyright and standard disclaimer
  68.  
  69.      1.1 Email and spamming
  70.      1.2 Goals
  71.      1.3 New versions
  72.      1.4 Feedback
  73.      1.5 Copyright
  74.      1.6 Limited warranty
  75.  
  76.   2. Other sources of information
  77.  
  78.      2.1 USENET
  79.      2.2 Mailing Lists
  80.      2.3 Other documents from LDP
  81.      2.4 Books
  82.  
  83.   3. Requirements
  84.  
  85.      3.1 Hardware
  86.      3.2 Software
  87.  
  88.   4. Qmail v1.03
  89.  
  90.      4.1 Getting qmail
  91.      4.2 Uncompressing sources
  92.      4.3 Preparing compilation
  93.      4.4 Configuring qmail
  94.         4.4.1 defaultdomain, me, plusdomain
  95.         4.4.2 locals, rcpthosts
  96.         4.4.3 virtualdomains
  97.      4.5 Testing qmail
  98.      4.6 Removing your other MTA
  99.      4.7 That's all, folks !
  100.  
  101.   5. Smail v3.1
  102.  
  103.      5.1 Configuring smail
  104.      5.2 "config" file
  105.      5.3 "directors" file
  106.      5.4 "fidopaths" file
  107.      5.5 "routers" file
  108.      5.6 "transports" file
  109.      5.7 "maps/" directory
  110.      5.8 Other good examples
  111.      5.9 Restarting inetd
  112.      5.10 Smail with smtp
  113.  
  114.   6. OUTDATED SECTION : Sendmail+IDA
  115.  
  116.      6.1 Source installation
  117.      6.2 The sendmail.m4 file
  118.      6.3 Defining a local mailer
  119.      6.4 The sendmail+IDA dbm tables
  120.      6.5 So which entries are really required?
  121.      6.6 Sendmail 8.x
  122.      6.7 A sample 8.7.x mc file
  123.      6.8 Sendmail v8 tidbits
  124.      6.9 Local Delivery Agents
  125.  
  126.   7. POP mail
  127.  
  128.      7.1 History
  129.      7.2 Getting mail
  130.      7.3 Sending mail
  131.      7.4 Reading mail
  132.      7.5 Testing
  133.      7.6 Using
  134.  
  135.   8. Mail "user agents"
  136.  
  137.      8.1 Mutt
  138.      8.2 Elm
  139.      8.3 Mailx
  140.      8.4 Other user agents
  141.  
  142.   9. Acknowledgements
  143.  
  144.  
  145.  
  146.   ______________________________________________________________________
  147.  
  148.   1.  Introduction, copyright and standard disclaimer
  149.  
  150.  
  151.  
  152.   1.1.  Email and spamming
  153.  
  154.  
  155.   First, convert all "at" in Emails address to "@".
  156.  
  157.   It's simple for humans, but not for bots searching the web to spam ;
  158.   therefore it's enough to protect generous contributors from being
  159.   spammed !
  160.  
  161.  
  162.   1.2.  Goals
  163.  
  164.  
  165.   The intent of this document is to answer some of the questions and
  166.   comments that appear to meet the definition of "frequently asked
  167.   questions" about e-mail software under Linux in general and the
  168.   version in the Linux Debian and RedHat distributions in particular.
  169.  
  170.  
  171.   1.3.  New versions
  172.  
  173.  
  174.   New versions of this document will be periodically posted to
  175.   comp.os.linux.announce, comp.answers and mail.answers.  They will also
  176.   be added to the various anonymous ftp sites who archive such
  177.   information including sunsite.unc.edu:/pub/Linux/docs/HOWTO.
  178.  
  179.   In addition, you should be generally able to find this document on the
  180.   Linux WorldWideWeb home page at http://sunsite.unc.edu/mdw/linux.html.
  181.  
  182.  
  183.   1.4.  Feedback
  184.  
  185.  
  186.   I am interested in any feedback, positive or negative, regarding the
  187.   content of this document via e-mail.  Definitely contact me if you
  188.   find errors or obvious omissions.
  189.  
  190.   I read, but do not necessarily respond to, all e-mail I receive.
  191.   Requests for enhancements will be considered and acted upon based on
  192.   that day's combination of available time, merit of the request and
  193.   daily blood pressure :-)
  194.  
  195.   Flames will quietly go to /dev/null so don't bother.
  196.  
  197.   Feedback concerning the actual format of the document should go to the
  198.   HOWTO coordinator : Greg Hankins (gregh at sunsite.unc.edu).
  199.   1.5.  Copyright
  200.  
  201.  
  202.   The Mail-HOWTO is copyrighted (c) 1998 Guylhem Aznar.  Distributed
  203.   under LDP copyright license.  If you have questions, please contact
  204.   Greg Hankins, the Linux HOWTO coordinator, at gregh at
  205.   sunsite.unc.edu.
  206.  
  207.  
  208.   1.6.  Limited warranty
  209.  
  210.  
  211.   Of course, I disavow any potential liability for the contents of this
  212.   document.  Use of the concepts, examples, and/or other content of this
  213.   document is entirely at your own risk.
  214.  
  215.  
  216.   2.  Other sources of information
  217.  
  218.  
  219.  
  220.   2.1.  USENET
  221.  
  222.  
  223.   There is nothing "special" about configuring and running mail software
  224.   under Linux (any more).  Accordingly, you almost certainly do *NOT*
  225.   want to be posting generic mail-related questions to the
  226.   comp.os.linux.*  newsgroups.
  227.  
  228.   Don't post in comp.os.linux hierarchy unless it's really linux
  229.   specific, for example : "Which options was Debian 1.2 sendmail
  230.   compiled with ?" or "RedHat 5.0 smail crashes when I run it".
  231.  
  232.   Let me repeat that.
  233.  
  234.   There is virtually no reason to post anything mail-related in the
  235.   comp.os.linux hierarchy any more.  There are existing newsgroups in
  236.   the comp.mail.* hierarchy to handle *ALL* your questions.
  237.  
  238.   IF YOU POST TO COMP.OS.LINUX.* FOR NON-LINUX-SPECIFIC QUESTIONS, YOU
  239.   ARE LOOKING IN THE WRONG PLACE FOR HELP.  THE MAIL EXPERTS HANG OUT IN
  240.   THE PLACES INDICATED ABOVE AND GENERALLY DO NOT RUN LINUX.
  241.  
  242.   POSTING TO THE LINUX HIERARCHY FOR NON-LINUX-SPECIFIC QUESTIONS WASTES
  243.   YOUR TIME AND EVERYONE ELSE'S AND IT FREQUENTLY DELAYS YOUR GETTING
  244.   THE ANSWER TO YOUR QUESTION.
  245.  
  246.   GOOD PLACES are :
  247.  
  248.              comp.mail.elm           the ELM mail system.
  249.              comp.mail.mh            The Rand Message Handling system.
  250.              comp.mail.mime          Multipurpose Internet Mail Extensions.
  251.              comp.mail.misc          General discussions about computer mail.
  252.              comp.mail.multi-media   Multimedia Mail.
  253.              comp.mail.mush          The Mail User's Shell (MUSH).
  254.              comp.mail.sendmail      the BSD sendmail agent.
  255.              comp.mail.smail         the smail mail agent.
  256.              comp.mail.uucp          Mail in the uucp environment.
  257.  
  258.  
  259.  
  260.  
  261.   2.2.  Mailing Lists
  262.  
  263.  
  264.  
  265.   There are many sendmail, smail and qmail mailing lists.
  266.  
  267.   You can find addresses in /usr/doc/the_one_you_have_chosen.
  268.  
  269.  
  270.   2.3.  Other documents from LDP
  271.  
  272.  
  273.   There is plenty of excellent material provided in the other Linux
  274.   HOWTO documents and from the Linux DOC project.
  275.  
  276.   In particular, you might want to take a look at the following:
  277.  
  278.  
  279.   ╖  on your own computer in /usr/doc/ :-)
  280.  
  281.   ╖  the Linux Networking Administrators' Guide
  282.  
  283.   ╖  the Serial Communications HOWTO
  284.  
  285.   ╖  the Ethernet HOWTO
  286.  
  287.   ╖  the UUCP HOWTO if you're fed via UUCP
  288.  
  289.  
  290.   2.4.  Books
  291.  
  292.  
  293.   The following is a non-inclusive set of books that will help:
  294.  
  295.  
  296.   ╖  "Managing UUCP and USENET" from O'Reilly and Associates is in my
  297.      opinion the best book out there for figuring out the programs and
  298.      protocols involved in being a USENET site.
  299.  
  300.   ╖  "Unix Communications" from The Waite Group contains a nice
  301.      description of all the pieces (and more) and how they fit together.
  302.  
  303.   ╖  "Sendmail" from O'Reilly and Associates looks to be the definitive
  304.      reference on sendmail-v8 and sendmail+IDA.  It's a "must have" for
  305.      anybody hoping to make sense out of sendmail without bleeding in
  306.      the process.
  307.  
  308.   ╖  "The Internet Complete Reference" from Osborne is a fine reference
  309.      book that explains the various services available on Internet and
  310.      is a great source for information on news, mail and various other
  311.      Internet resources.
  312.  
  313.   ╖  "The Linux Networking Administrators' Guide" from Olaf Kirch of the
  314.      Linux Documentation Project is available on the net and is also
  315.      published by (at least) O'Reilly and SSC.
  316.  
  317.      It makes a fine one-stop shopping to learn about everything you
  318.      ever imagined you'd need to know about Unix networking.
  319.  
  320.  
  321.  
  322.   3.  Requirements
  323.  
  324.  
  325.  
  326.   3.1.  Hardware
  327.  
  328.  
  329.   There are no specific hardware requirements for mail under Linux.
  330.  
  331.   You'll need some sort of 'transport' software to connect to remote
  332.   systems, which means either TCP/IP or uucp.
  333.  
  334.   This could mean that you need a modem or ethernet card, depending on
  335.   your setup.  In most cases, you'll want the fastest modem you can
  336.   afford, i.e. V90 57 600 bps currently.  In general, you want to have a
  337.   16550 UART on your serial board or built into your modem to handle
  338.   speeds of above 9600 baud.
  339.  
  340.   If you don't know what that last sentence means, please consult the
  341.   comp.dcom.modems group or the various fine modem and serial
  342.   communications FAQs and periodic postings on USENET.
  343.  
  344.  
  345.   3.2.  Software
  346.  
  347.  
  348.   Well, the problem is here. Which mail software will you choose ?
  349.  
  350.   There is currently qmail, smail, vmail and sendmail.
  351.  
  352.   Each has its own features, but the better compromise is qmail, for
  353.   high security (even is vmail is more secure), high speed (even is
  354.   smail is faster for local uses) and ease of configuration.
  355.  
  356.   Of course, feel free to choose any mail software, informations
  357.   provided here shall only help you in your choice.
  358.  
  359.   Sendmail can be nice for many sites with complicated options, but I
  360.   think its configuration is too hard for beginners while it is not very
  361.   secure or very fast, so there is only a really outdated sendmail
  362.   section in this HOWTO.
  363.  
  364.   If you know what you're doing, choose sendmail (and you shouldn't be
  365.   reading this HOWTO !); otherwise I generally recommand qmail.
  366.  
  367.  
  368.   4.  Qmail v1.03
  369.  
  370.  
  371.   Secured, fast and easy to use, this is my preferred MTA (mail
  372.   transport agent).
  373.  
  374.   Currently, no distribution comes with qmail, so we will focus on
  375.   compiling and installing qmail, since this is the only tricky part :
  376.   configuration is really straightforward.
  377.  
  378.  
  379.   4.1.  Getting qmail
  380.  
  381.  
  382.   Go to www.qmail.org to download latest version.
  383.  
  384.  
  385.   4.2.  Uncompressing sources
  386.  
  387.  
  388.   Then decompress it running :
  389.  
  390.  
  391.        mv qmail.tar.gz /usr/local/src
  392.        cd /usr/local/src ; tar -zxvf qmail.tar.gz
  393.  
  394.  
  395.  
  396.  
  397.   If you find a bz2 version (new and better compression format), just
  398.   replace tar by :
  399.  
  400.  
  401.        bunzip2 qmail.tar.bz2
  402.        tar -xvf qmail.tar
  403.  
  404.  
  405.  
  406.  
  407.  
  408.   4.3.  Preparing compilation
  409.  
  410.  
  411.   Now enter qmail dir to check configuration defaults :
  412.  
  413.  
  414.        cd qmail; more conf-*
  415.  
  416.  
  417.  
  418.  
  419.   You shouldn't need to change any default, but you can for exemple
  420.   specificy an alternate installation dir or better compilation flags.
  421.  
  422.   Now run :
  423.  
  424.  
  425.        mkdir /var/qmail
  426.  
  427.  
  428.  
  429.  
  430.   to create target dir.
  431.  
  432.   If you haven't installed a Debian distribution, you'll need to add
  433.   qmail own users : qmail's high security depends on that.
  434.  
  435.   Nobody will be able to break your whole mail system or gain root
  436.   access since qmail is divided into modules running each under their
  437.   own UID.
  438.  
  439.   So run :
  440.  
  441.  
  442.           # groupadd nofiles
  443.           # useradd -g nofiles -d /var/qmail/alias alias
  444.           # useradd -g nofiles -d /var/qmail qmaild
  445.           # useradd -g nofiles -d /var/qmail qmaill
  446.           # useradd -g nofiles -d /var/qmail qmailp
  447.           # groupadd qmail
  448.           # useradd -g qmail -d /var/qmail qmailq
  449.           # useradd -g qmail -d /var/qmail qmailr
  450.           # useradd -g qmail -d /var/qmail qmails
  451.  
  452.  
  453.  
  454.  
  455.   or hand-edit /etc/passwd and /etc/group to add these users by yourself
  456.   : for example you can respectively add :
  457.  
  458.  
  459.  
  460.                qmail:*:2107:
  461.                nofiles:*:2108:
  462.  
  463.   &
  464.  
  465.  
  466.  
  467.                alias:*:7790:2108::/var/qmail/alias:/bin/true
  468.                qmaild:*:7791:2108::/var/qmail:/bin/true
  469.                qmaill:*:7792:2108::/var/qmail:/bin/true
  470.                qmailp:*:7793:2108::/var/qmail:/bin/true
  471.                qmailq:*:7794:2107::/var/qmail:/bin/true
  472.                qmailr:*:7795:2107::/var/qmail:/bin/true
  473.                qmails:*:7796:2107::/var/qmail:/bin/true
  474.  
  475.  
  476.  
  477.  
  478.  
  479.   Now you can run
  480.  
  481.  
  482.        make setup check
  483.  
  484.  
  485.  
  486.  
  487.   to check your configuration, then :
  488.  
  489.  
  490.        ./config
  491.  
  492.  
  493.  
  494.  
  495.   to configure qmail.
  496.  
  497.   Now you must install some aliases, since /etc/alias is not used by
  498.   qmail unless you compile and install some optional package.
  499.  
  500.   Here's my setup :
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.   File : ".qmail-MAILER-DAEMON"
  530.   &postmaster
  531.   File : ".qmail-bin"
  532.   &root
  533.   File : ".qmail-daemon"
  534.   &root
  535.   File : ".qmail-decode"
  536.   &root
  537.   File : ".qmail-dumper"
  538.   &root
  539.   File : ".qmail-games"
  540.   &root
  541.   File : ".qmail-ingres"
  542.   &root
  543.   File : ".qmail-mailer-daemon"
  544.   &postmaster
  545.   File : ".qmail-manager"
  546.   &root
  547.   File : ".qmail-news"
  548.   &root
  549.   File : ".qmail-nobody"
  550.   &root
  551.   File : ".qmail-operator"
  552.   &root
  553.   File : ".qmail-postmaster"
  554.   &root
  555.   File : ".qmail-root"
  556.   &guylhem
  557.   File : ".qmail-system"
  558.   &root
  559.   File : ".qmail-toor"
  560.   &root
  561.   File : ".qmail-uucp"
  562.   &root
  563.   File : ".qmail-uucp-default"
  564.   |preline -dr /usr/bin/uux - -r -gC -a"${SENDER:-MAILER-DAEMON}" lm!rmail "($DEFAULT@$HOST)"
  565.  
  566.  
  567.  
  568.  
  569.   You need to create each of these file in ~alias, replacing &guylhem in
  570.   .qmail-root by your own login to get root mail.
  571.  
  572.   ATTENTION UUCP USERS !
  573.  
  574.   DO NOT TRUST QMAIL FAQ FOR UUCP, USE MY .qmail-uucp-default INSTEAD !
  575.   ELSE YOU WILL NOT BE ABLE TO SEND ANY MAIL BY YOUR UUCP CONNEXION !
  576.  
  577.   Now you'll need to decide in which format your users will get their
  578.   mail.
  579.  
  580.   Here's my suggestion :
  581.  
  582.   ╖  For NFS mounted home dirs, use MAILDIR format with a patch for
  583.      local mail readers (patchs are available on www.qmail.org)
  584.  
  585.   ╖  If no patch is available, prefer MAILFILE format : any mail reader
  586.      can read a file containing mail, people will only need to create an
  587.      alias (for bash) or a setenv (for csh) for their mail reader
  588.  
  589.   ╖  Avoid /var/spool/mail/$USER format, too unsecure
  590.  
  591.   To fix default format, read each file in /var/qmail/boot then copy the
  592.   one you best like to /var/qmail/rc.
  593.  
  594.  
  595.   home or proc are safe choices, but prefer home for security reasons.
  596.  
  597.  
  598.   4.4.  Configuring qmail
  599.  
  600.  
  601.   In /var/qmail/control, edit :
  602.  
  603.  
  604.   4.4.1.  defaultdomain, me, plusdomain
  605.  
  606.  
  607.  
  608.   ╖  me is you local FQDN (full qualifyied domain name), for exemple on
  609.      my machine it is barberouge.linux.lmm.com
  610.  
  611.   ╖  defaultdomain will be added to any host name without dots,
  612.      including defaulthost, for example you can set it to localnetwork
  613.      so any mail sent to joe@hisbox will be completed to be sent to
  614.      joe@hisbox.localnetwork instead
  615.  
  616.   ╖  plusdomain is the exception : is is added to any host name that
  617.      ends with a plus sign, including defaulthost (set in me) if it ends
  618.      with a plus sign.
  619.  
  620.   These 3 examples shows you the power and ease of configuration of
  621.   qmail !
  622.  
  623.  
  624.   4.4.2.  locals, rcpthosts
  625.  
  626.  
  627.   If you want to support virtual domain names, just put additional names
  628.   in these files.
  629.  
  630.   Any mail you receive for these names will be handled locally.
  631.  
  632.   The difference between locals and rcpthosts is the latter isn't
  633.   considered as a local alias, which is usefull if you receive mail from
  634.   some free email address like yahoo.com or lemel.fr while you also send
  635.   mail to other users of these non local services, i.e. you don't want
  636.   to handle locally mail send to someone@yahoo.com !
  637.  
  638.  
  639.   4.4.3.  virtualdomains
  640.  
  641.  
  642.   There can you specify defaut outgoing mode, for example :
  643.  
  644.  
  645.        #:alias-uucp
  646.  
  647.  
  648.  
  649.  
  650.   if you don't want to send outgoing mail by uucp but by smtp (default)
  651.   or
  652.  
  653.  
  654.        :alias-ucp
  655.  
  656.  
  657.  
  658.  
  659.   if you send your outgoing mail by uucp.
  660.  
  661.   4.5.  Testing qmail
  662.  
  663.  
  664.   Now it is configured, try :
  665.  
  666.  
  667.        sh -cf '/var/qmail/rc &'
  668.  
  669.  
  670.  
  671.  
  672.   to launch qmail (it won't interfere with your local MTA), then :
  673.  
  674.  
  675.  
  676.        echo to: mylogin | /var/qmail/bin/qmail-inject
  677.  
  678.  
  679.  
  680.  
  681.   You should receive this mail in the format you've chosen in
  682.   /var/qmail/boot/.
  683.  
  684.  
  685.   4.6.  Removing your other MTA
  686.  
  687.  
  688.   If this test was successfull, just kill your previous MTA :
  689.  
  690.   killall -STOP daemon_name ; if any children are running, you should
  691.   killall -CONT their_name, wait, killall -STOP again, and repeat ad
  692.   nauseam.
  693.  
  694.   If there aren't any children, killall -TERM and then killall -CONT.
  695.  
  696.   Remove it (how you can do this depends on the distribution you
  697.   installed, for example rpm -e --nodeps on RedHat, Caldera and Suse, or
  698.   dpkg -r --force-depends on Debian) then run :
  699.  
  700.  
  701.        # ln -s /var/qmail/bin/sendmail /usr/lib/sendmail
  702.        # ln -s /var/qmail/bin/sendmail /usr/sbin/sendmail
  703.  
  704.  
  705.  
  706.  
  707.   Now set up qmail-smtpd in /etc/inetd.conf (all on one line):
  708.  
  709.  
  710.        smtp stream tcp nowait qmaild /var/qmail/bin/tcp-env tcp-env /var/qmail/bin/qmail-smtpd
  711.  
  712.  
  713.  
  714.  
  715.   If you are using a old non-SYSV-init distribution like redhat, just
  716.   add to your boot scripts :
  717.  
  718.  
  719.        sh -cf '/var/qmail/rc &'
  720.  
  721.  
  722.  
  723.  
  724.   Usually /etc/rc.local but your mileage may vary.
  725.  
  726.  
  727.   For actual SYSV-init compliant distributions (RedHat, Caldera, Suse,
  728.   Debian), add this script to /etc/init.d/ :
  729.  
  730.   DEBIAN version :
  731.  
  732.  
  733.  
  734.        #!/bin/sh
  735.  
  736.        test -x /var/qmail/rc || exit 0
  737.  
  738.        case "$1" in
  739.          start)
  740.             echo -n "Starting mta: "
  741.             sh -cf '/var/qmail/rc &'
  742.             echo "qmail."
  743.             ;;
  744.          stop)
  745.             echo -n "Stopping mta: "
  746.             killall qmail-lspawn
  747.             echo "qmail."
  748.             ;;
  749.          restart)
  750.             echo -n "Restarting mta: "
  751.             killall -HUP qmail-lspawn
  752.             killall -ALRM qmail-lspawn
  753.             echo "qmail."
  754.             ;;
  755.          *)
  756.             echo "Usage: /etc/init.d/qmail {start|stop|restart}"
  757.             exit 1
  758.        esac
  759.  
  760.        exit 0
  761.  
  762.  
  763.  
  764.  
  765.   REDHAT version :
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.   #!/bin/sh
  794.   #
  795.   # qmail      This shell script takes care of starting and stopping qmail.
  796.   #
  797.   # description: qmail is a Mail Transport Agent, which is the program \
  798.   #              that moves mail from one machine to another.
  799.   # processname: qmail
  800.   # config: /var/qmail/control/
  801.  
  802.   # Source function library.
  803.   . /etc/rc.d/init.d/functions
  804.  
  805.   # Source networking configuration.
  806.   . /etc/sysconfig/network
  807.  
  808.   export PATH=$PATH:/var/qmail/bin
  809.  
  810.   # Check that networking is up.
  811.   [ ${NETWORKING} = "no" ] && exit 0
  812.  
  813.   [ -f /usr/sbin/sendmail ] || exit 0
  814.  
  815.   # See how we were called.
  816.   case "$1" in
  817.     start)
  818.           # Start daemons.
  819.           echo -n "Starting qmail: "
  820.           qmail-start '|preline procmail' splogger qmail &
  821.           touch /var/lock/subsys/qmail
  822.           echo
  823.           ;;
  824.     stop)
  825.           # Stop daemons.
  826.           echo -n "Shutting down qmail: "
  827.           killproc qmail-lspawn
  828.           echo
  829.           rm -f /var/lock/subsys/qmail
  830.           ;;
  831.     restart)
  832.           $0 stop
  833.           $0 start
  834.           ;;
  835.     status)
  836.           status qmail
  837.           ;;
  838.     *)
  839.           echo "Usage: qmail {start|stop|restart|status}"
  840.           exit 1
  841.   esac
  842.  
  843.   exit 0
  844.  
  845.  
  846.  
  847.  
  848.   And make symlinks to each /etc/rcN.d/, for example :
  849.  
  850.  
  851.        ln -sf /etc/init.d/qmail /etc/rc1.d/K19qmail
  852.  
  853.  
  854.  
  855.  
  856.   If the first letter is K, you will kill qmail on this runlevel (1 for
  857.   single mode or 6 for boot), but if the first letter is S, you will
  858.   start qmail on this runlevel (each others runlevel).
  859.   ╖  How to decide whether you should put a K or a S ?  Do what the
  860.      majority of dµmons in this runlevel do !
  861.  
  862.   ╖  What number should you put after K or S ?  The number next to your
  863.      network daemon.
  864.  
  865.   RedHat, Caldera and Suze will use /etc/rc.d/ instead of plain /etc/
  866.   for Debian distribution, i.e. /etc/rc.d/rc1.d or /etc/rc.d/init.d for
  867.   example.
  868.  
  869.  
  870.   4.7.  That's all, folks !
  871.  
  872.  
  873.   No need to reboot (remember, you're using linux, not some other cheap
  874.   OS !) for the modifications to take effect, just run :
  875.  
  876.  
  877.  
  878.        killall inetd
  879.        init 1
  880.  
  881.  
  882.  
  883.  
  884.   To go to single user mode, then :
  885.  
  886.  
  887.        init 2
  888.  
  889.  
  890.  
  891.  
  892.   to go back to your default runlevel (indicated in /etc/inittab with
  893.   initdefault label).
  894.  
  895.   You could also hand-start qmail script but "init" method will show you
  896.   if qmail script is well positionned, i.e. lauched after network
  897.   scripts but before any program depend on email to warn you (like inn).
  898.  
  899.  
  900.   5.  Smail v3.1
  901.  
  902.  
  903.   Smail3.1 seems to be a de-facto standard transport agent for uucp-only
  904.   sites and for some smtp sites. It's easy to configure, it compiles
  905.   without patching from the sources and it's fairly secure.
  906.  
  907.  
  908.   5.1.  Configuring smail
  909.  
  910.  
  911.   Install smail binary from your distribution (I recommand you choose
  912.   this) or get smail sources and build smail. If you're building smail
  913.   from sources, you need to have the following in your os/linux file so
  914.   that 'sed' gives you shell scripts that work properly.
  915.  
  916.  
  917.   CASE_NO_NEWLINES=true
  918.  
  919.  
  920.  
  921.   Once it's installed, config. files will certainly go in /etc/smail
  922.   (but your mileage may vary if you use old distributions); let's start
  923.   editing them !
  924.  
  925.   5.2.  "config" file
  926.  
  927.  
  928.  
  929.  
  930.        # From
  931.        smart_path=polux
  932.        smart_transport=uux
  933.  
  934.        # To
  935.        hostname=barberouge
  936.        domains=linux.lmm.com
  937.  
  938.        visible_name=barberouge.linux.lmm.com
  939.        uucp_name=barberouge.linux.lmm.com
  940.  
  941.        # max_message_size=512k
  942.        # auth_domains=foo.bar
  943.        # more_hostnames=barberouge.polux.freenix.fr
  944.  
  945.  
  946.  
  947.  
  948.   Well, first, who is feeding you ? I'm fed by "polux" via uucp (i.e.
  949.   uux transport); naturally you need to change this file according to
  950.   your own situation. For example, you could by fed by
  951.   "bargw.bar.foobar.com" via "smtp", in that case you don't need a
  952.   transport file and can define "-transport_file " to indicate you don't
  953.   need one.
  954.  
  955.   You can also use "postmaster_address = yourname", hide the network
  956.   topology in outgoing addresses (if you're a gateway) using
  957.   "visible_name", set which aliases address can also be used for the
  958.   email you receive, using "more_hostnames".
  959.  
  960.   See smail documentation for more details or the examples in
  961.   /usr/doc/smail/examples to see if any match your situation.
  962.  
  963.  
  964.   5.3.  "directors" file
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.   # aliasinclude - expand ":include:filename" addresses produced by alias files
  992.   # This entry and the next one are pretty much boiler-plate.  Reasons
  993.   # for making significant changes are few.  The sole purpose of these
  994.   # is to match and expand addresses of the form:
  995.   #       :include:pathname
  996.   # which may occur in alias files or mailing-list/forward files
  997.   # (produced by any director with a driver of forwardfile).
  998.   aliasinclude:
  999.           driver = aliasinclude,          # use this special-case driver
  1000.           nobody;                         # associate nobody user with addresses
  1001.                                           #  when mild permission violations
  1002.                                           #  are encountered
  1003.           copysecure,                     # get permissions from alias director
  1004.           copyowners,                     # get owners from alias director
  1005.  
  1006.  
  1007.  
  1008.   # forwardinclude - expand ":include:filename" addrs produced by forward files
  1009.   forwardinclude:
  1010.           driver = forwardinclude,        # use this special-case driver
  1011.           nobody;
  1012.           copysecure,                     # get perms from forwarding director
  1013.           copyowners,                     # get owners from forwarding director
  1014.  
  1015.  
  1016.   # aliases - search for alias expansions stored in a database
  1017.   # This is the standard aliases file.  It is used for generic things,
  1018.   # like mapping root, postmaster, MAILER-DAEMON and uucp to site
  1019.   # admins, creating some small system alias expansions, and such.  In
  1020.   # this site configuration, the aliases file is used mostly for
  1021.   # machine-specific aliasing/forwarding information.  Global forwarding
  1022.   # information should be put in the "forward" database.
  1023.   aliases:
  1024.           driver=aliasfile,               # general-purpose aliasing director
  1025.           -nobody,                        # all addresses are associated
  1026.                                           # with nobody by default, so setting
  1027.                                           # this is not useful.
  1028.           sender_okay,                    # don't remove sender from expansions
  1029.           owner=owner-$user;              # problems go to an owner address
  1030.           file=/etc/aliases,
  1031.           modemask=002,                   # should not be globally writable
  1032.           optional,                       # ignore if file does not exist
  1033.           proto=lsearch,                  # unsorted ASCII file
  1034.  
  1035.  
  1036.   # forward - search for expansions stored in a forwarding database
  1037.   # This is the subdomain-wide user forwarding database.  Entries are
  1038.   # maintained here for current or past users, to forward their mail to
  1039.   # their preferred mail-reading machine.  The forward database is
  1040.   # shipped around the TCP/IP network as changes are made, to keep the
  1041.   # network consistent.
  1042.   #forward:
  1043.   #       driver = aliasfile,             # general-purpose aliasing director
  1044.   #       -nobody,                        # all addresses are associated
  1045.   #                                       # with nobody by default, so setting
  1046.   #                                       # this is not useful.
  1047.   #       owner = real-$user;             # problems go to an owner address
  1048.   #
  1049.   #       file = /etc/forward,
  1050.   #       modemask = 002,
  1051.   #       proto = dbm,                    # use dbm(3X) library for access
  1052.  
  1053.  
  1054.   # dotforward - expand .forward files in user home directories
  1055.   # For users that have an entry in the "forward" database, a ".forward"
  1056.   # file is only used if it is on the "home" machine, as identified in
  1057.   # the forward database.  If used, it is treated as a list of addresses
  1058.   # to which mail should be delivered, rather than (or in addition to)
  1059.   # the user identified in the local address.
  1060.   dotforward:
  1061.           driver = forwardfile,           # general-purpose forwarding director
  1062.           owner = postmaster, nobody, sender_okay;
  1063.  
  1064.           file = ~/.forward,              # .forward file in home directories
  1065.           checkowner,                     # the user can own this file
  1066.           owners = root,                  # or root can own the file
  1067.           modemask = 002,                 # it should not be globally writable
  1068.           caution = daemon:root,          # don't run things as root or daemon
  1069.           # be extra carefull of remotely accessible home directories
  1070.           unsecure = "~uucp:/tmp:/usr/tmp:/var/tmp"
  1071.  
  1072.  
  1073.   # forwardto - expand a "Forward to " in user mailbox files
  1074.   # This emulates the V6/V7/System-V forwarding mechanism which uses a
  1075.   # line of forward addresses stored at the beginning of user mailbox files
  1076.   # prefixed with the string "Forward to "
  1077.   forwardto:
  1078.           driver = forwardfile,
  1079.           owner = postmaster, nobody, sender_okay;
  1080.  
  1081.           file = /var/spool/mail/${lc:user},      # point at user mailbox files
  1082.           forwardto,                      # enable "Forward to " function
  1083.           checkowner,                     # the user can own this file
  1084.           owners = root,                  # or root can own the file
  1085.           modemask = 0002,                # under System V, group mail can write
  1086.           caution = daemon:root           # don't run things as root or daemon
  1087.  
  1088.  
  1089.   # user - match users on the local host with delivery to their mailboxes
  1090.   user:   driver = user;                  # driver to match usernames
  1091.           transport = local               # local transport goes to mailboxes
  1092.  
  1093.  
  1094.   # real_user - match usernames when prefixed with the string "real-"
  1095.   # This is useful for allowing an address which explicitly delivers to a
  1096.   # user's mailbox file.  For example, errors in a .forward file expansion
  1097.   # could be delivered here, or forwarding loops between multiple machines
  1098.   # can be resolved by using a real-username address.  Also, users that
  1099.   # wish to use mail as a means of transferring data to a machine that
  1100.   # is not their "home" machine can mail to real-login-name@remote.host.
  1101.   real_user:
  1102.           driver = user;
  1103.           transport = local,
  1104.           prefix = "real-"            # for example, match real-root
  1105.  
  1106.  
  1107.   # lists - expand mailing lists stored in a list directory
  1108.   # mailing lists can be created simply by creating a file in the
  1109.   # /etc/smail/lists directory.
  1110.   lists:  driver = forwardfile,
  1111.           caution,                        # flag all addresses with caution
  1112.           nobody,                         # and then associate the nobody user
  1113.           owner = owner-$user;            # system V sites may wish to use
  1114.                                           # o-$user, as owner-$user may be
  1115.                                           # too long for a 14-char filename.
  1116.           file = lists/${lc:user}         # lists is under $smail_lib_dir
  1117.  
  1118.  
  1119.   # owners - expand mailing lists stored in a list owner directory
  1120.   # mailing lists owner lists can be created simply by creating a file
  1121.   # in the /etc/smail/lists/owner directory.  Mailing list owners
  1122.   # are sent locally generated errors dealing with a mailing list of the
  1123.   # same name.  To create an owner list for a mailing list, create a
  1124.   # file with the name of the list in /etc/smail/lists/owner.  This
  1125.   # will create a list address of owner-listname, as is used by the
  1126.   # "lists" director above.
  1127.   owners: driver = forwardfile,
  1128.           caution,                        # flag all addresses with caution
  1129.           nobody,                         # and then associate the nobody user
  1130.           owner = postmaster;             # system V sites may wish to use
  1131.                                           # o-$user, as owner-$user may be
  1132.                                           # too long for a 14-char filename.
  1133.           prefix = "owner-",
  1134.           file = lists/owner/${lc:user}   # lists is under $smail_lib_dir
  1135.  
  1136.  
  1137.   # request - expand mailing lists stored in a list request directory
  1138.   # mailing lists request lists can be created simply by creating a file
  1139.   # in the /etc/smail/lists/request directory.  Request addresses
  1140.   # are typically used as a standard address for queries about a mailing
  1141.   # list.  For example, requests for additions or deletions to a list
  1142.   # will generally be sent to "list-request", which should be set up to
  1143.   # forward to the appropriate person or persons.
  1144.   request: driver = forwardfile,
  1145.           caution,                        # flag all addresses with caution
  1146.           nobody,                         # and then associate the nobody user
  1147.           owner = postmaster;             # system V sites may wish to use
  1148.                                           # o-$user, as owner-$user may be
  1149.                                           # too long for a 14-char filename.
  1150.           suffix = "-request",
  1151.           file = lists/request/${lc:user} # lists is under $smail_lib_dir
  1152.  
  1153.  
  1154.  
  1155.  
  1156.   You shouldn't need to change anything here, only mailing list options
  1157.   if you intend to run some using smail, or forwards options if, for
  1158.   example, you want to disable forwarding.
  1159.  
  1160.  
  1161.   5.4.  "fidopaths" file
  1162.  
  1163.  
  1164.  
  1165.  
  1166.        .f105.n324.z2.fidonet.org     f105.n324.z2.fidonet.org!%s
  1167.        .n324.z2.fidonet.org          f105.n324.z2.fidonet.org!%s
  1168.        .z2.fidonet.org                       f105.n324.z2.fidonet.org!%s
  1169.        .fidonet.org                  f105.n324.z2.fidonet.org!%s
  1170.  
  1171.  
  1172.  
  1173.  
  1174.   Create such a file only if you're using ifmail and FIDO.
  1175.  
  1176.  
  1177.   5.5.  "routers" file
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.   # forces - force certain paths
  1190.   # This database exists as a means of hardcoding the paths to various
  1191.   # machines or domains.  It is for use in creating temporary tweaks to
  1192.   # the other routint databases.  To change the database, edit the file
  1193.   # maps/force.path and type "make" in the maps/ subdirectory.
  1194.   forces:
  1195.           driver = pathalias,             # router to search paths file
  1196.           method = /etc/smail/maps/table; # transports are in this file
  1197.           file = forcepaths,              # file containing force path info
  1198.           proto = lsearch,                # use the sorted path file
  1199.           optional,
  1200.           reopen                          # close when not being used
  1201.  
  1202.  
  1203.   uucp_neighbors:
  1204.           driver=uuname,                  # use a program which returns neighbors
  1205.           transport=uux;
  1206.           cmd="/usr/bin/uuname -a",       # specifically, use the uuname program
  1207.   #        domain=uucp                    # strip ending ".uucp"
  1208.  
  1209.  
  1210.   # smart_host - a partically specified smarthost director
  1211.   # If the config file attribute smart_path is defined as a path from the
  1212.   # local host to a remote host, then hostnames not matched otherwise will
  1213.   # be sent off to the stated remote host.  The config file attribute
  1214.   # smart_transport can be used to specify a different transport.
  1215.   # If the smart_path attribute is not defined, this router is ignored.
  1216.   smart_host:
  1217.           driver = smarthost,             # special-case driver
  1218.           transport = uux                 # by default deliver over UUCP
  1219.   #       path=phreak
  1220.  
  1221.  
  1222.   # ifmail - to send mails to fidonet and vice versa
  1223.   ifmail:
  1224.           driver=pathalias,
  1225.           transport=ifmail;
  1226.           file=fidopaths,
  1227.           proto=lsearch
  1228.  
  1229.  
  1230.  
  1231.  
  1232.   You should only include ifmail chapter if you use ifmail for FIDO
  1233.   mails. Note you can also change transport mode from "uux" (ie UUCP)
  1234.   to, for example, "smtp" or even 'hardcode the paths to various
  1235.   machines or domains' in "/etc/smail/maps/table".
  1236.  
  1237.   This is usefull if you want outgoing mail for your local network to be
  1238.   delivered immediately, since there's no need for it to be routed to
  1239.   your uucp connexion of your internet access.
  1240.  
  1241.  
  1242.   5.6.  "transports" file
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.   # local - deliver mail to local users
  1256.   # Tell smail to append directly to user mailbox files in the /var/spool/mail
  1257.   # directory.
  1258.   #local: driver = appendfile,            # append message to a file
  1259.   #       -return_path,                   # include a Return-Path: field
  1260.   #       local,                          # use local forms for delivery
  1261.   #       from,                           # supply a From_ envelope line
  1262.   #       unix_from_hack;                 # insert > before From in body
  1263.   #
  1264.   #       file = /var/spool/mail/${lc:user},      # use this location for Linux
  1265.   #                                               # Note, mail spool must be 1777
  1266.   #       file = ~/mailfile,              # use this location for better security
  1267.   #       group = mail,                   # group to own file for System V
  1268.   #       mode = 0660,                    # under System V, group mail can access
  1269.   #       suffix = "\n",                     # append an extra newline
  1270.   #       append_as_user,
  1271.  
  1272.  
  1273.   # This allows each user to have a ~/.procmailrc file to control filtering
  1274.   # of mail and saving mail from mail lists in separate mailboxes if they wish.
  1275.   local:  +inet,
  1276.           -uucp,
  1277.           driver = pipe,                  # append message to a file
  1278.           return_path,                    # include a Return-Path: field
  1279.           local,                          # use local forms for delivery
  1280.           from,                           # supply a From_ envelope line
  1281.           unix_from_hack;                 # insert > before From in body
  1282.  
  1283.           cmd = "/usr/bin/procmail",  # use procmail for local delivery
  1284.           parent_env,                     # environment info from parent addr
  1285.           pipe_as_user,                   # use user-id associated with address
  1286.           umask = 0022,                   # umask for child process
  1287.   #       -ignore_status,                 # exit status should be believed
  1288.   #       -ignore_write_errors,           # retry on broken pipes
  1289.  
  1290.  
  1291.   # pipe - deliver mail to shell commands
  1292.   # This is used implicitly when smail encounters addresses which begin with
  1293.   # a vertical bar character, such as "|/usr/lib/news/recnews talk.bizarre".
  1294.   # The vertical bar is removed from the address before being given to the
  1295.   # transport.
  1296.   #pipe:  driver = pipe,                  # pipe message to another program
  1297.   #       return_path, local, from, unix_from_hack;
  1298.   #
  1299.   #       cmd = "/bin/sh -c $user",   # send address to the Bourne Shell
  1300.   #       parent_env,                     # environment info from parent addr
  1301.   #       pipe_as_user,                   # use user-id associated with address
  1302.   #       umask = 0022,                   # umask for child process
  1303.   #       -log_output,                    # do not log stdout/stderr
  1304.   #       ignore_status,                  # exit status may be bogus, ignore it
  1305.   #       ignore_write_errors,            # ignore broken pipes
  1306.  
  1307.  
  1308.   # file - deliver mail to files
  1309.   # This is used implicitly when smail encounters addresses which begin with
  1310.   # a slash or squiggle character, such as "/usr/info/list_messages" or
  1311.   # perhaps "~/Mail/inbox".
  1312.   #file:  driver = appendfile,
  1313.   #       return_path, local, from, unix_from_hack;
  1314.   #
  1315.   #       file = $user,                   # file is taken from address
  1316.   #       append_as_user,                 # use user-id associated with address
  1317.   #       expand_user,                    # expand ~ and $ within address
  1318.   #       check_path,
  1319.   #       suffix = "\n",
  1320.   #       mode = 0644
  1321.   # uux - deliver to the rmail program on a remote UUCP site
  1322.   #
  1323.   # As many as five recipient addresses will be delivered to the remote
  1324.   # host in one UUCP transaction.
  1325.   uux:    driver = pipe,
  1326.           -uucp,
  1327.           inet,
  1328.   #       uucp,                           # use UUCP-style addressing forms
  1329.           from,                           # supply a From_ envelope line
  1330.           max_addrs = 5,                  # at most 5 addresses per invocation
  1331.           max_chars = 200;                # at most 200 chars of addresses
  1332.   # the -r flag prevents immediate delivery, parentheses around the
  1333.   # $user variable prevent special interpretation by uux.
  1334.           cmd = "/usr/bin/uux - -r -g$grade $host!rmail $((${strip:user})$)",
  1335.   #        cmd="/usr/bin/uux - $host!rmail $(($user)$)",
  1336.           ignore_write_errors,            # ignore broken pipes
  1337.           umask = 0022,
  1338.   #       pipe_as_sender,
  1339.  
  1340.  
  1341.   # uux_one_addr - deliver mail over UUCP to a remote host that can take
  1342.   #                one address at a time.
  1343.   # This is often necessary when delivering to a site running an unmodified
  1344.   # version of 4.1BSD.
  1345.   uux_one_addr:
  1346.           driver = pipe,
  1347.           uucp,                           # use UUCP-style addressing forms
  1348.           from;                           # supply a From_ envelope line
  1349.   # the -r flag prevents immediate delivery
  1350.           cmd = "/usr/bin/uux - -r -g$grade $host!rmail (${strip:user})",
  1351.           umask = 0022,
  1352.           pipe_as_sender
  1353.  
  1354.  
  1355.   queueonly:
  1356.           driver = pipe;                  # send the message to a pipe
  1357.           cmd = "/usr/lib/sendmail -Q -f $sender -bm $user",
  1358.                                           # use getmail for local delivery
  1359.           user=root,                      # execute getmail as "root"
  1360.           group=mail,                     # execute getmail as "mail"
  1361.           parent_env,                     # environment info from parent addr
  1362.           -pipe_as_user,                  # use user-id associated with address
  1363.           umask = 0007,                   # umask for child process
  1364.  
  1365.   # to deliver the message.  The smtp transport is included only if BSD
  1366.   # networking exists.
  1367.   # The uucp attribute can be specified for transfers within the UUCP
  1368.   # zone.  The inet attribute must be specified for transfers within the
  1369.   # Internet.
  1370.   # NOTE: This is hardly optimal, a backend should exist which can handle
  1371.   #       multiple messages per connection.
  1372.   # ALSO: It may be necessary to restrict max_addrs to 100, as this is the
  1373.   #       lower limit SMTP requires an implementation to handle for one
  1374.   #       message.
  1375.   smtp:   driver=tcpsmtp,
  1376.           inet,                           # if UUCP_ZONE is not defined
  1377.   #       uucp,                           # if UUCP_ZONE is defined
  1378.           -max_addrs, -max_chars;         # no limit on number of addresses
  1379.  
  1380.           short_timeout=5m,               # timeout for short operations
  1381.           long_timeout=2h,                # timeout for longer SMTP operations
  1382.           service=smtp,                   # connect to this service port
  1383.   # For internet use: uncomment the below 4 lines
  1384.          use_bind,                       # resolve MX and multiple A records
  1385.          defnames,                       # use standard domain searching
  1386.          defer_no_connect,               # try again if the nameserver is down
  1387.          local_mx_okay,                  # fail an MX to the local host
  1388.  
  1389.  
  1390.   ifmail:
  1391.           from,received,max_addrs=5,max_chars=200,
  1392.           driver=pipe;
  1393.           pipe_as_sender,
  1394.           cmd="/usr/local/bin/ifmail -x9 -r$host $((${strip:user})$)"
  1395.  
  1396.  
  1397.  
  1398.  
  1399.   You should include an ifmail chapter only if you use ifmail for FIDO
  1400.   mails. Apart from that, you shouldn't need to edit anything in this
  1401.   file which defines transport agents (like uux, smtp ...) you can use
  1402.   as parameters in other config. files.
  1403.  
  1404.   Note I commented out some parts, like "pipes" or "file", to enhance
  1405.   security.
  1406.  
  1407.  
  1408.   5.7.  "maps/" directory
  1409.  
  1410.  
  1411.   It contains map and table files :
  1412.  
  1413.   First, map file
  1414.  
  1415.  
  1416.  
  1417.        #N      foo.bar foo2.bar2
  1418.        #S      AT 486/RedHat Linux 1.2.13
  1419.        #O      organization
  1420.        #C      contact
  1421.        #E      administration (email)
  1422.        #T      phone
  1423.        #P      address
  1424.        #R
  1425.        #U      hosts connected via uucp
  1426.        #W      created/edited by
  1427.        #
  1428.        hname polux
  1429.  
  1430.        hname linux.eu.org
  1431.  
  1432.        hname = polux
  1433.        hname = polux.linux.eu.org
  1434.  
  1435.  
  1436.  
  1437.  
  1438.   Once again, edit this file to match you situation (I'm fed by
  1439.   polux.linux.eu.org).
  1440.  
  1441.   Now table file
  1442.  
  1443.  
  1444.  
  1445.  
  1446.        *       uux
  1447.  
  1448.  
  1449.  
  1450.  
  1451.   You can define different transports to different path, for exemple
  1452.   "smtp" for the machines in your local network, "uux" (i.e. uucp) for
  1453.   the rest of the world or vice-versa (I'm using uucp for any outgoing
  1454.   mail, therefore I use "*" !).
  1455.  
  1456.  
  1457.   5.8.  Other good examples
  1458.  
  1459.  
  1460.   The previous files are the one I currently use for my site, you
  1461.   shouldn't encounter any problem using them as samples/basis for your
  1462.   own files.
  1463.  
  1464.   The following files are provided only as good exemples to configure
  1465.   smail a different way.
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477.  
  1478.  
  1479.  
  1480.  
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.   #ident "@(#) transports,v 1.2 1990/10/24 05:20:46 tron Exp"
  1520.  
  1521.   # See smail(5) for a complete description of the contents of this file.
  1522.  
  1523.   # local - deliver mail to local users
  1524.   #
  1525.   # Tell smail to append directly to user mailbox files in the /usr/mail
  1526.   # directory.
  1527.   local:  driver = appendfile,            # append message to a file
  1528.           return_path,                    # include a Return-Path: field
  1529.           local,                          # use local forms for delivery
  1530.           from,                           # supply a From_ envelope line
  1531.           unix_from_hack;                 # insert > before From in body
  1532.  
  1533.           file = /usr/mail/${lc:user},    # use this location for System V
  1534.           group = mail,                   # group to own file for System V
  1535.           mode = 0660,                    # under System V, group mail can access
  1536.           suffix = "\n",                     # append an extra newline
  1537.           append_as_user,
  1538.  
  1539.   # pipe - deliver mail to shell commands
  1540.   #
  1541.   # This is used implicitly when smail encounters addresses which begin with
  1542.   # a vertical bar character, such as "|/usr/lib/news/recnews talk.bizarre".
  1543.   # The vertical bar is removed from the address before being given to the
  1544.   # transport.
  1545.   pipe:   driver = pipe,                  # pipe message to another program
  1546.           return_path, local, from, unix_from_hack;
  1547.  
  1548.           cmd = "/bin/sh -c $user",   # send address to the Bourne Shell
  1549.           parent_env,                     # environment info from parent addr
  1550.           pipe_as_user,                   # use user-id associated with address
  1551.           umask = 0022,                   # umask for child process
  1552.           -log_output,                    # do not log stdout/stderr
  1553.           ignore_status,                  # exit status may be bogus, ignore it
  1554.           ignore_write_errors,            # ignore broken pipes
  1555.  
  1556.   # file - deliver mail to files
  1557.   #
  1558.   # This is used implicitly when smail encounters addresses which begin with a
  1559.   # slash or squiggle character, such as "/usr/info/list_messages" or perhaps
  1560.   # "~/Mail/inbox".
  1561.   file:   driver = appendfile,
  1562.           return_path, local, from, unix_from_hack;
  1563.  
  1564.           file = $user,                   # file is taken from address
  1565.           append_as_user,                 # use user-id associated with address
  1566.           expand_user,                    # expand ~ and $ within address
  1567.           suffix = "\n",
  1568.           mode = 0644
  1569.  
  1570.   # uux - deliver to the rmail program on a remote UUCP site
  1571.   #
  1572.   # As many as five recipient addresses will be delivered to the remote host in
  1573.   # one UUCP transaction.
  1574.   uux:    driver = pipe,
  1575.           uucp,                           # use UUCP-style addressing forms
  1576.           from,                           # supply a From_ envelope line
  1577.           max_addrs = 5,                  # at most 5 addresses per invocation
  1578.           max_chars = 200;                # at most 200 chars of addresses
  1579.  
  1580.           # the -r flag prevents immediate delivery, parentheses around the
  1581.           # $user variable prevent special interpretation by uux.
  1582.           cmd = "/usr/bin/uux - -r -g$grade $host!rmail $((${strip:user})$)",
  1583.           umask = 0022,
  1584.           pipe_as_sender
  1585.   # uux_one_addr - deliver mail over UUCP to a remote host that can take one
  1586.   # address at a time.
  1587.   #
  1588.   # This is often necessary when delivering to a site running an unmodified
  1589.   # version of 4.1BSD.
  1590.   uux_one_addr:
  1591.           driver = pipe,
  1592.           uucp,                           # use UUCP-style addressing forms
  1593.           from;                           # supply a From_ envelope line
  1594.  
  1595.           # the -r flag prevents immediate delivery
  1596.           cmd = "/usr/bin/uux - -r -g$grade $host!rmail (${strip:user})",
  1597.           umask = 0022, pipe_as_sender
  1598.  
  1599.   # demand - deliver to a remote rmail program, polling on demand
  1600.   demand: driver = pipe,
  1601.           uucp, from, max_addrs = 5, max_chars = 200;
  1602.  
  1603.           # with no -r flag, try to contact remote site immediately
  1604.           cmd = "/usr/bin/uux - -g$grade $host!rmail $(($user)$)",
  1605.           umask = 0022, pipe_as_sender
  1606.  
  1607.   # uusmtp - deliver to the rsmtp program on a remote UUCP site
  1608.   #
  1609.   # Deliver using a simple Batched SMTP protocol to the remote machine.
  1610.   # This allows much more arbitrary addresses to be used.  It also
  1611.   # removes the limit on recipient addresses per invocation of uux.
  1612.   uusmtp: driver = pipe,
  1613.           bsmtp,                          # send batched SMTP commands
  1614.           -max_addrs,                     # there is no limit on the number or
  1615.           -max_chars;                     #   total size of recipient addresses.
  1616.  
  1617.           # supply -r to prevent immedate delivery, the recipient addresses
  1618.           # are stored in the data sent to the standard input of rsmtp.
  1619.           cmd = "/usr/bin/uux - -r -g$grade $host!rsmtp",
  1620.           umask = 0022, pipe_as_sender
  1621.  
  1622.   # demand_uusmtp - deliver to a remote rsmtp program, polling on demand
  1623.   demand_uusmtp:
  1624.           driver = pipe,
  1625.           bsmtp, -max_addrs, -max_chars;
  1626.  
  1627.           # with no -r flag, try to contact remote site immediately
  1628.           cmd = "/usr/bin/uux - -g$grade $host!rsmtp",
  1629.           umask = 0022, pipe_as_sender
  1630.  
  1631.   # smtp - deliver using SMTP over TCP/IP
  1632.   #
  1633.   # Connect to a remote host using TCP/IP and initiate an SMTP conversation to
  1634.   # deliver the message.  The smtp transport is included only if BSD networking
  1635.   # exists.
  1636.  
  1637.   # NOTE: It may be necessary to restrict max_addrs to 100, as this is the
  1638.   #       lower limit SMTP requires an implementation to handle for one
  1639.   #       message.
  1640.   smtp:   driver = smtp,
  1641.           -max_addrs,
  1642.           -max_chars
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.   #ident "@(#) table,v 1.2 1990/10/24 05:20:31 tron Exp"
  1652.  
  1653.   # This file names the transports that are to be used in delivering
  1654.   # to specific hosts from bargw.
  1655.  
  1656.   #host           transport
  1657.   #--------       ---------
  1658.   curdsgw         demand_uusmtp   # deliver using batched SMTP
  1659.   oldbsd          uux_one_addr    # 4.1BSD sites cannot take more than one addr
  1660.   sun             demand          # call sun when their is mail to send
  1661.   *               uux             # for all others, poll at intervals
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.   5.9.  Restarting inetd
  1668.  
  1669.  
  1670.   To run smail as a smtp daemon, add one of the following to
  1671.   /etc/inetd.conf:
  1672.  
  1673.            smtp stream tcp nowait  root  /usr/bin/smtpd smtpd
  1674.  
  1675.   or:
  1676.  
  1677.            smtp stream tcp nowait  root  /usr/sbin/tcpd  /usr/sbin/in.smtpd
  1678.  
  1679.  
  1680.  
  1681.  
  1682.   Outgoing mail gets sent automatically, when using elm.
  1683.  
  1684.  
  1685.   5.10.  Smail with smtp
  1686.  
  1687.  
  1688.   Generally, ISPs use smtp, therefore you shouldn't have any problems
  1689.   sending your mail. If your internet link is down when you send mail,
  1690.   then the mail sits in "/var/spool/smail/input". When the link next
  1691.   comes up, "runq" is run which causes the mail to be sent. However,
  1692.   receiving mail is the problem since your provider has many clients to
  1693.   look after, not only you !
  1694.  
  1695.   Usually, you can retreive your mail via the POP protocol, see POP
  1696.   section below.
  1697.  
  1698.  
  1699.   6.  OUTDATED SECTION : Sendmail+IDA
  1700.  
  1701.  
  1702.   For big sites, sendmail is worth choosing, due to the "incredible ease
  1703.   of use", (very relative feeling when you know qmail) but you must
  1704.   decide which you want between sendmail+IDA and sendmail 8.x :
  1705.  
  1706.  
  1707.   ╖  If you use an old kernel (1.0) : sendmail+IDA
  1708.  
  1709.   ╖  If you use a not so old kernel (1.2) : sendmail+IDA and source code
  1710.      editing
  1711.  
  1712.   ╖  Recent kernel (2.0) will choose sendmail 8.x
  1713.  
  1714.   Remember, linux newbies or people concerned by security / ease of
  1715.   configuration should rather try using smail or qmail, which are easier
  1716.   to use and safer.
  1717.   6.1.  Source installation
  1718.  
  1719.  
  1720.   If your distribution doesn't provide you with a ready-to-install
  1721.   sendmail package (.rpm for RedHat, Caldera and Suse, .deb for Debian)
  1722.   just download the sources and run :
  1723.  
  1724.  
  1725.   ╖  cd / ; tar -zxvf sendmail5.67b+IDA1.5.tpz
  1726.  
  1727.  
  1728.   ╖  cd to /usr/local/lib/mail/CF and copy the sample.m4 local.m4 file
  1729.      to "yourhostname.m4".
  1730.  
  1731.   Edit out the distributed hostname, aliases, smarthost and put in the
  1732.   correct one for your site. The default file is for a uucp-only site
  1733.   who has domainized headers and who talks to a smart host. Then "make
  1734.   yourhostname.cf" and move the resulting file to /etc/sendmail.cf
  1735.  
  1736.  
  1737.   ╖  if you are uucp-only, you do *NOT* need to create any of the tables
  1738.      mentioned in the README.linux file.
  1739.  
  1740.   You'll just have to touch the files so that the Makefile works. Just
  1741.   edit the .m4 file, make sendmail.cf and start testing it.
  1742.  
  1743.  
  1744.   ╖  if you're uucp-only and you talk to sites in addition to your
  1745.      "smart-host", you'll need to add uucpxtable entries for each (or
  1746.      mail to them will also go through the smart host) and run dbm
  1747.      against the revised uucpxtable.
  1748.  
  1749.  
  1750.   ╖  If you run Rich Braun's original binary distribution of 5.67a,
  1751.      you'll need to freeze the configuration if you change your .cf file
  1752.      with "/usr/lib/sendmail -bz" to make the changes take effect.
  1753.  
  1754.   You should also update your version to at least 5.67b since there is a
  1755.   nasty security hole in 5.67a and earlier. Another nice thing is that
  1756.   if you have mail.debug set and you run syslogd, your incoming and
  1757.   outgoing mail messages will get logged. See the "/etc/syslog.conf"
  1758.   file for details.
  1759.  
  1760.   The sources for sendmail+IDA can be found at vixen.cso.uiuc.edu ; they
  1761.   require no patching to run under Linux if you're running something
  1762.   like a kernel of 1.00.
  1763.  
  1764.  
  1765.   If you're running a kernel > 1.1.50, you get the fun of reversing most
  1766.   of the Linux-specific patches that are now in the vanilla sources.  (I
  1767.   *did* told you this sendmail was only for old kernels :-)
  1768.  
  1769.   It's extremely obvious where this needs to be done : just type "make"
  1770.   and when it blows up, go to that line in the sources and comment out
  1771.   the Linux-specific code that's in there.
  1772.  
  1773.   If you're going to run sendmail+IDA, I strongly recommend you go to
  1774.   the sendmail5.67b+IDA1.5 version since all required Linux-specific
  1775.   patches are now in the vanilla sources and several security holes have
  1776.   been plugged that WERE (!!!) in the older version you may have grabbed
  1777.   or built before about December 1st, 1993.
  1778.  
  1779.   Now linux kernel is 2.0, you should use sendmail 8.x insted of
  1780.   sendmail+IDA, but I told you'd better choose sendmail 8.x :-)
  1781.  
  1782.  
  1783.   6.2.  The sendmail.m4 file
  1784.  
  1785.  
  1786.   Sendmail+IDA requires you to set up a sendmail.m4 file rather than
  1787.   editing the sendmail.cffile directly.  The nice thing about this is
  1788.   that it is simple to set up mail configurations that are extremely
  1789.   difficult (if not totally impossible for most people to set up
  1790.   correctly) in smail or traditional sendmail.
  1791.  
  1792.   The sendmail.m4 file that corresponds to the above smail example looks
  1793.   like the following:
  1794.  
  1795.  
  1796.     dnl #------------------ SAMPLE SENDMAIL.M4 FILE ------------------
  1797.     dnl #
  1798.     dnl # (the string 'dnl' is the m4 equivalent of commenting out a line)
  1799.     dnl #
  1800.     dnl # you generally don't want to override LIBDIR from the compiled in paths
  1801.     dnl #define(LIBDIR,/usr/local/lib/mail)dnl    # where all support files go
  1802.     define(LOCAL_MAILER_DEF, mailers.linux)dnl    # mailer for local delivery
  1803.     define(POSTMASTERBOUNCE)dnl                   # postmaster gets bounces
  1804.     define(PSEUDODOMAINS, BITNET UUCP)dnl         # don't try DNS on these
  1805.     dnl #
  1806.     dnl #-------------------------------------------------------------
  1807.     dnl #
  1808.     dnl # names we're known by
  1809.     define(PSEUDONYMS, myhostname.subdomain.domain myhostname.UUCP)
  1810.     dnl #
  1811.     dnl # our primary name
  1812.     define(HOSTNAME, myhostname.subdomain.domain)
  1813.     dnl #
  1814.     dnl # our uucp name
  1815.     define(UUCPNAME, myhostname)dnl
  1816.     dnl #
  1817.     dnl #-------------------------------------------------------------
  1818.     dnl #
  1819.     define(UUCPNODES, |uuname|sort|uniq)dnl       # our uucp neighbors
  1820.     define(BANGIMPLIESUUCP)dnl                    # make certain that uucp
  1821.     define(BANGONLYUUCP)dnl                       #  mail is treated correctly
  1822.     define(RELAY_HOST, my_uucp_neighbor)dnl       # our smart relay host
  1823.     define(RELAY_MAILER, UUCP-A)dnl               # we reach moria via uucp
  1824.     dnl #
  1825.     dnl #--------------------------------------------------------------------
  1826.     dnl #
  1827.     dnl # the various dbm lookup tables
  1828.     dnl #
  1829.     define(ALIASES, LIBDIR/aliases)dnl            # system aliases
  1830.     define(DOMAINTABLE, LIBDIR/domaintable)dnl    # domainize hosts
  1831.     define(PATHTABLE, LIBDIR/pathtable)dnl        # paths database
  1832.     define(GENERICFROM, LIBDIR/generics)dnl       # generic from addresses
  1833.     define(MAILERTABLE, LIBDIR/mailertable)dnl    # mailers per host or domain
  1834.     define(UUCPXTABLE, LIBDIR/uucpxtable)dnl      # paths to hosts we feed
  1835.     define(UUCPRELAYS, LIBDIR/uucprelays)dnl      # short-circuit paths
  1836.     dnl #
  1837.     dnl #--------------------------------------------------------------------
  1838.     dnl #
  1839.     dnl # include the 'real' code that makes it all work
  1840.     dnl # (provided with the source code)
  1841.     dnl #
  1842.     include(Sendmail.mc)dnl                         # REQUIRED ENTRY !!!
  1843.     dnl #
  1844.     dnl #------------ END OF SAMPLE SENDMAIL.M4 FILE -------
  1845.  
  1846.  
  1847.  
  1848.  
  1849.   6.3.  Defining a local mailer
  1850.  
  1851.   Unlike most Unix distributions, Linux does not come with a local mail
  1852.   delivery agent by default. Now, deliver or procmail is generally
  1853.   installed, so no complexity will be added to this already very complex
  1854.   setup. I recommend using the commonly available deliver or procmail
  1855.   programs, which can be optional packages in a some Linux
  1856.   distributions.
  1857.  
  1858.   In order to do so, you need to define a LOCAL_MAILER_DEF in the
  1859.   sendmail.m4 file that points to a file that looks like:
  1860.  
  1861.  
  1862.     # -- /usr/local/lib/mail/mailers.linux --
  1863.     #     (local mailers for use on Linux )
  1864.     Mlocal, P=/usr/bin/deliver, F=SlsmFDMP, S=10, R=25/10, A=deliver $u
  1865.     Mprog,  P=/bin/sh,       F=lsDFMeuP,   S=10, R=10, A=sh -c $u
  1866.  
  1867.  
  1868.  
  1869.   There is a also built-in default for deliver in the Sendmail.mc file
  1870.   that gets included into the sendmail.cf file. To specify it, you would
  1871.   not use the mailers.linux file but would instead define the following
  1872.   in your sendmail.m4 file:
  1873.  
  1874.  
  1875.      dnl --- (in sendmail.m4) ---
  1876.      define(LOCAL_MAILER_DEF, DELIVER)dnl       # mailer for local delivery
  1877.  
  1878.  
  1879.  
  1880.   Unfortunately, Sendmail.mc assumes deliver is installed in /bin, which
  1881.   is not the case with Slackware1.1.1 (which installs it in /usr/bin).
  1882.   In that case you'd need to either fake it with a link or rebuild
  1883.   deliver from sources so that it resides in /bin. Please note procmail
  1884.   is generally better than deliver, for example for mail filtering.
  1885.  
  1886.  
  1887.   6.4.  The sendmail+IDA dbm tables
  1888.  
  1889.  
  1890.   Setting up special behavior for sites or domains is done through a
  1891.   number of optional dbm tables rather than editing the sendmail.cf file
  1892.   directly.
  1893.  
  1894.   Refer to the July-1994 issue of Linux Journal (if you can still find
  1895.   it :-), to the docs in the sources, or to the sendmail chapter in the
  1896.   newest version of the Linux DOC Project Networking Administration
  1897.   Guide which will be available real-soon-now for more details.
  1898.  
  1899.  
  1900.   ╖  mailertable   - defines special behavior for remote hosts or
  1901.      domains.
  1902.  
  1903.   ╖  uucpxtable    - forces UUCP delivery of mail to hosts that are in
  1904.      DNS format.
  1905.  
  1906.   ╖  pathtable     - defines UUCP bang-paths to remote hosts or domains.
  1907.  
  1908.   ╖  uucprelays    - short-circuits the pathalias path to well-known
  1909.      remote hosts.
  1910.  
  1911.   ╖  genericfrom   - converts internal addresses into generic ones
  1912.      visible to the outside world.
  1913.  
  1914.  
  1915.   ╖  xaliases      - converts generic addresses to/from valid internal
  1916.      ones.
  1917.  
  1918.   ╖  decnetxtable  - converts RFC-822 addresses to DECnet-style
  1919.      addresses.
  1920.  
  1921.  
  1922.   6.5.  So which entries are really required?
  1923.  
  1924.   When not using any of the optional dbm tables, sendmail delivers mail
  1925.   via the RELAY_HOST and RELAY_MAILER) defined in the sendmail.m4 file
  1926.   used to generate sendmail.cf. It is easily possible to override this
  1927.   behavior through entries in the domaintable or uucpxtable.
  1928.  
  1929.   A generic site that is on Internet and speaks Domain Name Service, or
  1930.   one that is UUCP-only and forwards all mail via UUCP through a smart
  1931.   RELAY_HOST, probably does not need any specific table entries at all.
  1932.  
  1933.   Virtually all systems should set the DEFAULT_HOST and PSEUDONYMS
  1934.   macros, which define the canonical site name and aliases it is known
  1935.   by.
  1936.  
  1937.   If all you have is a relay host and relay mailer, you don't need to
  1938.   set these defaults since it works automagically. UUCP hosts will
  1939.   probably also need to set UUCPNAME to their official UUCP name.
  1940.  
  1941.   They will also probably set RELAY_MAILER and RELAY_HOST which enable
  1942.   smart-host routing through a mail relay.
  1943.  
  1944.   The mail transport to be used is defined in RELAY_MAILER and should
  1945.   usually be UUCP-A for UUCP sites. If your site is SMTP-only and talks
  1946.   `Domain Name Service', you would change the RELAY_MAILER.
  1947.  
  1948.   If you're a SLIP site, you might want to take the easy way out and
  1949.   just forward all outgoing mail to your service provider to do the
  1950.   right thing with.  To do so, you'd want to define ISOLATED_DOMAINS and
  1951.   VALIDATION_DOMAINS to be your domain, you'd also want to define
  1952.   RELAY_HOST to be your service provider and RELAY_MAILER to be TCP. Of
  1953.   course, you want to ask permission before you set any system up as
  1954.   your general purpose relay.
  1955.  
  1956.  
  1957.   6.6.  Sendmail 8.x
  1958.  
  1959.  
  1960.   Sendmail 8.7.x from Berkeley was the latest major revision after
  1961.   sendmail5. It had wonderful built-in support for building under Linux
  1962.   : just "make linux" and all was set.
  1963.  
  1964.   You'll probably be best served by grabbing one of the various binary
  1965.   distributions off of the usual Linux archive sites rather than
  1966.   fighting things like Berkeley dbm yourself.
  1967.  
  1968.   There's a nice distribution of sendmail 8.6.12 from Jason Haar -
  1969.   j.haar at lazerjem.demon.co.uk  on sunsite.unc.edu in
  1970.   /pub/Linux/system/Mail/delivery/sendmail-8.6.12-bin.tgz that has the
  1971.   source documentation and a very nice quickie description of how to run
  1972.   sendmail v8 for common configurations.
  1973.  
  1974.   The bottom line with sendmail v8 is that you want to configure the
  1975.   bare minimum necessary to get the job done ; the following is an
  1976.   example that should get you close at least.
  1977.  
  1978.  
  1979.  
  1980.  
  1981.   6.7.  A sample 8.7.x mc file
  1982.  
  1983.  
  1984.   Much like sendmail+IDA, sendmail v8 uses m4 to process a config file
  1985.   into a full sendmail.cf that sendmail uses.  The following is my
  1986.   current mc file for my site (ppp to Internet for outgoing mail, uucp
  1987.   for incoming mail).
  1988.  
  1989.  
  1990.           dnl divert(-1)
  1991.           #---------------------------------------------------------------------
  1992.           #
  1993.           # this is the .mc file for a linux host that's set up as follows:
  1994.           #
  1995.           #       - connected to Internet for outbound mail (ppp here)
  1996.           #       - connected via UUCP for incoming mail
  1997.           #       - domainized headers
  1998.           #       - no local mailer (use 'deliver' instead)
  1999.           #       - no DNS running so don't canonicalize outgoing via DNS
  2000.           #       - all non-local outbound mail goes to the RELAY_HOST over smtp
  2001.           #           (we run ppp and let our service provider do the work)
  2002.           #
  2003.           #                                       vds 3/31/95
  2004.           #
  2005.           #---------------------------------------------------------------------
  2006.           include(`../m4/cf.m4')
  2007.           VERSIONID(`linux nodns relays to slip service provider smarthost')dnl
  2008.           Cwmyhostname.myprimary.domain myhostname.UUCP localhost
  2009.           OSTYPE(linux)
  2010.           FEATURE(nodns)dnl
  2011.           FEATURE(always_add_domain)dnl
  2012.           FEATURE(redirect)
  2013.           FEATURE(nocanonify)
  2014.           dnl MAILER(local)dnl
  2015.           MAILER(smtp)dnl
  2016.           MAILER(uucp)dnl
  2017.           define(`RELAY_HOST', smtp:my.relay.host.domain)
  2018.           define(`SMART_HOST', smtp:my.relay.host.domain)
  2019.           define(`UUCP_RELAY', smtp:my.relay.host.domain)
  2020.           define(`LOCAL_MAILER_PATH', `/bin/deliver')
  2021.           define(`LOCAL_MAILER_ARGS', `deliver $u')
  2022.  
  2023.  
  2024.  
  2025.  
  2026.   6.8.  Sendmail v8 tidbits
  2027.  
  2028.  
  2029.   There are a few differences I suppose to the 'IDA bigots' among us.
  2030.   So far, I've found the following:
  2031.  
  2032.  
  2033.   Instead of 'runq', you type 'sendmail -q' to run the queue !
  2034.  
  2035.  
  2036.  
  2037.   6.9.  Local Delivery Agents
  2038.  
  2039.  
  2040.   Unlike most operating systems, Linux did not have mail "built-in" :
  2041.   you needed a program to deliver the local mail, like "lmail",
  2042.   "procmail" or "deliver".
  2043.  
  2044.   However, every recent distribution includes a local mailer now !
  2045.  
  2046.  
  2047.   Documentation for how to use either for local delivery is in the
  2048.   sendmail5.67b+IDA1.5 binary release (on sunsite) mentioned above.
  2049.  
  2050.  
  2051.   7.  POP mail
  2052.  
  2053.  
  2054.   This section also concerns IMAP, not very different from POP.
  2055.  
  2056.  
  2057.   7.1.  History
  2058.  
  2059.  
  2060.   On a workstation network, mail has always been a problem:
  2061.  
  2062.  
  2063.   ╖  Either you use "user@computer.foo.com" with problems when
  2064.      "computer" is down, making your network known to the people
  2065.      outside, having different addresses for a same person switching to
  2066.      another computer, ...
  2067.  
  2068.   ╖  Either you take a mail hub, "mailhost.foo.com" with rules for
  2069.      rewriting, so every user seems to post from the same address, even
  2070.      if they are on different computers.
  2071.  
  2072.   But in that case, how can user read their mail ?
  2073.  
  2074.   Using a rsh with elm ? :-)
  2075.  
  2076.   It would overload our mail hub !  One method was forwarding or UUCP,
  2077.   smtp, etc. but it's too complicated.
  2078.  
  2079.   Then came POP/IMAP, both with security problems at the beginning, now
  2080.   fixed using ssh on new versions) : a mail program has sometimes to be
  2081.   set locally (like qmail, smail or vmail if, for example, you use elm,
  2082.   but mozilla will avoid that !) however, getting and sending Email is
  2083.   simpler.
  2084.  
  2085.  
  2086.   7.2.  Getting mail
  2087.  
  2088.  
  2089.   Here come POP's main drawbacks : the password is sent as a clear text
  2090.   on the network, and some mail readers just don't know POP : you must
  2091.   choose a POP-aware mailer, like Pine, Emacs, Netscape, Mutt ...
  2092.  
  2093.   Password problem can be solved creating a crypted "channel" to have
  2094.   POP on it or using APOP or RPOP extensions. The mail reader problem
  2095.   can be solved either by changing mail reader (mozilla is POP ready, as
  2096.   are Emacs and pine) or by using a POP "mail sucker" with a local mail
  2097.   program.
  2098.  
  2099.   Here're some pop programs worth trying :
  2100.  
  2101.  
  2102.   ╖  gwpop (a Good Way to POP) is very protected since it creates a
  2103.      crypted "channel" and puts mail directly in the "spool" ; however,
  2104.      it depends on Perl.
  2105.  
  2106.   ╖  popclient, simple to use :
  2107.  
  2108.      For exaple if your login is john and your password PrettySecret,
  2109.      you will run :
  2110.  
  2111.  
  2112.  
  2113.   $ popclient -3 -v mail.acme.net -u john -p "PrettySecret" -k -o JOHN-INET-MAIL
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.   ╖  fetchmail, which is actively supported and incredibely simple to
  2120.      use : it is configured in ~/.fetchmailrc, so you only need to run
  2121.      fetchmail when you want to retrive your mail.
  2122.  
  2123.      Here's my .fetchmailrc :
  2124.  
  2125.  
  2126.        poll mail.server protocol pop3:
  2127.                forcecr
  2128.                password PrettySecret;
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134.   Please note forcecr option is needed to use fetchmail with qmail which
  2135.   strictly respects RFCs.
  2136.  
  2137.  
  2138.   7.3.  Sending mail
  2139.  
  2140.  
  2141.   For this, you must use smtp-aware mail software, like qmail, smail,
  2142.   vmail or mozilla (this one does everything : mail reader, POP receive,
  2143.   smtp send !)
  2144.  
  2145.   Go to one of the previous sections to install and configure the one
  2146.   you like best. Then, will you will reach "Testing", try to send some
  2147.   mail to a local account on the mail hub.
  2148.  
  2149.  
  2150.   7.4.  Reading mail
  2151.  
  2152.  
  2153.   If your program doesn't do everything itself, you can install elm,
  2154.   pgp, mush, pine ... many good programs are freely available for linux
  2155.   platforms !
  2156.  
  2157.  
  2158.   7.5.  Testing
  2159.  
  2160.  
  2161.   To check your mail server has pop, try :
  2162.  
  2163.  
  2164.  
  2165.        $ telnet mailhost 110
  2166.  
  2167.  
  2168.  
  2169.  
  2170.   If it works, you will get something like "OK Pop server (...)
  2171.   starting" : type "quit" !
  2172.  
  2173.   To install a ssh crypted "channel", first test your mail server typing
  2174.   :
  2175.  
  2176.  
  2177.  
  2178.  
  2179.   $ ssh mailhost date
  2180.  
  2181.  
  2182.  
  2183.  
  2184.   If you get the date, you should be OK. Please note ssh will not ask
  2185.   for a password, therefore you must create a ".shosts" file on the mail
  2186.   server, containing client's name. To test ssh port redirection (which
  2187.   gwpop uses), type :
  2188.  
  2189.  
  2190.  
  2191.        $ ssh -n -f -L 12314:localhost:110 mailhost sleep 30
  2192.  
  2193.        then
  2194.  
  2195.        $ telnet localhost 12314
  2196.  
  2197.  
  2198.  
  2199.  
  2200.   Then will you hopefully see mail hub's pop banner. If you don't use
  2201.   ssh, don't forget to comment out $ssh on gwpop script. To check
  2202.   whether procmail is running, try "procmail -v"
  2203.  
  2204.  
  2205.   7.6.  Using
  2206.  
  2207.  
  2208.   Now you can edit gwpop Perl script to check everything is ok, then run
  2209.   gwpop :
  2210.  
  2211.  
  2212.  
  2213.        $ gwpop -v your-username
  2214.        POP password on mailhost: yoursecretpasword
  2215.  
  2216.  
  2217.  
  2218.  
  2219.   If gwpop "error messages" are normal, the mail from mail hub will be
  2220.   downloaded to your local machine whereever you told gwpop to put it.
  2221.   (please test with some mail !).
  2222.  
  2223.   You can also use gwpop as a daemon :
  2224.  
  2225.  
  2226.  
  2227.        $ gwpop -d $HOME/tmp your-username
  2228.  
  2229.  
  2230.  
  2231.  
  2232.   gwpop messages are then sent to syslog and gwpop will run endlessly ;
  2233.   a "HUP" signal will force gwpop to get your mail.
  2234.  
  2235.   You can get POP software here used on :
  2236.  
  2237.  
  2238.        ftp://ftp.pasteur.fr/pub/Network/gwpop
  2239.        ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail
  2240.        http://www.cs.hut.fi/ssh/
  2241.  
  2242.  
  2243.  
  2244.  
  2245.   8.  Mail "user agents"
  2246.  
  2247.  
  2248.   This section contains information related to "user agents", which
  2249.   means the software the user sees and uses. This software relies on the
  2250.   "transport agents" mentioned above. Many other mail "User Agents" are
  2251.   available now (pine, mush ...) but I haven't found any linux-specific
  2252.   information to tell on them. Please tell me if I'm missing something !
  2253.  
  2254.  
  2255.   8.1.  Mutt
  2256.  
  2257.  
  2258.   You should have no problem to compile, install or run mutt ; qmail
  2259.   users will either get qmail patch or run it with -f flag to read their
  2260.   local mail folder.
  2261.  
  2262.   If mutt bothers you with an "unknown terminal error" after a
  2263.   distribution upgrading, just recompile it.
  2264.  
  2265.  
  2266.   8.2.  Elm
  2267.  
  2268.  
  2269.   Elm compiles, installs and runs flawlessly under Linux. For more
  2270.   information, see the elm sources and installation instructions. Elm
  2271.   and filter need to be mode 2755 (group mail) with /var/spool/mail mode
  2272.   775 and group mail.
  2273.  
  2274.   Qmail users will get a patch to use nifty qmail features, or will run
  2275.   elm with -f flag to point to ther local mail folder.
  2276.  
  2277.   If you use a binary distribution, you'll need to create a
  2278.   "/usr/local/lib/elm/elm.rc" file to override the compiled-in hostname
  2279.   and domain information:
  2280.  
  2281.  
  2282.   ╖  replace "subdomain.domain" with your domain name replace
  2283.  
  2284.   ╖  "myhostname" with you un-domainized hostname replace
  2285.  
  2286.  
  2287.           #---------- /usr/local/lib/elm/elm.rc ------------------
  2288.           #
  2289.           # this is the unqualified hostname
  2290.           hostname = myhostname
  2291.           #
  2292.           # this is the local domain
  2293.           hostdomain = subdomain.domain
  2294.           #
  2295.           # this is the fully qualified hostname
  2296.           hostfullname = myhostname.subdomain.domain
  2297.           #
  2298.           #--------------------------------------------------------
  2299.  
  2300.  
  2301.  
  2302.   One thing you want to be aware of is that if you have Elm compiled to
  2303.   be MIME enabled, you need metamail installed and in your path or Elm
  2304.   will not be able to read MIME mail you've received. Metamail is
  2305.   available on thumper.bellcore.com and of course via "archie".
  2306.  
  2307.   In the "too cool to be true" category, there is a distribution of
  2308.   Elm-2.4.24 that is "PGP-aware". To try it, grab the file
  2309.   ftp://ftp.viewlogic.com/pub/elm-2.4pl24pgp3.tar.gz, which is elm2.4.24
  2310.   with PGP hooks added. You configure and build it the same way you do
  2311.   normal Elm, which means you probably need to add the patches mentioned
  2312.   above. For what it's worth, I run it here and like it a lot. Of
  2313.   course, there must be more recent versions available, including elm-
  2314.   ME+.
  2315.  
  2316.   While this item is not Linux-specific, it's perceived (wrongly) to be
  2317.   a nagging Elm bug nevertheless.  We've heard that Elm sometimes fails
  2318.   with a message that it's unable to malloc() some massive number of
  2319.   bytes.  The identified workaround is to remove the post-processed
  2320.   global mail aliases (aliases.dir and aliases.pag).
  2321.  
  2322.   THIS IS NOT A BUG IN ELM, it's an error in configuration of Elm by
  2323.   whomever you got your binary distribution of Elm from.
  2324.  
  2325.   Elm has an enhanced and non-compatible, format for aliases ; you need
  2326.   to ensure that the path Elm uses for aliases is different from the
  2327.   path sendmail/smail uses. From the volume of reports of this problem,
  2328.   it's apparent that at least one major distribution 'on the street' has
  2329.   in the past been misconfigured. (from  scot at catzen.gun.de (Scot W.
  2330.   Stevenson) )
  2331.  
  2332.   The current metamail package requires csh for some of its scripts.
  2333.   Failure to have csh (or tcsh) will cause most interesting errors...
  2334.  
  2335.  
  2336.   8.3.  Mailx
  2337.  
  2338.  
  2339.   If you don't have a local mailx program, save yourself the pain : just
  2340.   go and grab the mailx kit from Slackware 2.1.0 or later, which has a
  2341.   nice implementation of mailx5.5. If you're into building from sources,
  2342.   mailx v5.5 compiles without patching under Linux if you have "pmake"
  2343.   installed.
  2344.  
  2345.   If anybody is still using it, I strongly recommend removing the old
  2346.   "edmail" stuff from SLS1.00 and replacing it with mailx.
  2347.  
  2348.  
  2349.   8.4.  Other user agents
  2350.  
  2351.  
  2352.   The following also are known to run under Linux.  Consult "archie" for
  2353.   details regarding how to find them...
  2354.  
  2355.   ╖  mutt    - by far better than elm, very easy to use
  2356.  
  2357.   ╖  pine      - from the Univ. of Washington
  2358.  
  2359.   ╖  metamail  - allows MIME support
  2360.  
  2361.   ╖  mh        - yet another way to handle mail
  2362.  
  2363.   ╖  deliver   - file/process mail based on rules
  2364.  
  2365.   ╖  procmail  - file/process mail based on rules
  2366.  
  2367.   ╖  majordomo - manages e-mail lists
  2368.  
  2369.   ╖  mserv     - provide files-by-mail
  2370.  
  2371.  
  2372.   9.  Acknowledgements
  2373.  
  2374.  
  2375.   The following people have helped in the assembly of the information
  2376.   and experience that helped make this document possible:
  2377.   Steve Robbins, Ian Kluft, Rich Braun, Ian Jackson, Syd Weinstein, Ralf
  2378.   Sauther, Martin White, Matt Welsh, Ralph Sims, Phil Hughes, Scot
  2379.   Stevenson, Neil Parker, Stephane Bortzmayer and especially many thanks
  2380.   to Vince Skahan for his huge contribution.
  2381.  
  2382.   If I forgot anybody, my apologies : just Email me !
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393.  
  2394.  
  2395.  
  2396.  
  2397.  
  2398.  
  2399.  
  2400.  
  2401.  
  2402.  
  2403.  
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430.  
  2431.  
  2432.  
  2433.  
  2434.  
  2435.  
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.