Re: [PATCH 2/2] emacs: postpone/resume support

2016-09-21 Thread David Bremner
Daniel Kahn Gillmor  writes:

>
> So this failure that bremner's reporting appears to happen only when
> combining the #secure mode with a message with attachments.  It doesn't
> happen when the draft itself is just plaintext and one of the #secure
> flags is set.  And there's no problem if there are attachments without
> the #secure flag.
>
> Bremner, can you confirm this?

Yes, that sounds about right. Although the emacs bug I reported does not
have to do with attachments per se, just the requirement that the
#secure tag is at the top of the message

>
> I also noticed that if you rearrange the text before sending so that the
> #secure flag is at the top of the message, the structure of the message
> looks weird -- in particular, there's a double layer of multipart/mixed
> just within the crypto transformation, instead of a single layer.
>
> that said, these patches are really useful to me even in their current
> form, since most of my draft messages don't deal with both crypto and
> attachments.  Is there some way to get the benefits here without the bug
> at the intersection?

We could (and I think emacs should) abort if it detects #secure anywhere
but on the first line.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] build system: choose gnu99 as a C standard

2016-09-21 Thread David Bremner
Apparently pre 5.1 gcc defaulted to gnu89, but we decided it was ok to
use some c99 features.

'-std=c99' by itself is not enough for notmuch to compile.

'-std=gnu99' seems to work with clang and gcc, so I'm not convinced
configuration support is needed.
---

Our use of c99 loop variable declarations breaks the build on travis,
because old gcc defaults to c89+extensions

 Makefile.local | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.local b/Makefile.local
index 5587cd2..d1b0585 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -44,7 +44,8 @@ GPG_FILE=$(SHA1_FILE).asc
 PV_FILE=bindings/python/notmuch/version.py
 
 # Smash together user's values with our extra values
-FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(CFLAGS) 
$(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS)
+STD_CFLAGS := -std=gnu99
+FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(STD_CFLAGS) 
$(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS)
 FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) $(extra_cflags) 
$(extra_cxxflags) $(CONFIGURE_CXXFLAGS)
 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch
 ifeq ($(LIBDIR_IN_LDCONFIG),0)
-- 
2.9.3

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: v3 of message properties patches

2016-09-21 Thread David Bremner
Tomi Ollila  writes:
>
> I am happy with merging the series, just amend the sepErates
> (and possibly spcs->tab after $(dir)/string-map.c in -3-)
>
> I looked through the code and did not see anything that should broke
> anything. As Daniel has been using it I can slack off from testing it myself 
> :D
>
> Tomi

I have merged this series, amended as follows:

diff --git a/doc/man1/notmuch-dump.rst b/doc/man1/notmuch-dump.rst
index 29964da..5857027 100644
--- a/doc/man1/notmuch-dump.rst
+++ b/doc/man1/notmuch-dump.rst
@@ -84,7 +84,7 @@ Supported options for **dump** include
   **properties**
 
Output per-message (key,value) metadata.  Each line starts
-   with "#= ", followed by a message id, and a space seperated
+   with "#= ", followed by a message id, and a space separated
list of key=value pairs.  pair.  Ids, keys and values are hex
encoded if needed.
 
diff --git a/doc/man1/notmuch-restore.rst b/doc/man1/notmuch-restore.rst
index ebdb3ff..c681fa2 100644
--- a/doc/man1/notmuch-restore.rst
+++ b/doc/man1/notmuch-restore.rst
@@ -63,7 +63,7 @@ Supported options for **restore** include
**properties**
 
  Output per-message (key,value) metadata.  Each line starts
- with "#= ", followed by a message id, and a space seperated
+ with "#= ", followed by a message id, and a space separated
  list of key=value pairs.  pair.  Ids, keys and values are
  hex encoded if needed.
 
diff --git a/doc/man7/notmuch-search-terms.rst 
b/doc/man7/notmuch-search-terms.rst
index a85d94b..de93d73 100644
--- a/doc/man7/notmuch-search-terms.rst
+++ b/doc/man7/notmuch-search-terms.rst
@@ -58,7 +58,7 @@ indicate user-supplied values):
 
 -  query:
 
--  has:=
+-  property:=
 
 The **from:** prefix is used to match the name or address of the sender
 of an email message.
