unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michal Sojka <sojkam1@fel.cvut.cz>
To: James Vasile <james@hackervisions.org>, notmuch@notmuchmail.org
Subject: Re: [PATCH] Change From and Bcc when creating reply draft buffer
Date: Thu, 11 Mar 2010 17:22:41 +0100	[thread overview]
Message-ID: <87ljdyn7zi.fsf@steelpick.localdomain> (raw)
In-Reply-To: <87fx46hq7w.fsf@hackervisions.org>

On Thu, 11 Mar 2010, James Vasile wrote:
> On Thu, 11 Mar 2010 14:00:08 +0100, Michal Sojka <sojkam1@fel.cvut.cz> wrote:
> > Hi James,
> > 
> > On Tue, 09 Mar 2010, James Vasile wrote:
> > > When notmuch creates a reply buffer, it guesses the From and Bcc
> > > addresses.  The client is in a better position to guess these, and this
> > > patch adjusts notmuch-reply accordingly.
> > > 
> > > diff --git a/notmuch.el b/notmuch.el
> > > index ab56f48..07f957e 100644
> > > --- a/notmuch.el
> > > +++ b/notmuch.el
> > > @@ -436,10 +436,20 @@ buffer."
> > >    (message "Done"))
> > >  
> > >  (defun notmuch-reply (query-string)
> > > +  "Prepare a reply draft buffer.
> > > +
> > > +Have notmuch create a reply buffer, then adjust the from and bcc
> > > +headers to match our current user-full-name and
> > > +user-mail-address."
> > >    (switch-to-buffer (generate-new-buffer "notmuch-draft"))
> > >    (call-process notmuch-command nil t nil "reply" query-string)
> > >    (message-insert-signature)
> > >    (goto-char (point-min))
> > > +  (kill-line)
> > > +  (insert (format "From: %s <%s>" user-full-name user-mail-address))
> > 
> > Notmuch reply contains From: address which is based on the addresses in
> > .notmuch-config and the replied message. When you use multiple addresses
> > (e.g. home and work address), notmuch puts there the one used in the
> > replied message. It seems that your patch would break this feature.
> > 
> > -Michal
> 
> Yes, it does break that feature, and intentionally so.  The MUA should
> select the From: address.  I have profile selection code that sets my
> user-full-name and user-mail-address based on some context.  When I
> reply to somebody, the correct From: address is not who they think I am
> but rather who *I* think I am.
> 
> Here's my use case: I have a job in the free software world.  There's an
> email address attached to that.  I also serve on the board of a free
> software project.  There's another email for that.  People email me
> about the project using my work email, but I always reply using the
> project email, and my MUA knows that.  Notmuch doesn't.
> 
> Also: my girlfriend's family sometimes emails me at work.  I don't want
> personal email at my work address, so I always reply using a personal
> address.
> 
> Also: I have an old email address that I've deprecated, but old friends
> still use it.  I always reply with my newer address and they eventually
> start using the new one.
> 
> My profile code is usable but not complete.  It looks at folder contents
> to pick the correct From: address automatically (you can override the
> choice, of course), which is good when you have 400+ folders.  If
> anybody wants it before it's done, I can put it in a public branch.

Hi,

thanks for clarification. It all sounds reasonable. The only problem I
can see now is that if I create a new account on my machine and run
emacs there, then the value of user-mail-address is <login>@<hostname>
which doesn't refer to existing mailbox. I think that the header should
only be rewritten if these variables are known to have valid values. Do
you know how to do this?

-Michal

  reply	other threads:[~2010-03-11 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09 19:40 [PATCH] Change From and Bcc when creating reply draft buffer James Vasile
2010-03-11 13:00 ` Michal Sojka
2010-03-11 14:45   ` James Vasile
2010-03-11 16:22     ` Michal Sojka [this message]
2010-03-11 19:45       ` James Vasile
2010-03-12  7:49         ` Michal Sojka
2010-03-12 15:01           ` James Vasile
2010-03-12 15:22           ` Jameson Rollins
2010-03-12 16:00             ` Sebastian Spaeth

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=87ljdyn7zi.fsf@steelpick.localdomain \
    --to=sojkam1@fel.cvut.cz \
    --cc=james@hackervisions.org \
    --cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).