1
0
mirror of https://github.com/djcb/mu.git synced 2024-06-26 07:29:17 +02:00
Commit Graph

331 Commits

Author SHA1 Message Date
djcb
c6dd538975 mu-msg-part.c: some cosmetic changes 2014-10-19 11:38:49 +03:00
Foivos S. Zakkak
8f8bc52023 Revert "Do not handle signature parts after verification"
This reverts commit 6e9b9ad2d0.

Unfortunately the reverted commit breaks the Signature field for
encrypted and, at the same time, signed messages.

TODO: details button in the Signatures field does not work for such
cases because the signature is encrypted.

Conflicts:
	lib/mu-msg-part.c
2014-10-19 03:39:32 +03:00
Foivos S. Zakkak
2d843ca887 Add Decryption field
Add a decryption field of the form

Decryption: 2 part(s) decrypted 1 part(s) failed

Meaning that 2 encrypted mime parts where successfully decrypted and 1
part failed.  Note that the number 2 refers to the number of
successfully decrypted mime parts and not the number of successfully
decrypted encryptes multiparts, i.e., if an encrypted multipart
contains 4 parts and decryption is successful the field will be

Decryption: 4 part(s) decrypted

TODO: Add details button listing the names and indexes of the
decrypted (or not) mime-parts
2014-10-19 03:27:58 +03:00
Dirk-Jan C. Binnema
ae75060b6a Merge pull request #498 from zakkak/skip_signatures
Do not handle signature parts after verification
2014-10-18 13:16:44 +03:00
Foivos S. Zakkak
6e9b9ad2d0 Do not handle signature parts after verification
Since signatures are not listed as attachments there is no reason to
handle them after the verification.
2014-10-18 12:44:33 +03:00
Foivos S. Zakkak
a79cd23cd1 Improve decrypt failure handling
On failure to decrypt, list the encrypted part as an attachment
2014-10-18 12:33:20 +03:00
Foivos S. Zakkak
c40522b632 Fix #494. Start indexing from 1 instead of 0 2014-10-17 15:53:32 +03:00
Dirk-Jan C. Binnema
ee7eb9c142 Merge pull request #487 from zakkak/master
Fix encrypted multiparts and attachments indexing
2014-10-14 11:46:39 +03:00
Foivos S. Zakkak
a6a58b65f1 Remove left over argument from merge 2014-10-13 13:27:47 +03:00
djcb
ace922317f threader: try to handle pathless messages 2014-10-13 09:56:39 +03:00
Foivos S. Zakkak
6f50298667 Fix encrypted multiparts and attachments indexing
Pull request #483 does not handle encrypted multiparts properly.  It
used to just verify the signature and not process the parts of the
multipart.  This commit resolves this issue.

