Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!emory!utkcs2!betelgeuse!moore From: moore@betelgeuse.cs.utk.edu (Keith Moore) Newsgroups: comp.mail.sendmail Subject: Re: sendmail from inetd? Summary: those who do not understand UNIX are destined to reinvent it, poorly Message-ID: <1991Jan6.011903.5309@cs.utk.edu> Date: 6 Jan 91 01:19:03 GMT References: <8653@uwm.edu> <1991Jan03.092822.20859@turnkey.tcc.com> Sender: news@cs.utk.edu (USENET News System) Reply-To: moore@cs.utk.edu (Keith Moore) Organization: CS Dept -- University of TN, Knoxville Lines: 64 In article <1991Jan03.092822.20859@turnkey.tcc.com> jackv@turnkey.TCC.COM (Jack F. Vogel) writes: >In article <8653@uwm.edu> jgreco@archimedes.math.uwm.edu (Joe Greco) writes: >>I was wondering if anybody has tried the following: >> >>Can sendmail be run from inetd? sendmail has the option to run SMTP on >>stdin/out, and if possible, I'd like to run it that way instead of "-bd". > >>Sendmail: v5.65 (mx, no IDA). >>System: IBM 6152 RT's running a modified AOS4.3 (very close to BSD) > >Odd that you should ask this! sendmail on AIX has this capability and my >question always was why someone would want to introduce this "feature":-}. >The quick answer to your question is 'NO' you cannot do this without code >change. That's rather odd. Here's an excerpt from our local document on adapting UNIX systems to the UTK environment: ------------------------------------------------------------------------------ [optional] To avoid the overhead of always having sendmail running, you can start sendmail from inetd and cron. To do this: 1. Create an executable shell script named /usr/etc/smtpd as follows: #!/bin/sh exec /usr/lib/sendmail -bs 1>&0 2>&0 2. Add the following line to /etc/inetd.conf: smtp stream tcp nowait root /usr/etc/smtpd (Syntax may be different for your system. See man inetd for details) 3. Add the following line to the crontab file: 15 * * * * /usr/lib/sendmail -q (The exact syntax varies from system to system.) This entry is required in case sendmail is not able to deliver messages immediately. Normally the main sendmail process takes care of periodically retrying queued messages; but since sendmail is not running all of the time now, we have to do this explicitly from cron. The above example runs the queue once per hour -- you might want to do it less often. 4. Comment out the startup code for sendmail in /etc/rc.local (or whatever). 5. If sendmail is running now, kill it. Also send a HUP signal to inetd. 6. Try it by telnet-ing to the local SMTP port and sending a piece of mail. ------------------------------------------------------------------------------ This works fine on 6150 RTs under 4.3, although we put the smtpd program in /etc instead of /usr/etc. It should work on any Berkeleyish system, modulo differences in crontab and inetd syntax. Of course it does have the overhead of firing up the shell and doing an extra exec, but the assumption is that you don't receive a message very often on your workstation. Our sendmail.cf file rewrites all outgoing mail to be from user@cs.utk.edu, so replies go to the mail server rather than the workstations. For the occasional message that does get sent directly to the workstation (ignoring MX records), the above hack works just fine. Keith Moore / U.Tenn CS Dept / 107 Ayres Hall / Knoxville TN 37996-1301 Internet: moore@cs.utk.edu BITNET: moore@utkvx ``Paranoia is a drug which is more dangerous than any controlled substance.''