[comp.mail.sendmail] Basic address rewriting?

greg@carnivore.tamu.edu (Greg Economides) (05/22/91)

I am a sendmail novice.  I have sendmail running on our Sun Sparc 1+.
There are a couple of machines that people in our group send mail to
regularly that we need (at least it seems like we need) to route through
uunet.uu.net.  Is it possible/wise/a-good-idea to put a rule in the
sendmail.cf file to rewrite address of the form:
	someone@this.dang.machine.com

to be of the form:

	someone%this.dang.machine.com@uunet.uu.net

so that the users don't have to do their own routing like this?  Is there
a better solution to the problem?  It seems that, mostly, the machines
with a .com domain are the ones that sendmail has trouble handling without
sending it through uunet.  Could it be that some other problem is causing
this behavior?

Suggestions, insite and hand-holding are greatly appreciated.

Pax,


--
Greg Economides                          "This sentence is false" 
Technical Lab Coordinator 
Texas A&M University -- Biosystems Modelling Group
Internet: greg@carnivore.tamu.edu

rickert@mp.cs.niu.edu (Neil Rickert) (05/22/91)

In article <16400@helios.TAMU.EDU> greg@carnivore.tamu.edu (Greg Economides) writes:
>uunet.uu.net.  Is it possible/wise/a-good-idea to put a rule in the
>sendmail.cf file to rewrite address of the form:
>	someone@this.dang.machine.com
>
>to be of the form:
>
>	someone%this.dang.machine.com@uunet.uu.net
>
>so that the users don't have to do their own routing like this?  Is there

 That is a terrible idea, for two reasons:

  1.  You may be unnecessarily burdening uunet.uu.net
  2.  It is a hack partial solution at best.

 Your real problem is that you are using a version of 'sendmail' which
does not understand MX records.

 Solutions:
  Easy:- Find a host on your campus (Texas A & M ??) which can handle these
	 addresses, and set up you mail system to relay ALL outbound mail
	 through that host.  Obviously you must get permission first, and if
	 so, the admin of the relay system can probably help you with the
	 setup.

  General:-  Look in /usr/lib.  You will find there are two executables with
	 names that look like sendmail.  One is called 'sendmail' and
	 the other is called 'sendmail.mx'.  You will need to start using
	 the second one.

		cd /usr/lib
		mv sendmail sendmail.nomx
		ln sendmail.mx sendmail

	  Now do some tests on your 'sendmail.cf'.  As a result of the
	  different version the automatic definition of $w and $j may have
	  changed.  You will have to make the needed adjustments so that it
	  works correctly.

	  When you have it working, kill and restart the sendmail daemon.

	  (I do assume you have access to a nameserver).


-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940

rbraun@spdcc.COM (Rich Braun) (05/22/91)

rickert@mp.cs.niu.edu (Neil Rickert) writes:
>  Easy:- Find a host on your campus (Texas A & M ??) which can handle these
>	 addresses, and set up you mail system to relay ALL outbound mail
>	 through that host.

Neil, could you post a sample MX description line which would accomplish
this for non-Internet-connected sites?  The 'named' documentation I have,
frankly, sucks.  I could easily enough figure out what the NIC would
put in to the Internet-wide name server descriptions to set up one or
two systems as relays for my site, but I can't figure out what my local
name server needs to know in order to set up one of the systems as a
relay for non-local mail.

I'd also like to hear from anyone who is using SCO Unix systems on a
LAN, who has had to set up e-mail.  SCO sets things up to use MMDF, which
I have found is the only known software more complex than sendmail.  But
MMDF, as far as I can figure out, is not compatible with sendmail, so
I ended up setting things up to use both.  And I'm rather confused.

Thanks,
-rich

rickert@mp.cs.niu.edu (Neil Rickert) (05/22/91)

In article <7604@spdcc.SPDCC.COM> rbraun@spdcc.COM (Rich Braun) writes:
>rickert@mp.cs.niu.edu (Neil Rickert) writes:
>>  Easy:- Find a host on your campus (Texas A & M ??) which can handle these
>>	 addresses, and set up you mail system to relay ALL outbound mail
>>	 through that host.
>
>Neil, could you post a sample MX description line which would accomplish
>this for non-Internet-connected sites?  The 'named' documentation I have,

  My comments above assumed the question (from TAMU.EDU) originated at
an Internet site.

  If you are not directly on Internet, the best advice is for you to find a
willing host on Internet through which you can forward with UUCP.  When
you do this you are at the mercy of your connecting links, and the way they
rewrite (or destroy) your address.  If your UUCP neighbors destructively
munge your addresses so that they are unuseable when they reach Internet hosts,
it might be worthwhile paying the costs to have a more reliable UUCP feed.

  If it is possible to hand address messages to reach Internet sites, it
should be possible to arrange for sendmail to do it automatically.  However
it might not be particularly easy.  If you are comfortable with installing
new software, an effective approach might be to pick up the IDA version of
sendmail from uxc.cso.uiuc.edu (or probably available on uunet).  The support
for pathalias output allows a lot of automatic routing through the UUCP maps.
You should be able to use this without having to hack on 'sendmail.cf'.
Over the last few months Paul Pomes, at UIUC, has done a lot of work on the
code to improve compatibility with a variety of flavors of Unix.

  For other approaches, I have limited experience.  It is always possible to
concoct your own modified version of the UUCP mailer, with its own rewrite
rules, to do the routing for you.  It would be nice if vendors supplied
versions which could be easily used.  My main experience has been with
SunOS and with SGI.

  On the SunOS system, you can use 'sendmail.main.cf' as your configuration.
If you have your domainmane and hostname setup as Sun recommends, then you
mostly need to define the relay mailer to be 'smartuucp', and the relay
host to be your uucp link to Internet.  Unfortunately, the standard Sun
setup is such that the return address from out Geology Department finishes up
looking something like 'earth!geol.niu.edu!user'  which my mailer would
normally reformat into 'earth!geol.niu.edu!user@mp.cs.niu.edu', instead of
the much more friendly 'user@geol.niu.edu'.  It would have been possible to
correct this on the Sun with some modifications to 'sendmail.cf'.  However,
since I didn't want to have to repeatedly do this every time a new SunOS
upgrade is installed, I wound up modifying my own sendmail to do some
pruning of superfluous routing on the return address.

  On the SGI system in our Chemistry department, we only had to follow the
instructions in 'sendmail.cf' to define my host's UUCP name as the Internet
relaying host, and everything immediately dropped into place and the system
started providing good header and return addresses.  (Constructing an
'expect/send' script for a uucp login was a different, and painful matter,
though).

  If you are more than one UUCP hop from Internet, things are tricky.  In
the best of worlds, you have a UUCP neighbor who has already solved the
problem of routing Internet addresses.  In that case you should only need
to get the mail to that host.  In less favorable circumstances you will
need to construct routes through UUCP maze yourself.  It is hard to give
good advice, except to look into IDA, and/or to look into getting yourself
a direct UUCP link to a well run host on Internet.

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert@cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115                                   +1-815-753-6940