Gnus development mailing list
 help / color / mirror / Atom feed
From: Micha Wiedenmann <mw-u1@gmx.de>
Subject: Re: smtpmail: MAIL FROM and `gnus-posting-styles'
Date: 21 Sep 2002 02:42:08 +0200	[thread overview]
Message-ID: <87ofasb5mg.fsf@ID-56226.news.dfncis.de> (raw)
In-Reply-To: <vaf65x1lwds.fsf@lucy.cs.uni-dortmund.de>

Kai Großjohann schrieb am 19.09.2002:

>Micha Wiedenmann <mw-u1@gmx.de> writes:
>
>> 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 the X-Draft-From header is supposed to allow Gnus to recover
>the right posting style.

X-Draft-From is used (set) in `gnus-draft-setup' I don't understand it
all but I trust you! :-) (used for posting styles).

I don't see, where it is used in `gnus-agent-send-mail' and I don't see
how the posting-styles set user-mail-address which is send by
`smtpmail-via-smtp'. 

X-Draft-From is not in Gnus 5.8.8 (but the statements above are about
recent CVS Oort.)

I have fixed my problem with I consider as a bug by fixing
`gnus-agent-send-mail' this function has not changed (v5.8.8 -> Oort)
yet.

,----[ gnus-agent.el ]
| (defun gnus-agent-send-mail ()
|   (if gnus-plugged
|       (progn
| 	;; restore user-mail-address from FROM header
| 	(let ((mail-envelope-from 
| 	       (nth 1 (mail-extract-address-components 
| 		       (message-fetch-field "From")))))
| 	  (funcall gnus-agent-send-mail-function)))
|     (goto-char (point-min))
|     (re-search-forward
|      (concat "^" (regexp-quote mail-header-separator) "\n"))
|     (replace-match "\n")
|     (gnus-agent-insert-meta-information 'mail)
|     (gnus-request-accept-article "nndraft:queue" nil t t)))
`----

This code makes sure that a message send via smtp uses the same
mail-address for SMTP:MAIL FROM %s as in the message From-header.

I had really strange problems with edebug and user-mail-address instead
of mail-envelope-from. While tracing through the let expression edebug
evaluated user-mail-address to "foo" bug `C-h v user-mail-address'
evalueted to bar. I thought I am silly. I didn't get a working version
with user-mail-address (I would not belive if I didn't tried!) Maybe
this was a side effekt from edebug and `q' (`q' runs `top-level', exit
debugging. If you have some time you could test it yourselve but I thing
mail-envelope-from is even better than user-mail-address.

HTH, Micha
-- 
"They were just sucked into space" -- Riker 
"Blown, sir" -- Data 
"Sorry, Data" -- Riker 
"Common mistake, sir" -- Data (Star Trek TNG: The Naked Now)



  reply	other threads:[~2002-09-21  0: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 [this message]
     [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

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=87ofasb5mg.fsf@ID-56226.news.dfncis.de \
    --to=mw-u1@gmx.de \
    --cc=mw-r1@gmx.de \
    /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).