home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / LINUX / HOWTO / mini / mailq.txt < prev    next >
Text File  |  1997-07-07  |  12KB  |  330 lines

  1.  
  2. Mail-Queue v2.00/22 Mar 97/sendmail 8.8.5
  3. Queue Remote Mail + Deliver Local Mail
  4.  
  5. The Configuration Changes Neccessary to Make Sendmail Deliver Local Mail
  6. ***Now*** While Stashing Remote Mail in The Queue Until "I Say So".
  7.  
  8. Authors:    Leif Erlingsson <leif@lege.com>
  9.         Jan P Tietze <jptietze@mail.hh.provi.de>
  10.  
  11. The document is written by two authors. The NON dial-on-demand solutions
  12. part (oldest part) is written by Leif Erlingsson <leif@lege.com>, and the
  13. newer dial-on-demand solutions part is written by
  14. Jan P Tietze <jptietze@mail.hh.provi.de>.
  15.  
  16.  
  17. 1.    NON dial-on-demand solutions PART
  18.  
  19.     Written by Leif Erlingsson <leif@lege.com>.
  20.  
  21.     The original version of this part contained a lot of unnecessary
  22.     stuff.    This is all it takes, really...
  23.  
  24.  
  25. 1.1    Starting sendmail
  26.  
  27.     Slackware et al:    /etc/rc.d/rc.M:
  28.  
  29.       echo "Starting sendmail daemon (/usr/sbin/sendmail -bd -os)    [queue only mode]..."
  30.       /usr/sbin/sendmail -bd -os        # NOT "-bd -q 15m", the "standard" flags! )
  31.  
  32.  
  33.     RedHat et al:        /etc/rc.d/init.d/sendmail.init:
  34.  
  35.         echo -n "Starting sendmail: [queue only mode]"
  36.         daemon sendmail -bd -os        # NOT daemon sendmail -bd -q1h
  37.  
  38.     The -os is not really essential, all it does is this:
  39.  
  40.           SuperSafe [s] Be super-safe when running things, i.e.,
  41.             always instantiate the queue file,  even  if
  42.             you are going to attempt immediate delivery.
  43.             Sendmail always instantiates the queue    file
  44.             before    returning  control  the client under
  45.             any  circumstances.   This   should   really
  46.             always be set.
  47.  
  48.     This should already be configured in the default sendmail.cf anyway.
  49.  
  50.  
  51. 1.2    Configuring sendmail
  52.  
  53.     Serious sendmail users use the m4 source for this. I recommend
  54.     this solution if you ever plan on upgrading sendmail and also
  55.     make anything but trivial changes to sendmail.cf.
  56.  
  57.     If you never intend to fix sendmail so envelope return headers
  58.     et al works even though you might be on dynamic dial in IP or
  59.     something, then you may not need to get the m4 source.
  60.  
  61.  
  62. 1.2.1    Configuring sendmail.cf directly, for trivial configurations
  63.  
  64.     This way of doing things is extremeley version dependent vs.
  65.     sendmail.cf versions. The following solution is *only* valid
  66.     for sendmail-8.8.x.
  67.  
  68.     Edit /etc/sendmail.cf:
  69.  
  70.     # avoid connecting to "expensive" mailers on initial submission?
  71.     O HoldExpensive=True
  72.  
  73.     ... later ...
  74.  
  75.     #####  @(#)smtp.m4    8.33 (Berkeley) 7/9/96    #####
  76.  
  77.     Msmtp,        P=[IPC], F=mDFMuXe, S=11/31, R=21, E=\r\n, L=990,
  78.             T=DNS/RFC822/SMTP,
  79.             A=IPC $h
  80.     Mesmtp,        P=[IPC], F=mDFMuXae, S=11/31, R=21, E=\r\n, L=990,
  81.             T=DNS/RFC822/SMTP,
  82.             A=IPC $h
  83.     Msmtp8,        P=[IPC], F=mDFMuX8e, S=11/31, R=21, E=\r\n, L=990,
  84.             T=DNS/RFC822/SMTP,
  85.             A=IPC $h
  86.     Mrelay,        P=[IPC], F=mDFMuXa8e, S=11/31, R=61, E=\r\n, L=2040,
  87.             T=DNS/RFC822/SMTP,
  88.             A=IPC $h
  89.  
  90.     The important flag above is ``e''. Don't fuss if the other flags
  91.     look different in your file. Keep your flags as-is, only add ``e''
  92.     to your flags according to the above examples, unless it's there
  93.     already. ``e'' marks the mailers as ``expensive''.
  94.  
  95.  
  96. 1.2.2    Configuring sendmail.cf using m4 source
  97.  
  98.     In the following I will, for simplicity, assume that the sendmail
  99.     version is 8.8.5. If you have a different version, replace 8.8.5
  100.     with that version number below! Also, the instructions will not
  101.     work for older versions of sendmail. Get the latest sendmail!
  102.  
  103.     Download the sendmail source.
  104.     Try ``http://WWW.Sendmail.ORG'' or possibly ``ftp.sendmail.org''.
  105.  
  106.     I also recommend that you obtain my patch for allowing envelope
  107.     sender reverse aliasing and other nice stuff to really make you
  108.     take control over your mail environment.
  109.  
  110.     Write to ``Sendmail Patch <sendmail@lege.com>'',
  111.     Subject: ``sendmail-8.8.5'', if 8.8.5 is your sendmail version.
  112.  
  113.     I may also put them up on ``http://www.lege.com'', eventually.
  114.  
  115.     You don't have to get my patches in order to get ``Queue Remote
  116.     Mail + Deliver Local Mail'' to work. My patches solve other
  117.     things. But I just thought this would be a nice place to mention
  118.     them, as many Linux users will find them extremely useful.
  119.     (They will even give you properly working virtual domains, if you
  120.     like. The virtual domains don't have to be ``local''. They will
  121.     give you ``xaliases'', or in other words ``reverse aliasing''.)
  122.  
  123.     Unpack the sendmail source. You may get /usr/src/sendmail-8.8.5/.
  124.     cd /usr/src/sendmail-8.8.5/cf
  125.  
  126.     Now overlay my patch, if you want it, otherwise skip this step:
  127.     If you don't want to use procmail as Local Delivery Agent, save
  128.     away your /usr/src/sendmail-8.8.5/cf/ostype/linux.m4 before
  129.     doing this...
  130.     Save my patch to ``/tmp/sendmail-8.8.5-cf-cpio-idcmu.gz'', then...
  131.     cd /usr/src/sendmail-8.8.5/cf
  132.     gzip -dc < /tmp/sendmail-8.8.5-cf-cpio-idcmu.gz | cpio -idcmu
  133.     If you didn't want to use procmail, write back the saved copy of
  134.     /usr/src/sendmail-8.8.5/cf/ostype/linux.m4 again.
  135.  
  136.     And regardless of if you applied my patch or not, you must make
  137.     sure these lines or very similar ones are added to
  138.     /usr/src/sendmail-8.8.5/cf/cf/yourhostname.smtp.mc
  139.     (but if you applied my patch you may want to investigate filenames
  140.     containing the word ``elijah'', under /usr/src/sendmail-8.8.5/cf):
  141.  
  142.     dnl # Defer Delivery to "expensive" mailers until next time the
  143.     dnl # queue is processed using "O HoldExpensive=True" and make
  144.     dnl # sure smtp mailers are "expensive".
  145.     dnl # (See original "sendmail" book Chapter 30: Options,
  146.     dnl # "Oc - Don't connect to expensive mailers", or
  147.     dnl # 2nd Edition "sendmail" book Chapter 34.8.29,
  148.     dnl # "HoldExpensive (c), Queue for expensive mailers".)
  149.     dnl #                / Leif Erlingsson <leif@lege.com>
  150.     define(`confCON_EXPENSIVE', `True')
  151.     define(SMTP_MAILER_FLAGS, e)
  152.     MAILER(local)dnl
  153.     MAILER(smtp)dnl
  154.  
  155.  
  156. 1.3    The 1.x versions of this document contained Menu support
  157.     suggestions for /var/X11R6/lib/fvwm/system.fvwmrc. I have
  158.     dropped those in the current version, but they are available on
  159.     request:
  160.  
  161.     Write to ``Menu support suggestions <fvwmrc@lege.com>'',
  162.     Subject: ``Menu support suggestions''
  163.  
  164.  
  165.  
  166. 2.    Dial-on-demand solutions PART
  167.  
  168.     Written by Jan P Tietze <jptietze@mail.hh.provi.de>.
  169.  
  170.     Many Linux users access the Internet through a dialup line, and many
  171.     have decided to implement dial-on-demand facilities on their system.
  172.     That is, whenever an IP packet of some sort has to leave the local
  173.     network or the local host, the link to an Internet Service Provider
  174.     (ISP) will automatically be established. The link will be dropped
  175.     after some period of time that no packet has travelled across.
  176.  
  177.     Although this is very comfortable and cost effective, there is one
  178.     special case in which this is neither comfortable (as the time to
  179.     bring up a "traditional" modem dialup is very noticeable) nor cost
  180.     effective, and this is sending e-mail. E-Mail is commonly sent by
  181.     SMTP, either delivered by your own system or through a SMTP host on
  182.     the Internet that usually resides in your ISP's network.
  183.  
  184.     With dialup lines, every time you send a message the link will have
  185.     to be brought up. This is quite okay if you send only one message,
  186.     but if you happen to create and send multiple messages, bringing up
  187.     the line more than once can be tedious and cost ineffective. Also,
  188.     if your ISP imposes limits as to what times you are allowed to
  189.     login, this would also restrict you to postpone messages at certain
  190.     times of the day, and you would have to manually send them later.
  191.  
  192.     Section 1 of this document will solve the situation, however in
  193.     situations where an external DNS lookup would cause the link up, the
  194.     link will still be established even if e-mail is just being queued.
  195.     The reason is that sendmail wishes to "canonify" host names.
  196.  
  197.     The solution to this problem is twofold: First, we'll have to
  198.     moderately change sendmail.cf. And then we have to define the
  199.     process of actual mail delivery. Personally, I prefer to have cron
  200.     do the job for me and describe the necessary changes below.
  201.  
  202. 2.1    Configuring sendmail.cf
  203.  
  204.     For the reasons stated in [1.2], I recommend modifying the m4
  205.     sources instead of editing sendmail.cf directly. It will actually
  206.     save you a lot of hassle and make configuration changes more
  207.     verbose.
  208.  
  209.     First, perform all the changes described in the first part of this
  210.     document. Then go through the dial-on-demand specific stuff.
  211.  
  212. 2.1.1    Conf