[[EMAIL PROTECTED] writes:]
>I would really like to know what the heck MAILHOST and friends are doing.
Me too, and I'd like to thank Mate for asking these questions here,
after having privately offered me help in response to my queries
(and suggesting I try the experiment he's since tried himself, before
I got to it, the results of which confuse him, so I'm not the only
one ;-).
>The only way I can change the domain part of the envelope sender's
>address for Emacs, if I put oki.doki in defaulthost.
Strangely, this didn't help me. That is, back when I was using
MAILHOST=jcb-sc.com, I also had jcb-sc.com as the entry in
defaulthost, but email sent from Emacs had "Return-Path: [EMAIL PROTECTED]",
though the "From:" address was fine.
>What is going on?
The man page for qmail-inject strongly implies QMAILHOST and MAILHOST
are treated exactly the same way, which is why I tried MAILHOST and
gave up (and queried here) when it didn't affect Return-Path as I'd
hoped it would.
If there's indeed no difference in how these environment variables are
treated by qmail-inject, I'd suspect something in the way Emacs sets
up the environment for sending mail, or the sendmail (stub?) it invokes.
Okay, I've just tried various combination of things using just qmail-inject.
It seems like MAILHOST and QMAILHOST indeed do override defaulthosts and
affect both From: and Return-Path: in exactly the same way, and QMAILSHOST
also works (changes the Return-Path header, but not the From header
composed by qmail-inject).
So, my guess is that the sendmail program Emacs uses when sending mail
isn't obeying defaulthost as expected. When I use it without MAILHOST,
QMAILHOST, and QMAILINJECT defined, even though defaulthost=jcb-sc.com, I
get email with both From and Return-Path set to deer.jcb-sc.com. If
I restore QMAILINJECT=f, that fixes the From but not the Return-Path.
Now, setting MAILHOST=xxx.yyy sets the From field accordingly (in email
sent from within Emacs), but leaves the Return-Path field unchanged.
Same thing for QMAILHOST! Hey, to heck with this guessing, I'm going
to try a new approach.
First, I've now appended "defaulthost" to the name in defaulthost,
"defaultdomain" to the name in defaultdomain, and "me" to the name in
"me", just so I can see from where these names come.
Now, with nothing seemingly pertinent in my environment:
[root@deer /root]# echo hey | qmail-inject -n
Return-Path: <[EMAIL PROTECTED]>
Date: 20 Jan 1999 16:32:29 -0000
Message-ID: <[EMAIL PROTECTED]>
From: [EMAIL PROTECTED]
Cc: recipient list not shown: ;
hey
So, we can see where these names come from.
Now I'll try sending an email from within Emacs in the same environment:
Return-Path: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
Received: (qmail 6125 invoked by uid 0); 20 Jan 1999 16:34:17 -0000
Date: 20 Jan 1999 16:34:17 -0000
Message-ID: <[EMAIL PROTECTED]>
From: root <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: test
(I had to pull this out of ~alias/pppdir, natch.)
Isn't that interesting? When sending email from within Emacs, its
the defaultdomain, not defaulthost, that gets used, and the host
name gets prepended. (I'd already unset HOSTNAME to get it out of
my environment for the moment.) But that applies only to From and
Return-Path, not To.
Adding QMAILINJECT=f to my environment changes only the Emacs-sent
>From field, but not Return-Path.
Further adding MAILHOST=xxx.yyy affects both the From and Return-Path
headers using qmail-inject directly, but only the From using Emacs-send.
Replacing MAILHOST with the same QMAILHOST definition has the exact same
effect, so these indeed do behave similarly.
Defining QMAILSHOST seems to have no effect whatsoever on the Emacs-send
case!
Well, at this point, I'm indeed stumped, especially since I *thought*
I'd gotten it working yesterday. Probably just a matter of restoring
my control files and /etc/profile, though I've just tried that, and
it doesn't seem to have worked.
Anyway, it seems as though the qmail-inject stuff is, on its own, working
fine. Perhaps only the /var/qmail/bin/sendmail program needs some
fixing, or some documentation, or something. Meanwhile, I've got to get
some lunch.
tq vm, (burley)