#2396 new
Guillaume

Problem to add + remove a tag in one shot

Reported by Guillaume | October 1st, 2019 @ 04:51 AM

First, thanks Benny for the great email application! I recently bought a MailMate licence and did the switch and found it great and liking all the customization that can be done :)

One thing that I'm trying to figure out, I'm not sure if it's a bug or maybe my method is not completely right... is that I want to change a tag for another one. The problem is that when I do it, it seems to work (TagB replace a TagA), but when the mailbox finish to synchronize, then I get back my TagA alongside my TagB. I've tried with all the methods that I've thought of:

  1. Creating a Bundle that do the work:

    #!/usr/bin/python
    import json
    
    actions = { 'actions': [ { 'type': 'changeFlags', 'enable': [ 'TagB' ], 'disable': [ 'TagA' ] } ] }
    print json.dumps(actions)
    
  2. Create a shortcut that do it:

    "l" = ( "setTag:", "TagB", "removeTag:", "TagA" );
    
  3. Doing it directly from the main GUI (I mean, I saw the fields "Tags to be added" and "Tags to be removed" when I select multiple email). And this one does the same as the other: It works at the beginning and then set back my TagA when the mailbox has done synchronizing.

The only method that I got it to work is to manually call the Tags field using the "T" hotkey on a single email selection and then pressing backspace on the TagA and writing the TagB and pressing Enter. This work great, but I like to optimize my workflow on things that I want to do frequently and would much prefer to have a shortcut to switch between specific tags than to always manually edit the Tags field.

So, is this the wanted behaviour or a bug? Maybe I'm not calling the right actions/methods in my script, if so, what would be the preferred one?

Thanks!

