> In other words, it basically runs
>
> /usr/lib/sendmail -oi -f USER -oem -edb -t
>
> where USER is your login name.
>
>And I have to correct myself: even an entry in defaulthost does not
>help. The correct line I think is
>
> /usr/lib/sendmail -oi -f USER -oem -odb -t
I don't seem to have `sendmail' available as a man page...could you
give me a quick idea of whether that is, indeed, the right fix, and
what it means?
No, I did not mean that it fixes things. I meant this is the command
Emacs runs to send mail. And the problem is the `-f' flag: it just
sets the envelope sender. I do not have any idea about the other
flags, since, as you pointed out, there is no man page for sendmail in
the qmail distribution---hopefully will be fixed for the next release.
But right now I am home, and I can confirm: here putting a domain name
in defaulthost does have the desired effect! My setup is
RH GNU/Linux 4.2, qmail-1.01 and Emacs 20.2.
So I made some investigation, and the point is that sendmail.el is
different in 20.2. Applying either of the following patches makes
control/defaulthost work:
--- sendmail.el.old Wed Jan 20 21:12:49 1999
+++ sendmail.el Wed Jan 20 21:02:42 1999
@@ -888,7 +888,7 @@
;; since some systems have broken sendmails.
;; unless user has said no.
(if (memq mail-from-style '(angles parens nil))
- (list "-f" user-mail-address))
+ (list "-f" (user-login-name)))
;;; ;; Don't say "from root" if running under su.
;;; (and (equal (user-real-login-name) "root")
;;; (list "-f" (user-login-name)))
--- sendmail.el.old Wed Jan 20 21:12:49 1999
+++ sendmail.el Wed Jan 20 21:26:30 1999
@@ -887,8 +887,8 @@
;; Always specify who from,
;; since some systems have broken sendmails.
;; unless user has said no.
- (if (memq mail-from-style '(angles parens nil))
- (list "-f" user-mail-address))
+; (if (memq mail-from-style '(angles parens nil))
+; (list "-f" user-mail-address))
;;; ;; Don't say "from root" if running under su.
;;; (and (equal (user-real-login-name) "root")
;;; (list "-f" (user-login-name)))
With the second patch, I also verified that QMAILHOST works.
I have a feeling that the second patch is the cleaner one: it will not
break anything when using qmail, while I have no idea about the
implications of the first one.
Mate