Additionally it did not index attachments properly and in the case of a
multipart directly containing more than one multiparts resulted on non
unique indexing of attachments/parts.  This commit resolves this issue
as well.
2014-10-12 22:43:58 +03:00
djcb
ac023b74a7 mu-msg-crypto: give better error when gpg is not found
also fixes some other warnings
2014-10-11 14:05:08 +03:00
djcb
99f08c50c4 mu-threader: debugging for some reported problem in find_or_create 2014-10-11 14:04:17 +03:00
Foivos S. Zakkak
51037be7fb Fix #186 Part 3
This patch fixes the attachment extraction (open, save, temp) when using
`mu4e`.  `mu4e` used to not notify the mu-server about the
mu4e-decryption-policy.  As a result mu-server did not decrypt the
attachments for extract, open, or temp.
2014-10-10 18:34:57 +03:00
Foivos S. Zakkak
29e53d2eba Fix gpg decryption (#186)
After a multipart/encrypted part gets decrypted the result is usually a
`multipart/mixed` part (see enigmail).

Before this commit mime multiparts where handled only by
`g_mime_message_foreach`.  As a result the decrypted mime multiparts
where not processed.

This patch handles mime multiparts explicitly by removing the
`g_mime_message_foreach` invocations.  This might come at the cost of
reduced maintainability, in the case of radical gmime changes.  However,
gmime is pretty stable and that scenario is highly unlikely.

TODO: After decryption make any attachments available
2014-10-10 07:48:24 +03:00
djcb
ff25bf1a25 Don't use g_clear_pointer yet, it's too new.
Do it the old way.
2014-09-26 15:22:07 +03:00
djcb
3c7061338d Rework getting database version (#469)
It seems we don't get the correct database version in some case with
some compilers, optimization flags. Suspecting some stale ->c_str().
2014-09-23 07:32:39 +03:00
Jakub Sitnicki
c9cb27be11 mu: Make mu_container_splice_grandchildren() do only one thing
Don't kill the resultant childless container when promoting its
children. This unifies the behavior of mu_container_splice_*()
functions.
2014-08-15 10:11:21 +02:00
Jakub Sitnicki
bb0cc542b8 mu: Prune empty containers from the root set after splicing their children
When the root set contains only one empty container with one child
first promote the child container to the root set and only then
remove the empty parent container so that the root set never goes
empty.

Also make mu_container_splice_children() do only one thing, that is
promote one container's children to be another container's siblings.
The resultant childless container is no longer removed by this
function.

Fixes #460.
2014-08-15 10:10:39 +02:00
Jakub Sitnicki
ede481d4c0 mu: Test splicing child containers when there is only one thread
This test reproduces a regression introduced by commit 97101f1f82
("mu: Prune empty container when an only child gets promoted to the
root set").

When the results of a mu-find query contain only a one thread:

$ mu find --threads --fields 'd s' ''
Sat 09 Aug 2014 07:00:00 PM CEST [mu4e] Test Message
  `-> Sat 09 Aug 2014 08:30:00 PM CEST Re: [mu4e] Test Message

... and we narrow down the query in such a way that the root message
gets excluded, then a crash occurs:

$ mu find --threads --fields 'd s' '' date:2014-08-09/20:00..2014-08-09/21:00
**
ERROR:mu-container.c:117:mu_container_append_siblings: assertion failed: (c)
Aborted (core dumped)

Reported-by: Josiah Schwab <jschwab@gmail.com>
2014-08-15 10:10:39 +02:00
Jakub Sitnicki
32f5c8b1f6 mu: Sort containers by comparing their subtree leaders
Traverse the container tree depth first and for each container find
the node in the subtree rooted at this container which comes first in
the descending sort order. Remember it as the subtree leader. Then,
while sorting siblings, compare their subtree leaders instead of the
sibling containers themselves.

IOW, make threads containing the newest message float to the top when
sorting by date in the descending order.

There is no significant performance degradation when sorting a
mailbox with ~16k messages:

$ mu find maildir:/INBOX | wc -l
16503

Current state:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1231.761588      task-clock (msec)         #    0.996 CPUs utilized            ( +-  1.02% )

       1.236209133 seconds time elapsed                                          ( +-  1.08% )

With patch applied:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1459.883316      task-clock (msec)         #    0.998 CPUs utilized            ( +-  0.72% )

       1.462540088 seconds time elapsed                                          ( +-  0.77% )

This implements https://github.com/djcb/mu/issues/164.
2014-07-15 07:25:51 +02:00
Jakub Sitnicki
619fb86885 mu: Update container's pointer to last sibling when converting from a list 2014-07-15 07:25:51 +02:00
Jakub Sitnicki
97101f1f82 mu: Prune empty container when an only child gets promoted to the root set 2014-07-15 07:25:51 +02:00
Jakub Sitnicki
f724f4a57d mu: Consider an empty container to be less than anything else
Reasoning being that, arguably, it is the least surprising thing to do.
2014-07-15 07:25:50 +02:00
Jakub Sitnicki
dc3be515af mu: Extract function for comparing two containers 2014-07-15 07:25:50 +02:00
Jakub Sitnicki
d93b8135a6 Revert "* bugfix for issue 164"
This reverts commit c7b28419ab.

The reverted change fails to sort threads correctly when there is an
empty container, serving as a parent to orphan messages, in the thread
tree as demonstrated by the test in commit f49296759e ("tests:
threads: Test if orphan message promotes its thread").

Also, the reverted commit introduces a performance hit. The time it
takes to sort threads has increased roughly by a factor of 4.

Current state:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       4967.692519      task-clock (msec)         #    1.000 CPUs utilized            ( +-  0.14% )

       4.969247128 seconds time elapsed                                          ( +-  0.14% )

With the reverted patch applied:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1231.761588      task-clock (msec)         #    0.996 CPUs utilized            ( +-  1.02% )

       1.236209133 seconds time elapsed                                          ( +-  1.08% )

The benchmark was ran on a maildir with ~16k messages:

$ mu find maildir:/INBOX | wc -l
16503
2014-07-15 07:24:56 +02:00
Jakub Sitnicki
856a651d38 tests: threads: Test if grandchild message promotes only its subthread 2014-07-15 07:24:47 +02:00
Jakub Sitnicki
cbfe28b885 tests: threads: Test if grandchild message promotes its thread 2014-07-15 07:24:21 +02:00
Jakub Sitnicki
b0357a2d7a tests: threads: Test if child message doesn't promote its thread 2014-07-15 07:23:53 +02:00
Jakub Sitnicki
c5d4f7f338 tests: threads: Test if 2nd child message promotes its subthread 2014-07-15 07:22:53 +02:00
Jakub Sitnicki
22927a7dcf tests: threads: Test if 1st child message promotes its thread 2014-07-15 07:22:11 +02:00
David C Sterratt
f0510fbf35 Potential fix for issue #433: make check fails on Scientific Linux 6 2014-06-05 14:07:13 +01:00
Alex Bennée
29a16d7ae1 lib/mu-str.c: squash white space ctrl chars to spaces
When processing multiple lines for a subject line separated by TAB
characters we don't want to eliminate the control character totally but
replace it with a simple space. I've left the control handling as before
for non-white space characters.

Signed-off-by: Alex Bennée <alex@bennee.com>
2014-05-06 10:04:26 +01:00
djcb
0c18a0b816 * mu: store date as 0 if it does not exist; this allows searching 2014-03-22 18:51:39 +02:00
omfgroflbbq
c7b28419ab * bugfix for issue 164 2014-03-20 16:22:50 +01:00
djcb
3edf950fc2 * mu_str_asciify_in_place: fix test to decide whether to replace 2014-02-15 13:20:17 +02:00
djcb
599d641034 * lib: fix broken unit test 2014-01-15 21:27:18 +02:00
djcb
0277967b53 * mu-store-read: cleanup function a bit
(fruitlessly trying to track down
       https://code.google.com/p/mu0/issues/detail?id=80)
2013-12-21 10:14:31 -08:00
djcb
c48d290699 * minor update 2013-12-21 10:01:04 -08:00
djcb
0364433cc1 * minor 2013-12-01 20:21:44 +02:00
djcb
c36030a086 * handle message-ids a bit specially, update unit tests 2013-10-13 20:05:29 +03:00
djcb
edfdef44a4 index: improve error message when file does not seem to be an email 2013-10-13 19:58:25 +03:00
djcb
c898265ee5 * use timegm instead of the tzset hack 2013-10-07 00:50:36 +03:00
djcb
cdb1af046f * fix the mu_util_fputs_encoded/bsd heisenbug
it seems g_locale_from_utf8 behaves a bit differently on bsd/macosx,
  causing a segfault (but when run under gdb!). this code path was hit
  for messages with encoding problems in non-utf8 locales
2013-09-07 18:39:00 +03:00
djcb
af55f4cf9e * update mu_date_str_to_time_t for macos
at macos this function /seemed/ to massively leak, when looking at the
  valgrind output on macos (but not linux). with this update, this
  leak(?) is gone.
2013-09-07 13:12:28 +03:00
djcb
827dfbecdb * mu-date: small optimization 2013-09-07 12:57:53 +03:00
djcb
13bad9a889 * better error message for some broken queries 2013-09-07 09:43:33 +03:00
djcb
c30ffeea72 * small cleanups (macos) 2013-08-25 20:05:57 +03:00
djcb
f89447e65c * mu_util_fputs_encoded: updated; perhaps helps with freebsd crash? 2013-08-14 21:59:31 +03:00
djcb
885554757a * mu: some improvement in script handling 2013-07-23 22:23:27 +03:00