Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 1997 23:43:15 +1000 (EST)
From:      Andrew Reilly <reilly@zeta.org.au>
To:        freebsd-questions@freebsd.org
Subject:   Curly sendmail config problem
Message-ID:  <199708291343.XAA23204@gurney.reilly.home>

next in thread | raw e-mail | index | archive | help
Hello,

I have recently installed the "TkRat" MUA on my FreeBSD 2.2.2 system,
and have recently discovered that all was not as fantastic as I first
thought.

The nub of the problem: my From: address is not being re-written
correctly, and I can't find the place to fix it properly.

I believe that the problem has only manifested itself with the
installation of tkrat because tkrat is the first MUA I have installed
that generates a "From:" header field, and I can't find a way to turn
that off.  I think that Tkrat is also the only MUA I have that connects
directly to the localhost SMTP socket to deliver mail, rather than just
running sendmail -t.

I don't want a From: header, because I want sendmail to insert one for
me.

I want sendmail to do it for me because I want it to look my user name
"andrew" up in /etc/userdb.db, and translate it to "reilly@zeta.org.au"
which is the mail address at my ISP.

Along with a mail address, my ISP provides me with a dynamically allocated
IP address which has a real name that is something like
dialup73.syd1.zeta.org.au, and different every time I connect, and so
consequentally not useful as a hostname.  I have therefore assigned my
hostname (gurney.reilly.home, for want of something better) to one of
the 10.0.0.x addresses, and aliased that onto my lo0 (localhost) network
interface.  To make things work without resolv.conf files and so on,
this is all reflected in name server entries set up on my local name
daemon.

Now to stop spam, my ISP (Hi Nick!) has tweaked his sendmail host to
deny connections to any host that lies about its domain name in the
envelope, so I have to make my sendmail lie about it's bogus domain
name so that it looks truthful.  (I think that's the story.)  Anyway,
for a while things have been peachy after telling sendmail to
masquerade as zeta.org.au, and to also masquerade-envelope.

What is happening at the moment is that tkrat is filling out a From:
field with a fully qualified (but deliberately bogus) domain name
andrew@gurney.reilly.home, and sendmail is dutifully translating that
to andrew@zeta.org.au, which is unfortunately the address of another
user on zeta.org.au.  That is, in this situation sendmail is not
performing the user database lookup.

I can think of two "correct" answers to this problem, and one lame one
(that I'm using to get this message out): I just don't know how to
implement either of the correct answers.

The lame one is to tell tkrat to use the correct (external) From:
address.  This is lame because it is a lie in my own domain, that tkrat
compensates for by generating a Sender: field.  It is also lame because
if I ever decided to reply to my own messages, they would have to
be routed to my ISP, rather than be delivered locally.

The "simplest" correct answer is to stop tkrat from generating a From:
header.  None of my other mailers (mail, elm, mutt) seem to do that,
and the From: address ends up right.  I spent this evening poring over
the tkrat documentation and sources, but was unable to figure out how
to do that: I don't really understand tcl syntax, for starters.

The "most" correct answer is to make sendmail do the userdb lookup on
the supplied From: address (after figuring out that it is a local user
address despite being fully qualified).  Unfortunately, sendmail seems
to use extra magic to do userdb lookups, rather than exposing the
mechanism through the .cf file (where there are plenty of other data
base lookups), so I don't know how to get this to happen.  I've thought
of setting up a duplicate access to the userdb map:
Kuserdb btree /etc/userdb
and then adding some sender address re-writing rules to use this, but I
thought that before burning more hours on that effort I would ask the
collected wisdom of the FreeBSD community, the author of tkrat and my
ISP.

I have to say that despite years of experience as a part-time Unix box
admin, it's actually much HARDER to get a system set up properly in a
dial-up environment with only one real user than it was to maintain a
distributed group of 20 users in a fully-connected, university
environment.  Sigh.
 
-- 
Andrew

"The steady state of disks is full."
				-- Ken Thompson





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708291343.XAA23204>