From: Micha Wiedenmann <mw-u1@gmx.de>
Subject: Re: smtpmail: MAIL FROM and `gnus-posting-styles'
Date: 24 Sep 2002 18:59:54 +0200 [thread overview]
Message-ID: <87smzzxsy3.fsf@ID-56226.news.dfncis.de> (raw)
In-Reply-To: <iluvg4v8vdv.fsf@latte.josefsson.org>
* Simon Josefsson <jas@extundo.com> writes:
>Micha Wiedenmann <mw-u1@gmx.de> writes:
>> Bjørn Mork writes:
>>>Simon Josefsson <jas@extundo.com> writes:
>>>> Micha Wiedenmann <mw-u1@gmx.de> 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
next prev parent reply other threads:[~2002-09-24 16:59 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 [this message]
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=87smzzxsy3.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).