Comments and changes to this ticket

  • Guillaume

    Guillaume October 1st, 2019 @ 07:41 PM

    I think this is related, so I'm posting it here to have another example.

    While using MailMate I see that whatever I modify a tag when my Inbox hasn't finished a sync, the modified tag gets reverted. I have an "Important" tag (linked to my Gmail \Important label) that I remove using the "i" key and when I press it and my mailbox was spinning, the change gets reverted.

    I think the problem is because when MailMate is syncing it finds that the tag is on the online IMAP server so it set it to my local email. So, I'm thinking, is there a way to chain the list of actions invoked so they get activated in the same order as they were invoked? I think this could help for those moments.

    Or could this be related to the fact that I'm working with Gmail labels?

    Thanks again!

  • Guillaume

    Guillaume February 9th, 2021 @ 04:26 PM

    Hi, I was looking at this again this morning since this is one thing that interferes the most with my workflow. I saw another ticket that was related to this one and which I think is basically the same problem.

    Here is the other ticket if you want to link them:
    https://freron.lighthouseapp.com/projects/58672/tickets/2657-tags-d...

    The problem seems to be that the actions to set tags don't update correctly. I mean, I having this problem when I try to set/change tags from the menubar tags buttons, but it works when I manually change the tags from the text field we get when invoking: Message -> Tag -> Edits tags

    I tried to switch to the latest beta version and it was the same, so I now reverted to the standard version.

    I watched the "Activity Viewer" and I watched both methods (1: by switching a tag from one to another as explained in my ticket; 2: by using the "Edit tags" text field)

    While watching, it seems that MailMate doesn't set correctly the 'enable' and 'disable' flags when doing the operation with an action. I mean, only one field is set when invoked by an action, but both fields are set when I manually change a tag to another by using the Edit tags text field.

    For example:

    Activity sent when I set a first tag using my action (I set the tag 'ToDo'):

    16:10:37 Trying to terminate connection...
    16:10:37 S: <<< terminated reading >>>
    16:10:37 Response after idling (900/900): terminated (10)
    16:10:37 C: DONE
    16:10:37 S: S137 OK IDLE terminated (Success)
    16:10:37 Completed IDLE (4). Reset observed read/write timeouts: 8/8
    
    16:10:37 Handling reply
    16:10:37 Running action
    16:10:37 Sending request (46)
    16:10:37 Handling request
    16:10:37 Ready to run action (retry count: 0)
    16:10:37 C: H138 NOOP
    16:10:37 S: H138 OK Success
    16:10:37 Storing flags (enable: 'ToDo', disable: '')
    16:10:37 C: H139 UID STORE 25591 +FLAGS.SILENT (ToDo)
    16:10:37 S: * 24391 FETCH (UID 25591 MODSEQ (5457377) FLAGS (Important ToDo \Flagged \Seen))
    16:10:37 S: H139 OK Success
    16:10:37 C: H140 UID FETCH 25591 (FLAGS)
    16:10:37 S: * 24391 FETCH (UID 25591 MODSEQ (5457377) FLAGS (Important ToDo \Flagged \Seen))
    16:10:37 S: H140 OK Success
    16:10:37 C: H141 UID STORE 25591 +X-GM-LABELS.SILENT ("[Airmail]/To Do")
    16:10:37 S: H141 OK Success
    16:10:37 C: H142 UID FETCH 25591 (X-GM-LABELS)
    16:10:37 S: * 24391 FETCH (X-GM-LABELS ("[Airmail]/To Do" "\\Important" "\\Starred") UID 25591 MODSEQ (5457381))
    16:10:37 S: H142 OK Success
    16:10:37 Completed action (1007). Observed read/write timeouts: 8/8
    
    16:10:37 Handling reply
    16:10:37 Running action
    16:10:37 Sending request (36)
    16:10:37 Handling request
    16:10:37 Ready to run action (retry count: 0)
    16:10:37 C: S143 NOOP
    16:10:38 S: S143 OK Success
    16:10:38 Running IDLE (still alive checks every 15 minutes)
    16:10:38 C: S144 IDLE
    16:10:38 S: + idling
    

    We can see the "Storing flags (enable: 'ToDo', disable: '')" is correct here since I'm just adding

    Then I switch the 'ToDo' tag to 'Done' by doing an action like:

    #!/usr/bin/python
    import json
    
    actions = { 'actions': [
    #    { 'type': 'changeFlags', 'enable': [ 'Done' ], 'disable': [ 'ToDo', 'Someday' ] },
        { 'type': 'changeFlags', 'enable': [ 'Done' ], 'disable': [ 'ToDo', 'Someday' ] }
    ] }
    print json.dumps(actions)
    

    and now the activity is:

    16:13:46 Trying to terminate connection...
    16:13:46 Response after idling (900/900): terminated (10)
    16:13:46 C: DONE
    16:13:46 S: S150 OK IDLE terminated (Success)
    16:13:46 Completed IDLE (4). Reset observed read/write timeouts: 8/8
    
    16:13:46 Handling reply
    16:13:46 Running action
    16:13:46 Sending request (23)
    16:13:46 Handling request
    16:13:46 Ready to run action (retry count: 0)
    16:13:46 C: H151 NOOP
    16:13:46 S: H151 OK Success
    16:13:46 Storing flags (enable: 'Done', disable: '')
    16:13:46 C: H152 UID STORE 25591 +FLAGS.SILENT (Done)
    16:13:46 S: * 24391 FETCH (UID 25591 MODSEQ (5457450) FLAGS (Done Important ToDo \Flagged \Seen))
    16:13:46 S: H152 OK Success
    16:13:46 C: H153 UID FETCH 25591 (FLAGS)
    16:13:46 S: * 24391 FETCH (UID 25591 MODSEQ (5457450) FLAGS (Done Important ToDo \Flagged \Seen))
    16:13:46 S: H153 OK Success
    16:13:46 C: H154 UID STORE 25591 +X-GM-LABELS.SILENT ("[Airmail]/Done")
    16:13:46 S: H154 OK Success
    16:13:46 C: H155 UID FETCH 25591 (X-GM-LABELS)
    16:13:47 S: * 24391 FETCH (X-GM-LABELS ("[Airmail]/Done" "[Airmail]/To Do" "\\Important" "\\Starred") UID 25591 MODSEQ (5457454))
    16:13:47 S: H155 OK Success
    16:13:47 Completed action (1007). Observed read/write timeouts: 8/8
    
    16:13:47 Handling reply
    16:13:47 Running action
    16:13:47 Sending request (38)
    16:13:47 Handling request
    16:13:47 Ready to run action (retry count: 0)
    16:13:47 C: S156 NOOP
    16:13:47 S: S156 OK Success
    16:13:47 Running IDLE (still alive checks every 15 minutes)
    16:13:47 C: S157 IDLE
    16:13:47 S: + idling
    

    We can see that the "Storing flags (enable: 'Done', disable: '')" doesn't disable the "ToDo" flag so now I'm my email is tagged with "ToDo" + "Done"

    If I invoke again my action to switch from 'ToDo' to 'Done', now it removes the "ToDo" tag and keep the "Done" tag

    Activity:

    16:15:36 Trying to terminate connection...
    16:15:36 S: <<< terminated reading >>>
    16:15:36 Response after idling (900/900): terminated (10)
    16:15:36 C: DONE
    16:15:36 S: S169 OK IDLE terminated (Success)
    16:15:36 Completed IDLE (4). Reset observed read/write timeouts: 8/8
    
    16:15:36 Handling reply
    16:15:36 Running action
    16:15:36 Sending request (25)
    16:15:36 Handling request
    16:15:36 Ready to run action (retry count: 0)
    16:15:36 C: H170 NOOP
    16:15:36 S: H170 OK Success
    16:15:36 Storing flags (enable: '', disable: 'ToDo')
    16:15:36 C: H171 UID STORE 25591 -FLAGS.SILENT (ToDo)
    16:15:37 S: * 24391 FETCH (UID 25591 MODSEQ (5457527) FLAGS (Done Important \Flagged \Seen))
    16:15:37 S: H171 OK Success
    16:15:37 C: H172 UID FETCH 25591 (FLAGS)
    16:15:37 S: * 24391 FETCH (UID 25591 MODSEQ (5457527) FLAGS (Done Important \Flagged \Seen))
    16:15:37 S: H172 OK Success
    16:15:37 C: H173 UID STORE 25591 -X-GM-LABELS.SILENT ("[Airmail]/To Do")
    16:15:37 S: H173 OK Success
    16:15:37 C: H174 UID FETCH 25591 (X-GM-LABELS)
    16:15:37 S: * 24391 FETCH (X-GM-LABELS ("[Airmail]/Done" "\\Important" "\\Starred") UID 25591 MODSEQ (5457531))
    16:15:37 S: H174 OK Success
    16:15:37 Completed action (1007). Observed read/write timeouts: 8/8
    
    16:15:37 Handling reply
    16:15:37 Running action
    16:15:37 Sending request (11)
    16:15:37 Handling request
    16:15:37 Ready to run action (retry count: 0)
    16:15:37 C: S175 NOOP
    16:15:37 S: S175 OK Success
    16:15:37 Running IDLE (still alive checks every 15 minutes)
    16:15:37 C: S176 IDLE
    16:15:37 S: + idling
    

    We see: Storing flags (enable: '', disable: 'ToDo')

    However, when I manually switch the tags manually using the Edit Tags I get the activity:

    16:16:34 S: <<< terminated reading >>>
    16:17:24 Trying to terminate connection...
    16:17:24 Response after idling (900/900): terminated (10)
    16:17:24 C: DONE
    16:17:24 S: S190 OK IDLE terminated (Success)
    16:17:24 Completed IDLE (4). Reset observed read/write timeouts: 8/8
    
    16:17:24 Handling reply
    16:17:24 Running action
    16:17:24 Sending request (5)
    16:17:24 Handling request
    16:17:24 Ready to run action (retry count: 0)
    16:17:24 C: H191 NOOP
    16:17:24 S: H191 OK Success
    16:17:24 Storing flags (enable: 'Done', disable: 'ToDo')
    16:17:24 C: H192 UID STORE 25591 +FLAGS.SILENT (Done)
    16:17:24 S: * 24391 FETCH (UID 25591 MODSEQ (5457557) FLAGS (Done Important ToDo \Flagged \Seen))
    16:17:24 S: H192 OK Success
    16:17:24 C: H193 UID STORE 25591 -FLAGS.SILENT (ToDo)
    16:17:24 S: * 24391 FETCH (UID 25591 MODSEQ (5457562) FLAGS (Done Important \Flagged \Seen))
    16:17:24 S: H193 OK Success
    16:17:24 C: H194 UID FETCH 25591 (FLAGS)
    16:17:24 S: * 24391 FETCH (UID 25591 MODSEQ (5457562) FLAGS (Done Important \Flagged \Seen))
    16:17:24 S: H194 OK Success
    16:17:24 C: H195 UID STORE 25591 +X-GM-LABELS.SILENT ("[Airmail]/Done")
    16:17:25 S: H195 OK Success
    16:17:25 C: H196 UID STORE 25591 -X-GM-LABELS.SILENT ("[Airmail]/To Do")
    16:17:25 S: H196 OK Success
    16:17:25 C: H197 UID FETCH 25591 (X-GM-LABELS)
    16:17:25 S: * 24391 FETCH (X-GM-LABELS ("[Airmail]/Done" "\\Important" "\\Starred") UID 25591 MODSEQ (5457571))
    16:17:25 S: H197 OK Success
    16:17:25 Completed action (1007). Observed read/write timeouts: 8/8
    
    16:17:25 Handling reply
    16:17:25 Running action
    16:17:25 Sending request (14)
    16:17:25 Handling request
    16:17:25 Ready to run action (retry count: 0)
    16:17:25 C: S198 NOOP
    16:17:25 S: S198 OK Success
    16:17:25 Running IDLE (still alive checks every 15 minutes)
    16:17:25 C: S199 IDLE
    16:17:25 S: + idling
    

    Which correctly specifies that I'm enabling "Done" and disabling "ToDo" in one go: Storing flags (enable: 'Done', disable: 'ToDo')

    So, it would be great if the Enable/Disable could be correctly set when invoked by an action so we can more rapidly tag our emails the way we want and rapidly without reverting to manually writing the tags. I hope this information will be useful to fix the problem! :)

    Thanks in advance for your help and all the best!

  • Fredrik Lindeberg

    Fredrik Lindeberg April 4th, 2023 @ 09:04 AM

    I have the same issue with Google-based servers.

    I have an IMAP-server which I run myself for which I can (at least) set 5 tags at once in the GUI.

    But for Google-based servers I can only alter one label / tag at the same time. Does Google do something fishy when it comes to labels / tags?

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Pages