From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/46710 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: smtpmail: MAIL FROM and `gnus-posting-styles' Date: Tue, 24 Sep 2002 22:42:31 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: <874rcprohi.fsf@ID-56226.news.dfncis.de> <87r8fq18bs.fsf@ID-56226.news.dfncis.de> <87smzzxsy3.fsf@ID-56226.news.dfncis.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032900317 22621 127.0.0.1 (24 Sep 2002 20:45:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 24 Sep 2002 20:45:17 +0000 (UTC) Cc: ding@gnus.org Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17twYU-0005sZ-00 for ; Tue, 24 Sep 2002 22:45:14 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17twWG-0000AH-00; Tue, 24 Sep 2002 15:42:56 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 24 Sep 2002 15:43:35 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id PAA11656 for ; Tue, 24 Sep 2002 15:43:20 -0500 (CDT) Original-Received: (qmail 10093 invoked by alias); 24 Sep 2002 20:42:36 -0000 Original-Received: (qmail 10088 invoked from network); 24 Sep 2002 20:42:36 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 24 Sep 2002 20:42:36 -0000 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) by yxa.extundo.com (8.12.6/8.12.6) with ESMTP id g8OKgVn2018908; Tue, 24 Sep 2002 22:42:31 +0200 Original-To: Micha Wiedenmann Mail-Copies-To: nobody X-Hashcash: 0:020924:mw-r1@gmx.de:7428b02c445e577f X-Hashcash: 0:020924:ding@gnus.org:2d5b07169c52538e In-Reply-To: <87smzzxsy3.fsf@ID-56226.news.dfncis.de> (Micha Wiedenmann's message of "24 Sep 2002 18:59:54 +0200") Original-Lines: 71 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:46710 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:46710 Micha Wiedenmann 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)))))) +(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)) + ;; 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))