Commit graph

5 commits

Author SHA1 Message Date
Carl Worth
dbe41eab82 notmuch reply: Don't reply to address belonging to the user.
Here's our first real advantage of having a configuration system.
We get to omit our own addresses from the recipient list of any
replies.
2009-11-11 21:18:15 -08:00
Carl Worth
13569ad6c9 Unbreak several notmuch commands after the addition of configuration.
All of the following commands:

	notmuch dump
	notmuch reply
	notmuch restore
	notmuch search
	notmuch show
	notmuch tag

were calling notmuch_database_open with an argument of NULL. This was
a legitimate call until the recent addition of configuration, after
which it is expected that all commands will lookup the correct path in
the configuration file. So fix all these commands to do that.

Also, while touching all of these commands, we fix them to use the
talloc context that is passed in rather than creating a local talloc
context. We also switch from using goto for return values, to doing
direct returns as soon as an error is detected, (which can be leak
free thanks to talloc).
2009-11-11 20:29:30 -08:00
Carl Worth
a9f3ad4fcb notmuch reply: Use GMime to construct the header for the reply.
The advantage here is that we actually get the necessary folding of
long headers, (particularly the References header, but also things
like Subject). This also gives us parsed recipient addresses so that
we can easily elide the sender's address(es) from the recipient list
(just as soon as we have a configured value for the recipient's
address(es)).
2009-11-11 10:54:12 -08:00
Carl Worth
dfc0780cba notmuch reply: Process headers a bit more accurately.
We know take the original From: and all recipients and put them on the
To: line. We also add a "Re: " to the subject, and we add In-Reply-To:
and References: headers.
2009-11-10 18:46:26 -08:00
Keith Packard
357aba3ec8 notmuch reply: Add (incomplete) reply command
Reviewed-by: Carl Worth <cworth@cworth.org>

Keith wrote all the code here against notmuch before notmuch.c was
split up into multiple files. So I've pushed the code around in
various ways to match the new code structure, but have generally tried
to avoid making any changes to the behavior of the code.

I did fix one bug---a missing call to g_mime_stream_file_set_owner in
show_part which would cause "notmuch show" to go off into the weeds
when trying to show multiple messages, (since the first stream would
fclose stdout).
2009-11-10 13:32:02 -08:00