Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!wuarchive!zaphod.mps.ohio-state.edu!mips!daver!dlr From: dlr@daver.bungi.com (Dave Rand) Newsgroups: comp.mail.uucp Subject: Re: How efficient/fast is uucp? Message-ID: <1990Aug27.021817.26499@daver.bungi.com> Date: 27 Aug 90 02:18:17 GMT References: <1556.26d282ea@dcs.simpact.com> <1990Aug25.193329.13643@m2xenix.psg.com> Organization: Association for the Prevention of Polar Bears and Kangaroos Lines: 219 In article vixie@decwrl.dec.com (Paul A Vixie) writes: >If I generate a BSMTP file, it will have in it exactly one mail transaction. >This is the same as for "rmail". What's needed is a way to get many of >these concat'd together into a single UUCP request, and since they can >be uux'd at different times (up to the uucico interval), sendmail is not >the place to put the concat logic. smail3 does this right now. The transport to use is "batch_smtp". This places all outgoing messages into a special directory (user configurable), which can be queued for transmission later. Further, and better, you can compress these mail batches, for reduced size (really helps, folks!). I run this to 4 sites now, and have been running it for about 6 months now. Works great, and significantly reduces the amount of transfer time for mail on Trailblazers. Now, if we can only convince UUNET to allow this... Anyway, here's how you set it up for smail3. First, you need to add a new transport to the smail configuration file. Edit your /usr/local/lib/smail/transports (or wherever you have located the smail3 configuration files), and add: # accumulate messages into a directory on a per-host basis batch_smtp: # the appendfile driver can also accumulate in directories driver=appendfile, hbsmtp; # half-baked BSMTP, no HELO or QUIT # files whose names begin with `q' will be placed here: dir=/usr/spool/smail/outq/${lc:host}, user=uucp, # files will be owned by this user mode=0600, # and unreadable by other users Feel free to change the directory as appropriate. Now, you have to have a way for smail3 to know that a specific host should use this transport. This is done using a methods file, although I suppose you could hard-code it, if you wanted to. Edit your /usr/local/lib/smail/routers and change all the transport = xxx to "method = methodfilename". I use the name "uucp" for uucp-type transports, and "smtp" for smtp-type tranports. If you are running a uucp-only site, they perhaps my routers file will do the right thing for you; here it is: # /usr/local/lib/smail/routers # This file defines the configuration of the router subsystem as # compiled into the smail binary. By modifying the source files # conf/EDITME, src/config.h or src/default.c the actual internal # configuration can be changed. Thus, this should be matched up # against thes files before assuming this is completely correct. # paths - route using a paths file, like that produced by the pathalias program paths: driver = pathalias, # general-use paths router method = uucp; # transport = uux; # for matches, deliver over UUCP file = smap, # sorted file containing path info proto = lsearch, # use a linear search (small file) optional, # ignore if the file does not exist domain = uucp # strip ending ".uucp" before searching paths: driver = pathalias, # general-use paths router method = uucp; # transport = uux; # for matches, deliver over UUCP file = paths, # sorted file containing path info proto = bsearch, # use a binary search optional, # ignore if the file does not exist domain = uucp # strip ending ".uucp" before searching # uucp_neighbors - match neighbors accessible over UUCP uucp_neighbors: driver = uuname, # use a program which returns neighbors method = uucp; # transport = uux; cmd = /usr/bin/uuname, # specifically, use the uuname program domain = uucp # smart_host - a partically specified smarthost director # # If the config file attribute smart_path is defined as a path from the # local host to a remote host, then hostnames not matched otherwise will # be sent off to the stated remote host. The config file attribute # smart_transport can be used to specify a different transport. # # If the smart_path attribute is not defined, this router is ignored. smart_host: driver = smarthost, # special-case driver transport = uux # by default deliver over UUCP ----------------------------------------------------------------------- Note that instead of "transport = uux", I have "method = uucp". This tells smail3 to look in the /usr/local/lib/smail/methods/uucp file to see what type of transport it should use for each host. Here is what I use: apt uusmtp cheers batch_smtp chips demand_uusmtp dlb batch_smtp indetech uusmtp interex uusmtp kcdev batch_smtp lynx batch_smtp mips demand news demand_uusmtp sun demand tscs uusmtp uop uusmtp uunet biguux vw26 demand_uusmtp wombat demand * uux ----------------------------------------------------------------- Note that the last line of the file is "* uux". This is required, since smail3 must have some way of getting to a host that is not listed. The "*" matches any host name not previously matched. Anyway, that's it! You are now set up such that outgoing mail messages for the site(s) in question end up in a special spool directory. You can just cat these files together and compress them, feed the result to uux, and you are done. I do this once per hour on my site. I also have another neat trick though - when those sites that run compressed smtp mail log in, I queue all the mail waiting for them before execing uucico. This is all done with a single do-it-all script: #!/bin/sh # @(#)cbsmtp.sh 1.1 7/10/88 02:00:54 . /etc/TIMEZONE # deliver messages accumlated into subdirectories of the # outq spool directory. Subdirectory names are based on # the actual hostnames involved: OUTQ=/usr/spool/smail/outq UUX=/usr/bin/uux LOCALHOST=daver.bungi.com COMPRESS=/usr/bin/compress cd $OUTQ NAME=x case "$LOGNAME" in Ucheers) NAME=cheers ;; Ulynx) NAME=lynx ;; Udlb) NAME=dlb ;; Ukcdev) NAME=kcdev ;; esac if [ "$NAME" != "x" ] then cd $NAME list=`echo q*` # get the list of message files if [ "$list" = "q*" ]; then # no messages were found exit 0 # leave sub-shell fi # compress all of the files, adding HELO and QUIT commands (echo "HELO $LOCALHOST" cat $list echo QUIT) | $COMPRESS | $UUX -r - $NAME!rcsmtp exit 0 else # loop through all of the subdirectories for i in *; do ( cd $i list=`echo q*` # get the list of message files if [ "$list" = "q*" ]; then # no messages were found exit 0 # leave sub-shell fi # compress all of the files, adding HELO and QUIT commands (echo "HELO $LOCALHOST" cat $list echo QUIT) | $COMPRESS | $UUX -r - $i!rcsmtp rm $list ); done fi exit 0 -------------------------------------------------------------- And that does it for outbound. Incoming compressed smtp mail is handled by another simple shell script "rcsmtp": #!/bin/sh # @(#)rcsmtp.sh 1.1 G% 02:01:01 # Receive compressed batches of SMTP commands and send them # to smail. # the following line should be changed to reflect the # organization of your system. /usr/bin/compress -d | /usr/bin/rsmtp exit 0 ---------------------------------------------------------------- Nothing to it. smail3 is simple, configurable, works on nearly all systems, and doesn't have a sendmail.cf file! What more could you want :-) Drop me mail if you have questions... -- Dave Rand {pyramid|mips|bct|vsi1}!daver!dlr Internet: dlr@daver.bungi.com