Subject: Re: Sendmail in weird environment
To: None <port-mac68k@netbsd.org>
From: Chris Brown <cblist@cityb.net>
List: port-mac68k
Date: 11/01/1999 17:47:01
On Mon, Nov 01, 1999 at 12:34:51PM -0800, David A. Gatwood wrote:
> 
> I'm trying to get sendmail working in a rather hostile environment.  The
> campus network admins won't allow smtp traffic from residence hall
> connections because too many people haven't upgraded sendmail to turn off
> relaying, and they didn't want to become the next netcom (spam haven).
> 
> Unfortunately, I have a number of scripts, etc. that depend on being able
> to send mail to non-local users.  So, I've set up an ssh port forwarding
> tunnel between the smtp port on the machine and the smtp port of a machine
> on my work network.  That means that any program that actuall uses the
> smtp port will be able to deliver mail.
> 
> Problem is all my scripts call sendmail and send-mail bone-headedly
> assumes that it shouldn't use smtp for delivering messages to local users,
> even if I specify a FQDN.  I've tried every parameter I could think of
> trying to override this behaviour and force it to use smtp for local users
> to no avail.
> 

I don't know what version of sendmail 1.4.1 ships with (I seem to remember
that that's what you have installed). 8.9.3 by default looks toward
/etc/mail/virtusertable for a virtual user table. Following is a little
snippet from /usr/doc/sendmail/README.cf (on my linuxppc-R5 machine, which
uses sendmail 8.9.3):

---BEGIN snip----

virtusertable   A domain-specific form of aliasing, allowing multiple
                virtual domains to be hosted on one machine.  For example,
                if the virtuser table contained:

                        info@foo.com    foo-info
                        info@bar.com    bar-info
                        @baz.org        jane@elsewhere.net

                then mail addressed to info@foo.com will be sent to the
                address foo-info, mail addressed to info@bar.com will be
                delivered to bar-info, and mail addressed to anyone at
                baz.org will be sent to jane@elsewhere.net.  The username
                from the original address is passed as %1 allowing:

                        @foo.org        %1@elsewhere.com

                meaning someone@foo.org will be sent to someone@elsewhere.com.

                All the host names on the left hand side (foo.com, bar.com,
                and baz.org) must be in $=w.  The default map definition is:

                        hash -o /etc/virtusertable

                A new definition can be specified as the second argument of
                the FEATURE macro, such as

                      FEATURE(`virtusertable', `dbm -o /etc/mail/virtusers')

---END snip----

You could create a mapping from a local user to your remote host like this:

localuser	remoteuser@remotehost.com