@@ -141,7 +141,7 @@ queries added with **notmuch-config(1)**. Named queries are 
only
 available if notmuch is built with **Xapian Field Processors** (see
 below).
 
-The **has:** prefix searches for messages with a particular
+The **property:** prefix searches for messages with a particular
 = property pair. Properties are used internally by notmuch
 (and extensions) to add metadata to messages. A given key can be
 present on a given message with several different values.
@@ -224,7 +224,7 @@ exact matches like "tag:inbox"  or **probabilistic**, 
supporting a more flexible
 
 
 Boolean
-   **tag:**, **id:**, **thread:**, **folder:**, **path:**, **has:**
+   **tag:**, **id:**, **thread:**, **folder:**, **path:**, **property:**
 Probabilistic
**from:**, **to:**, **subject:**, **attachment:**, **mimetype:**
 
diff --git a/lib/Makefile.local b/lib/Makefile.local
index c012ed1..3d1030a 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -40,7 +40,7 @@ libnotmuch_c_srcs =   \
$(dir)/messages.c   \
$(dir)/sha1.c   \
$(dir)/built-with.c \
-   $(dir)/string-map.c\
+   $(dir)/string-map.c \
$(dir)/tags.c
 
 libnotmuch_cxx_srcs =  \
diff --git a/lib/database.cc b/lib/database.cc
index d3e2e0e..392e8b2 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -97,7 +97,7 @@ typedef struct {
  * STRING is the name of a file within that
  * directory for this mail message.
  *
- *  has:   Has a property with key=value
+ *  property:   Has a property with key=value
  * FIXME: if no = is present, should match on any value
  *
  *A mail document also has four values:
@@ -254,7 +254,6 @@ static prefix_t BOOLEAN_PREFIX_INTERNAL[] = {
 { "directory", "XDIRECTORY" },
 { "file-direntry", "XFDIRENTRY" },
 { "directory-direntry","XDDIRENTRY" },
-{ "property",   "XPROPERTY"  },
 };
 
 static prefix_t BOOLEAN_PREFIX_EXTERNAL[] = {
@@ -263,7 +262,7 @@ static prefix_t BOOLEAN_PREFIX_EXTERNAL[] = {
 { "is","K" },
 { "id","Q" },
 { "path",  "P" },
-{ "has",   "XPROPERTY" },
+{ "property",  "XPROPERTY" },
 /*
  * Unconditionally add ':' to reduce potential ambiguity with
  * overlapping prefixes and/or terms that start with capital
diff --git a/test/T610-message-property.sh b/test/T610-message-property.sh
index ee7910b..65ff19d 100755
--- a/test/T610-message-property.sh
+++ b/test/T610-message-property.sh
@@ -237,12 +237,12 @@ notmuch restore < BEFORE2
 notmuch dump | grep '^#=' > OUTPUT
 test_expect_equal_file PROPERTIES OUTPUT
 
-test_begin_subtest "test 'has:' queries: empty"
-notmuch search has:testkey1=charles > OUTPUT
+test_begin_subtest "test 'property:' queries: empty"
+notmuch search property:testkey1=charles > OUTPUT
 test_expect_equal_file /dev/null OUTPUT
 
-test_begin_subtest "test 'has:' queries: single message"
-notmuch search --output=messages 

Re: [PATCH] test/emacs: add broken test for message replying to msg to self

2016-09-21 Thread Mark Walters

On Tue, 13 Sep 2016, David Bremner  wrote:
> This is a strange corner case where the removing of the user's address
> from the To: header does the wrong thing. If we think it is
> worth (eventually) fixing, this test can serve as a reminder.

Hi I haven't tested the patch, but I think it worth having as a
reminder.  Presumably you ran into the bug yourself, and I think I have
at some point, so people probably are hitting it.

Best wishes

Mark



> ---
>  test/T310-emacs.sh | 24 
>  1 file changed, 24 insertions(+)
>
> diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
> index 21675b6..01385ae 100755
> --- a/test/T310-emacs.sh
> +++ b/test/T310-emacs.sh
> @@ -521,6 +521,30 @@ Notmuch Test Suite  writes:
>  EOF
>  test_expect_equal_file OUTPUT EXPECTED
>  
> +test_begin_subtest "Reply within emacs to message from self"
> +test_subtest_known_broken
> +add_message '[from]="test_su...@notmuchmail.org"' \
> + '[to]="test_su...@notmuchmail.org"'
> +test_emacs "(let ((message-hidden-headers '()))
> + (notmuch-show \"id:${gen_msg_id}\")
> + (notmuch-show-reply)
> + (test-output))"
> +sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: /' OUTPUT
> +sed -i -e 's/^References: <.*>$/References: /' OUTPUT
> +cat  +From: Notmuch Test Suite 
> +To: test_su...@notmuchmail.org
> +Subject: Re: Reply within emacs to message from self
> +In-Reply-To: 
> +Fcc: ${MAIL_DIR}/sent
> +References: 
> +--text follows this line--
> +test_su...@notmuchmail.org writes:
> +
> +> This is just a test message (#7)
> +EOF
> +test_expect_equal_file EXPECTED OUTPUT
> +
>  test_begin_subtest "Quote MML tags in reply"
>  message_id='test-emacs-mml-quot...@message.id'
>  add_message [id]="$message_id" \
> -- 
> 2.9.3
>
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 1/2] emacs: tree: allow the user to decrypt the message pane

2016-09-21 Thread Mark Walters
This makes $ in the tree pane toggle decryption in the message
pane. Without this the user can only decrypt the message pane by
switching to it, or by setting decryption on globally by setting
notmuch-crypto-process-mime to t.
---

This seems an obvious extension. It may not be very useful as most
people who get encrypted messages probably set
notmuch-crypto-process-mime to t.

As an aside might it be worth making that the default
(notmuch-crypto-process-mime equal to t)?

Best wishes

Mark



emacs/notmuch-tree.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 5431384..8285354 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -255,6 +255,7 @@ FUNC."
 (define-key map (kbd "")  (notmuch-tree-to-message-pane 
#'notmuch-show-previous-button))
 (define-key map (kbd "TAB") (notmuch-tree-to-message-pane 
#'notmuch-show-next-button))
 (define-key map "e" (notmuch-tree-to-message-pane 
#'notmuch-tree-button-activate))
+(define-key map "$" (notmuch-tree-to-message-pane 
#'notmuch-show-toggle-process-crypto))
 
 ;; bindings from show (or elsewhere) but we close the message pane first.
 (define-key map "f" (notmuch-tree-close-message-pane-and 
#'notmuch-show-forward-message))
-- 
2.1.4

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH 2/2] emacs: tree: use message pane decryption state for replies

2016-09-21 Thread Mark Walters
This makes replying to a message in tree view, use the decrypted state
from the message pane if it is open. Previously it just used the
global decryption state from notmuch-crypto-process-mime.

In particular if notmuch-crypto-process-mime is nil, and the user
views the messages (which doesn't decrypt), toggles decryption in the
message pane, and then replies, the reply will be decrypted.
---

I think it makes sense to include in the reply what the user can see,
and only falling back on global defaults when needed.

However, the extra complexity for a rather extreme corner case (see
example in the commit message) may mean it's not worth doing.

Best wishes

Mark



emacs/notmuch-tree.el | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 8285354..e35d382 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -209,6 +209,13 @@ open (if the message pane is closed it does nothing)."
(with-selected-window notmuch-tree-message-window
 (call-interactively #',func)
 
+(defun notmuch-tree-inherit-from-message-pane (sym)
+  "Return value of SYM in message-pane if open, or tree-pane if not"
+  (if (window-live-p notmuch-tree-message-window)
+  (with-selected-window notmuch-tree-message-window
+   (symbol-value sym))
+(symbol-value sym)))
+
 (defun notmuch-tree-button-activate ( button)
   "Activate BUTTON or button at point
 
@@ -226,8 +233,10 @@ FUNC."
   `(lambda ()
   ,(concat "(Close message pane and) " (documentation func t))
  (interactive)
- (notmuch-tree-close-message-window)
- (call-interactively #',func)))
+ (let ((notmuch-show-process-crypto
+   (notmuch-tree-inherit-from-message-pane 
'notmuch-show-process-crypto)))
+   (notmuch-tree-close-message-window)
+   (call-interactively #',func
 
 (defvar notmuch-tree-mode-map
   (let ((map (make-sparse-keymap)))
-- 
2.1.4

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: v3 of message properties patches

2016-09-21 Thread Tomi Ollila
On Wed, Sep 21 2016, David Bremner  wrote:

> Daniel Kahn Gillmor  writes:
>
>> I've been running this series of patches since shortly after they were
>> released.  They work for me, and they're a critical feature to enable
>> the cleartext index series i've been trying to land.
>
> OK, that's certainly more testing and API evaluation than most series
> get. I'd still like someone other than me to sanity check the code
> itself, and the design decisions that hard to change later, namely
> changes to the database format and the dump-restore format. And of
> course the main reason we want code review is for to find the issues
> that I am not aware of. Tomi, I know you've read the code at some level,
> are you happy with merging the series?

I am happy with merging the series, just amend the sepErates
(and possibly spcs->tab after $(dir)/string-map.c in -3-)

I looked through the code and did not see anything that should broke
anything. As Daniel has been using it I can slack off from testing it myself :D

Tomi

>

>>
>> As i've been maintaining them against the master branch, they've
>> diverged slightly from the series here.  I'd be happy to send the
>> updated revisions here if folks want them, but there are no substantive
>> changes.
>
> I can confirm that's just a rebase against master of what I have.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: Sync mail deletion with Notmuch + mbsync for gmail

2016-09-21 Thread Sebastian Fischmeister
Thanks. I'll try this, because it looks simpler than what I have. Here's
what's working so far:

Note: Gmail has a proprietary implementation of IMAP. To delete an
email, you first must move the email to the trash folder on the
server. You can find this info through archive.org, because Google now
redirects the page where they originally explained this.

https://web.archive.org/web/20151013132129/https://support.google.com/mail/answer/78755

Concept:

- Deleting emails adds the +delete tag.
- Archiving emails add the +processed tag.

- Before syncing emails, process archived messages by copying them to
  the archive folder and moving them to the trash folder. Moving is more
  elaborate, because you have to remove the UID for mbsync

notmuch search --output=files tag:processed and folder:inbox | grep -v archived 
| xargs -I{} cp -f {} ~/.mail/archived/cur/
notmuch search --output=files tag:processed and folder:sent | grep -v archived 
| xargs -I{} cp -f {} ~/.mail/archived/cur/

function moveIt { s=${1##*/}; s=${s%%,*}; mv -f $1 $2/$s
s=$(notmuch search --output=files tag:processed and folder:sent | grep -v 
archived)
for i in $s; do moveIt $i /home/sfischme/.mail/totrash/new; done
}

- Before syncing, move deleted messages to the trash

s=$(notmuch search --output=files tag:delete and not folder:totrash | grep -v 
archived)
for i in $s; do moveIt $i /home/sfischme/.mail/totrash/new; done

- Invoke mbsync

Caveats:

- You need more bandwidth as you copy emails back to the server just to
  delete them.

- Make sure your scripts work, otherwise things get out of sync.


  Sebastian


"aaermo...@gmail.com"  writes:

>  Hi Sebastian,
>
>  I also use mbsync + notmuch
>
>  here is mbsync config for my personal Gmail mailbox:
>  =
>  SyncState *
>
>  IMAPAccount aaermo...@gmail.com
>  Host imap.gmail.com
>  User aaermo...@gmail.com
>  PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d 
> ~/docs/enc/cred/aaermo...@gmail.com.gpg"
>  CertificateFile /etc/ssl/certs/ca-certificates.crt
>  SSLType IMAPS
>
>  IMAPStore aaermo...@gmail.com-remote
>  Account aaermo...@gmail.com
>
>  MaildirStore aaermo...@gmail.com-local
>  Path ~/Maildir/aaermo...@gmail.com/
>  Inbox ~/Maildir/aaermo...@gmail.com/INBOX
>  SubFolders Verbatim
>
>  MaildirStore aaermo...@gmail.com-archive
>  Path ~/Maildir/archive-aaermo...@gmail.com/
>
>  Channel aaermo...@gmail.com-archive
>  Master ":aaermo...@gmail.com-remote:[Gmail]/All Mail"
>  Slave ":aaermo...@gmail.com-archive:Archive"
>  Create Slave
>  SyncState *
>  Sync Push Flags
>
>  Channel aaermo...@gmail.com-trash
>  Master ":aaermo...@gmail.com-remote:[Gmail]/Trash"
>  Slave ":aaermo...@gmail.com-archive:Trash"
>  Create Slave
>  Sync All
>
>  Channel aaermo...@gmail.com-drafts
>  Master ":aaermo...@gmail.com-remote:[Gmail]/Drafts"
>  Slave ":aaermo...@gmail.com-local:Drafts"
>  Create Slave
>  Sync All
>  Expunge Both
>
>  Channel aaermo...@gmail.com-sent
>  Master ":aaermo...@gmail.com-remote:[Gmail]/Sent Mail"
>  Slave ":aaermo...@gmail.com-local:Sent"
>  Create Slave
>  Sync All
>  Expunge Both
>
>  Channel aaermo...@gmail.com-inbox
>  Master ":aaermo...@gmail.com-remote:INBOX"
>  Slave ":aaermo...@gmail.com-local:INBOX"
>  Create Slave
>  Sync All
>  Expunge Both
>
>  Channel aaermo...@gmail.com-user-labels
>  Master :aaermo...@gmail.com-remote:
>  Slave :aaermo...@gmail.com-local:
>  Create Slave
>  Sync All
>  Patterns "*" "!Drafts" "!Sent" "!Trash" "![Gmail]*" "!INBOX" "!Lists*" 
> "!Cron*"
>  Expunge Both
>
>  Channel aaermo...@gmail.com-mailing-lists-and-notifications
>  Master :aaermo...@gmail.com-remote:
>  Slave :aaermo...@gmail.com-local:
>  Create Slave
>  Sync All
>  Patterns "Lists*" "Cron*"
>  # MaxMessages 2000
>  Expunge Both
>
>  Group aaermo...@gmail.com
>  Channel aaermo...@gmail.com-trash
>  Channel aaermo...@gmail.com-inbox
>  Channel aaermo...@gmail.com-drafts
>  Channel aaermo...@gmail.com-sent
>  Channel aaermo...@gmail.com-user-labels
>  Channel aaermo...@gmail.com-mailing-lists-and-notifications
>  Channel aaermo...@gmail.com-archive
>  =
>
>  But I also use imapfilter for trashed and spam messages management, so
>  when I delete something locally, AFAIK it correctly propagates to Gmail.
>
>  Here is imapfilter's config:
>  =
>  options.timeout = 120
>  options.subscribe = true
>
>  cmd_personal = io.popen('gpg2 -q --for-your-eyes-only --no-tty -d 
> ~/docs/enc/cred/aaermo...@gmail.com.gpg', 'r')
>  out_personal = cmd_personal:read('*a')
>  pass_personal = string.gsub(out_personal, '[\n\r]+', '')
>
>  account_personal = IMAP {
>   server = 'imap.gmail.com',
>   username = 'aaermo...@gmail.com',
>   password = pass_personal,
>   ssl = 'ssl3'
>   }
>
>  trash_personal = account_personal['[Gmail]/Trash']:is_undeleted()
>  account_personal['[Gmail]/Trash']:delete_messages(trash_personal)
>

Re: Sync mail deletion with Notmuch + mbsync for gmail

2016-09-21 Thread aaermolov
 Hi Sebastian,

 I also use mbsync + notmuch

 here is mbsync config for my personal Gmail mailbox:
 =
 SyncState *

 IMAPAccount aaermo...@gmail.com
 Host imap.gmail.com
 User aaermo...@gmail.com
 PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d 
~/docs/enc/cred/aaermo...@gmail.com.gpg"
 CertificateFile /etc/ssl/certs/ca-certificates.crt
 SSLType IMAPS

 IMAPStore aaermo...@gmail.com-remote
 Account aaermo...@gmail.com

 MaildirStore aaermo...@gmail.com-local
 Path ~/Maildir/aaermo...@gmail.com/
 Inbox ~/Maildir/aaermo...@gmail.com/INBOX
 SubFolders Verbatim

 MaildirStore aaermo...@gmail.com-archive
 Path ~/Maildir/archive-aaermo...@gmail.com/

 Channel aaermo...@gmail.com-archive
 Master ":aaermo...@gmail.com-remote:[Gmail]/All Mail"
 Slave ":aaermo...@gmail.com-archive:Archive"
 Create Slave
 SyncState *
 Sync Push Flags

 Channel aaermo...@gmail.com-trash
 Master ":aaermo...@gmail.com-remote:[Gmail]/Trash"
 Slave ":aaermo...@gmail.com-archive:Trash"
 Create Slave
 Sync All

 Channel aaermo...@gmail.com-drafts
 Master ":aaermo...@gmail.com-remote:[Gmail]/Drafts"
 Slave ":aaermo...@gmail.com-local:Drafts"
 Create Slave
 Sync All
 Expunge Both

 Channel aaermo...@gmail.com-sent
 Master ":aaermo...@gmail.com-remote:[Gmail]/Sent Mail"
 Slave ":aaermo...@gmail.com-local:Sent"
 Create Slave
 Sync All
 Expunge Both

 Channel aaermo...@gmail.com-inbox
 Master ":aaermo...@gmail.com-remote:INBOX"
 Slave ":aaermo...@gmail.com-local:INBOX"
 Create Slave
 Sync All
 Expunge Both

 Channel aaermo...@gmail.com-user-labels
 Master :aaermo...@gmail.com-remote:
 Slave :aaermo...@gmail.com-local:
 Create Slave
 Sync All
 Patterns "*" "!Drafts" "!Sent" "!Trash" "![Gmail]*" "!INBOX" "!Lists*" "!Cron*"
 Expunge Both

 Channel aaermo...@gmail.com-mailing-lists-and-notifications
 Master :aaermo...@gmail.com-remote:
 Slave :aaermo...@gmail.com-local:
 Create Slave
 Sync All
 Patterns "Lists*" "Cron*"
 # MaxMessages 2000
 Expunge Both

 Group aaermo...@gmail.com
 Channel aaermo...@gmail.com-trash
 Channel aaermo...@gmail.com-inbox
 Channel aaermo...@gmail.com-drafts
 Channel aaermo...@gmail.com-sent
 Channel aaermo...@gmail.com-user-labels
 Channel aaermo...@gmail.com-mailing-lists-and-notifications
 Channel aaermo...@gmail.com-archive
 =

 But I also use imapfilter for trashed and spam messages management, so
 when I delete something locally, AFAIK it correctly propagates to Gmail.

 Here is imapfilter's config:
 =
 options.timeout = 120
 options.subscribe = true

 cmd_personal = io.popen('gpg2 -q --for-your-eyes-only --no-tty -d 
~/docs/enc/cred/aaermo...@gmail.com.gpg', 'r')
 out_personal = cmd_personal:read('*a')
 pass_personal = string.gsub(out_personal, '[\n\r]+', '')

 account_personal = IMAP {
  server = 'imap.gmail.com',
  username = 'aaermo...@gmail.com',
  password = pass_personal,
  ssl = 'ssl3'
  }

 trash_personal = account_personal['[Gmail]/Trash']:is_undeleted()
 account_personal['[Gmail]/Trash']:delete_messages(trash_personal)

 spam_personal = account_personal['[Gmail]/Spam']:is_unanswered()
 account_personal['[Gmail]/Spam']:delete_messages(spam_personal)
 =

 Cheers, Alex

PS Sorry for double posting, have forgot all recepients the first time.

Sebastian Fischmeister  writes:

> Hi,
>
> I use mbsync + notmuch to sync my gmail. The problem is that Google's
> IMAP implementation is non-standard and when I deleted a file locally,
> mbsync propagates the deletion, but gmail doesn't delete the
> message. 
>
> This is part of mbsync:
>
> SyncState *
> Sync All
> Expunge Both
> Create Both
>
> When I delete a message, the macro passes the tag 'delete'. Before
> syncing, the script runs:
>
> notmuch search --output=files tag:delete | xargs -l rm
>
> By playing with the IMAP settings in gmail, I got it so that the mail
> vanishes from the 'inbox' label, but it's still in 'All Mails'. I also
> tried moving it to a "[GMail]/Trash" folder locally and syncing that,
> but it didn't work.
>
> Any ideas?
>
>   Sebastian
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: v3 of message properties patches

2016-09-21 Thread David Bremner
Daniel Kahn Gillmor  writes:

> I've been running this series of patches since shortly after they were
> released.  They work for me, and they're a critical feature to enable
> the cleartext index series i've been trying to land.

OK, that's certainly more testing and API evaluation than most series
get. I'd still like someone other than me to sanity check the code
itself, and the design decisions that hard to change later, namely
changes to the database format and the dump-restore format. And of
course the main reason we want code review is for to find the issues
that I am not aware of. Tomi, I know you've read the code at some level,
are you happy with merging the series?

>
> As i've been maintaining them against the master branch, they've
> diverged slightly from the series here.  I'd be happy to send the
> updated revisions here if folks want them, but there are no substantive
> changes.

I can confirm that's just a rebase against master of what I have.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [BUG] [notmuch-tree] Display problems when database is locked

2016-09-21 Thread Mark Walters

Hi

On Sat, 02 Jan 2016, Simon Castellan  wrote:
> Hi,
>
> I'm using notmuch-tree and I encountered a slightly annoying bug. When
> browsing through a notmuch-tree buffer, if I open up a message whose
> tags needs to be changed (eg. the message needs to be marked read), then
> on the /next/ message, the bottom part of the pane does not get killed
> and thus, the top part (which is tiny) of the pane gets split again.

Sorry I overlooked this originally. I think this is fixed in latest
master (by commit dd5cd6964fe074c79c1850abb82d805bca35a5c5 ). I don't
think the fix has made it into any release yet but 0.23 will be released
fairly soon. If you can reproduce it on current master please let me
know.

Many thanks for the bug-report and sorry again for overlooking it
before.

Best wishes

Mark



>
> How to reproduce [I'm using notmuch-0.21 and emacs 24.4.1 from debian]
> 
>
> 1. Mark some messages to be unread and then run (notmuch-tree
> "is:unread")
>
> 2. Make sure your notmuch database is locked (for that purpose I run a
>`while true; do notmuch new; done` in a side terminal)
>
> 3. Open the first unread message, then press "n" to go the next one.
>At this point, the screen should be split in three instead of two.
>
> How to fix it
> -
>
> This is due to notmuch-show not returning when the database is locked
> and the message cannot be marked read. This results in the end of
> notmuch-tree-show-message-in not being executed and some variable
> (namely notmuch-tree-message-buffer) having wrong values.
>
> I am not sure what is the best way to fix it, but what I'm using at a
> hack is to wrap around the call to notmuch-show in a
> `with-demoted-errors` so that the execution can continue in case of
> failure, and close the bottom part in case of a failure. Hence when this
> happens, the bottom part disappears which is better than messing up the
> window configuration. This is what it looks like:
>
> (defun notmuch-tree-show-message-in ()
>   "Show the current message (in split-pane)."
>   (interactive)
>   (let ((id (notmuch-tree-get-message-id))
>   (inhibit-read-only t)
>   buffer)
> (when id
>   ;; We close and reopen the window to kill off un-needed buffers
>   ;; this might cause flickering but seems ok.
>   (notmuch-tree-close-message-window)
>   (setq notmuch-tree-message-window
>   (split-window-vertically (/ (window-height) 4)))
>   (with-selected-window notmuch-tree-message-window
>   ;; Since we are only displaying one message do not indent.
>   (let ((notmuch-show-indent-messages-width 0)
> (notmuch-show-only-matching-messages t))
> (setq buffer (with-demoted-errors (notmuch-show id)
>   (unless buffer
> (delete-window notmuch-tree-message-window))
>   (when buffer
> ;; We need the `let' as notmuch-tree-message-window is buffer 
> local.
> (let ((window notmuch-tree-message-window))
>   (with-current-buffer buffer
> (setq notmuch-tree-message-window window)
> (add-hook 'kill-buffer-hook 
> 'notmuch-tree-message-window-kill-hook)))
> (setq notmuch-tree-message-buffer buffer)
> (when notmuch-show-mark-read-tags
>   (notmuch-tree-tag-update-display notmuch-show-mark-read-tags))
> 
> 
>
> Cheers,
>
> Simon.
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch