Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Cc: ding@gnus.org
Subject: Re: smtpmail: MAIL FROM and `gnus-posting-styles'
Date: Tue, 24 Sep 2002 22:42:31 +0200	[thread overview]
Message-ID: <ilu7khbktl4.fsf@latte.josefsson.org> (raw)
In-Reply-To: <87smzzxsy3.fsf@ID-56226.news.dfncis.de> (Micha Wiedenmann's message of "24 Sep 2002 18:59:54 +0200")

Micha Wiedenmann <mw-u1@gmx.de> writes:

> So the problem is more precise: Wenn From is changed with respect to the
> value gnus-posting-styles would applie the changed From doesn't have any
> influence on MAIL FROM.

Yup.  This is the intended behaviour, I think.  Some people might not
like it though...

> I think this is a good solution for message-send-via-smtp! This is
> simple, elegant and straightforward! (I often tend to see things to
> difficult :-)

...so they can use the following patch and customize
`mail-envelope-from' to the symbol header.  Please test it, against
s{end,mtp}mail.el in Emacs CVS.

Index: sendmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/sendmail.el,v
retrieving revision 1.257
diff -u -p -u -w -r1.257 sendmail.el
--- sendmail.el	2 Sep 2002 17:24:54 -0000	1.257
+++ sendmail.el	24 Sep 2002 20:38:00 -0000
@@ -82,6 +82,7 @@ If this is nil while `mail-specify-envel
 content of `user-mail-address' is used."
   :version "21.1"
   :type '(choice (string :tag "From-name")
+		 (const :tag "Use From: header from message" header)
 		 (const :tag "Use `user-mail-address'" nil))
   :group 'sendmail)
 
@@ -775,6 +776,13 @@ the user from the mailer."
 	      (set-buffer-modified-p nil)
 	      (delete-auto-save-file-if-necessary t))))))
 \f
+(defun mail-envelope-from ()
+  "Return the envelope mail address to use when sending mail.
+This function uses `mail-envelope-from'."
+  (if (eq mail-envelope-from 'header)
+      (mail-fetch-field "From")
+    mail-envelope-from))
+\f
 ;; This does the real work of sending a message via sendmail.
 ;; It is called via the variable send-mail-function.
 
@@ -821,7 +829,7 @@ external program defined by `sendmail-pr
 	;; local binding in the mail buffer will take effect.
 	(envelope-from
 	 (and mail-specify-envelope-from
-	      (or mail-envelope-from user-mail-address))))
+	      (or (mail-envelope-from) user-mail-address))))
     (unwind-protect
 	(save-excursion
 	  (set-buffer tembuf)
Index: smtpmail.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/mail/smtpmail.el,v
retrieving revision 1.48
diff -u -p -u -w -r1.48 smtpmail.el
--- smtpmail.el	12 Sep 2002 06:03:03 -0000	1.48
+++ smtpmail.el	24 Sep 2002 20:38:19 -0000
@@ -689,7 +689,7 @@ This is relative to `smtpmail-queue-dir'
 		     "")))
 ;	      (smtpmail-send-command process (format "MAIL FROM:%s@%s" (user-login-name) (smtpmail-fqdn)))
 	      (smtpmail-send-command process (format "MAIL FROM: <%s>%s%s"
-						     (or mail-envelope-from
+						     (or (mail-envelope-from)
 							 smtpmail-mail-address)
 						     size-part
 						     body-part))




      reply	other threads:[~2002-09-24 20:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-17 14:37 Micha Wiedenmann
2002-09-17 17:00 ` Simon Josefsson
2002-09-17 20:47   ` Bjørn Mork
2002-09-19 14:25     ` Micha Wiedenmann
2002-09-19 17:30       ` Kai Großjohann
2002-09-21  0:42         ` Micha Wiedenmann
     [not found]       ` <mit.lcs.mail.ding/87r8fq18bs.fsf@ID-56226.news.dfncis.de>
2002-09-23 19:20         ` Patrick J. LoPresti
2002-09-24 11:44       ` Simon Josefsson
2002-09-24 16:59         ` Micha Wiedenmann
2002-09-24 20:42           ` Simon Josefsson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ilu7khbktl4.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).