nmh-workers
[Top] [All Lists]

Re: Hiding one's email source username/hostname/ISP

2021-03-16 01:45:14
On Sun, 14 Mar 2021 14:00:01 -0400 Ken Hornstein <kenh@pobox.com> sez:

Right.  I was hopeful that even that could be hidden.  For
example, if I use the Gmail web interface, the Received: headers
indicate that it came from Gmail itself (which makes sense).  I
was thinking it'd be useful to replicate that, even when I'm
actually sending it from my laptop _via_ the Gmail servers.

Unfortunately, that decision is up to Gmail; that's not
something we have control over.

Yeah ... it makes sense!

I use the "clientname" option because otherwise it is set to
"localhost.localdomain" (since I don't use "localname"), and that
has been shown to be a huge red spam flag.

But, I think I should not use the "localname" option.

If I correctly understand the implication of using it --
specifically, "the hostname nmh considers local" -- then I think
this would be problematic, as the alternative "local hostname"
I'd want to specify would be "gmail.com."  But then, any time I
email "foo@gmail.com," NMH would try to deliver that locally
instead of sending it to the Gmail server, no?  That'd result in
100% bounces, since not even my own Gmail username, "dnc2dnc," is
a valid login ID on my laptop.  I suppose "bob@gmail.com" would
work, except I don't know them and so don't email them except by
accident.  B-)

So, we don't really do a wonderful job of explaining what
"localname" does, because ... it's kind of complicated.  But,
since you asked ...

I should know by now that nothing is ever simple with NMH.  B-)
But that's because it's to handle _email_.

There's a function called "LocalName()" in nmh.  It returns ...
the local name of the host.  It takes a single argument, an
integer flag.  If the flag is 0, it will return the local
hostname, EXCEPT if localname is configured.  Then it returns
the value of localname.  If the flag is non-zero, then it
returns the fully qualified local hostname (the output of
gethostname() run through getaddrinfo() with AI_CANONNAME set).
If for some reason you have localdomain set, then that will be
appended to the local hostname.

LocalName() is called with a flag value of '0' in all
instances, with the exception of two cases:

-  When a default value is used for clientname
-  When a message-id is constructed (and you haven't overriden
   how message-ids are generated).

The most consequential result of "localname" is the
construction of email addresses.  Nmh's default idea of your
email address is %(me)@%(myhost); if you change localname, that
changes "myhost".  It's also used in the address parser as
"default" host in a few places.  But that's the biggest change.

But ... it doesn't affect mail delivery _at all_.  Unless you
explicitly configure it (and doing that is possible, but it can
be complicated; you would have had to do some extra work), nmh
does not distinguish between "local" and "remote" messages.  If
you tell it to deliver your email to gmail, that's what it's
going to do regardless of how you configure "localname".  Once,
very long ago, nmh (and MH) tried to be a little more
intelligent about this sort of thing but it just made the
address parser more complicated and caused many problems, so
now unless you do extra work everything is delivered via your
chosen submission method.  So feel free to use localname if you
really want to (but I would personally recommend using
Local-Mailbox in your .mh_profile).

Thanks for this (long) explanation, Ken!  That helped clarify a
couple of things for me.

I do use "Local-Mailbox" in my ~/.mh_profile, which was a change
recommended by this list a few years back (probably by you, Ken).
To be clear, I do _not_ use either "localname" or "clientname."

I also misstated my _current_ setup, based on my memory of what
it was for a long time -- which was to have some emails that I
would send to myself to be processed 100% locally (i.e. sending
it to user "bob" -- no "@<domain>" -- and using sendmail).  I
don't do that anymore, at least not when using NMH (and even then
I was sending via Berkeley mail and sendmail, and not NHM).

But it helps to know that if, for some reason, I did try using
NMH to send email to "bob" that it would still (based on my
configuration, which is to send emails via SMTP to Gmail) not do
any special "local user" processing, that it would send that to
the Gmail servers (and probably be rejected, or be sent to
"bob@gmail.com" ... which I've mistakenly done before B-).

_sigh_  Email is _so_ complicated.  Why did I ever agree to be my
own sysadmin?  B-)

                                Bob

<Prev in Thread] Current Thread [Next in Thread>