summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--src/dbmail-mailbox.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 72af3453..f761c1b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,8 @@ cscope.out
*.swp
*.o
*.lo
+*Makefile.in
+aclocal.m4
+config.in
+config/*
+configure
diff --git a/src/dbmail-mailbox.c b/src/dbmail-mailbox.c
index a45193c4..8570cbb1 100644
--- a/src/dbmail-mailbox.c
+++ b/src/dbmail-mailbox.c
@@ -755,6 +755,12 @@ static int _handle_sort_args(DbmailMailbox *self, char **search_keys, search_key
}
else if ( MATCH(key, "date") ) {
+ char *tmp = g_strdup_printf("JOIN %sheader h USING (physmessage_id) "
+ "JOIN %sheadername n ON h.headername_id = n.id "
+ "JOIN %sheadervalue v ON h.headervalue_id = v.id ",
+ DBPFX, DBPFX, DBPFX);
+ g_strlcat(value->table, tmp, MAX_SEARCH_LEN);
+ g_free(tmp);
_append_sort(value->order, "v.datefield", reverse);
(*idx)++;
}