From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/46690 Path: main.gmane.org!not-for-mail From: Micha Wiedenmann Newsgroups: gmane.emacs.gnus.general Subject: Re: smtpmail: MAIL FROM and `gnus-posting-styles' Date: 24 Sep 2002 18:59:54 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: <87smzzxsy3.fsf@ID-56226.news.dfncis.de> References: <874rcprohi.fsf@ID-56226.news.dfncis.de> <87r8fq18bs.fsf@ID-56226.news.dfncis.de> Reply-To: Micha Wiedenmann NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1032886710 8549 127.0.0.1 (24 Sep 2002 16:58:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 24 Sep 2002 16:58:30 +0000 (UTC) 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 17tt11-0002DT-00 for ; Tue, 24 Sep 2002 18:58:28 +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 17tsyN-00065e-00; Tue, 24 Sep 2002 11:55:43 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 24 Sep 2002 11:56:22 -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 LAA11070 for ; Tue, 24 Sep 2002 11:56:09 -0500 (CDT) Original-Received: (qmail 3287 invoked by alias); 24 Sep 2002 16:55:21 -0000 Original-Received: (qmail 3282 invoked from network); 24 Sep 2002 16:55:21 -0000 Original-Received: from quimby.gnus.org (80.91.224.244) by gnus.org with SMTP; 24 Sep 2002 16:55:21 -0000 Original-Received: from news by quimby.gnus.org with local (Exim 3.12 #1 (Debian)) id 17ttek-0006Io-00 for ; Tue, 24 Sep 2002 19:39:30 +0200 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 103 Original-NNTP-Posting-Host: dialin-145-254-172-204.arcor-ip.net Original-X-Trace: quimby.gnus.org 1032889170 24228 145.254.172.204 (24 Sep 2002 17:39:30 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 24 Sep 2002 17:39:30 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:46690 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:46690 * Simon Josefsson writes: >Micha Wiedenmann writes: >> Bjørn Mork writes: >>>Simon Josefsson writes: >>>> Micha Wiedenmann writes: >>>> >>>>> when sendig a mail composed with `gnus-posting-styles' smtpmail uses >>>>> `user-mail-address' to determine "MAIL FROM:". Since >>>>> `gnus-posting-styles' already inserted "From: foo" this is confusing and >>>>> might be wrong. Is there a way to fix that behavior? >>>> >>>> Does it work to set user-mail-address in the posting style too? >> >> AFAICS it is not possible to set buffer-local variables from >> `gnus-posting-styles' but I would need buffer-local >> `user-mail-addresses' since I use several addresses. > >Ah. Hm. But can't you set the global variable? If you always use >posting styles, the global variable will have the right value. If you >don't always use posting, perhaps using a message-sent-hook that >restores the global variable could work. > >> Even if this would be possible I don't think this would help since I use >> `message-send-mail-function' value: `gnus-agent-send-mail'. If I am >> unplugged mail is stored in nndraft:queue and buffer-local settings >> would also lost, wouldn't they? > >I think posting styles are supposed to be applied even when the >message is read from the nndraft:queue group, using the X-Draft-From: >header. I checked the following with Gnus v5.8.8 and a recent CVS Oort (and gnus-agent): · Create a message. Make sure posting-styles applied. · Change the From: into something differen · Send the Message (unplugged -> queue) · Go plugged and send the message · my:send-message told me that the posing-styles were applied (even in 5.8.8) The settup: ,----[ .gnus ] | (setq gnus-select-method '(nntp "news.cis.dfn.de")) | | (setq gnus-posting-styles | '((".*" | (name "Micha Wiedenmann") | (address "mw-u1-dont-trust-posting-styles@gmx.de")))) | | (setq gnus-plugged nil) | (gnus-agentize) `---- ,----[ *scratch* ] | (setq gnus-agent-send-mail-function 'my:send-message) | (defun my:send-message () | (message (user-mail-address))) `---- 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. IMHO This is a serious problem for any user who don't think about such side effects. This should either be documented (but where?) or changed. >> I've two ideas: >> >> · Why does smtpmail use mail-envelope-from but don't try to determine >> mail-from from :-) the mail? > >Well, because the SMTP envelope header is different from the RFC822 >header. Perhaps there could be a speciel smtpmail.el feature that >used the From: address as SMTP envelope address? This sounds trivial >to implement and could perhaps be generally useful. What do you >think? Yes this sounds really great. >Hm. Extending `mail-envelope-from' seems like the right thing. What >do you think of the following? (The second :type alternative, >`header', is new, the rest is unchanged.) > >(defcustom mail-envelope-from nil > "*If non-nil, designate the envelope-from address when sending mail. >If this is nil while `mail-specify-envelope-from' is non-nil, the >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) 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 :-) Thank you very much, Micha -- Writing science fiction for about a penny a word is no way to make a living. If you really want to make a million, the quickest way is to start your own religion. -- L. Ron Hubbard, SF author and founder of Scientology