[MlMt] Actions on old messages, but bundle and not delete

Patrik Fältström paf at paftech.se
Tue Aug 27 16:04:17 EDT 2024


On 23 Aug 2024, at 11:08, Benny Kjær Nielsen wrote:

> Better late than never. I tried out your bundle command and it didn't work for me. It wasn't obvious why because of some silent errors (I've fixed this for the next update.)

It now works, thanks!

Patrik

> Main problem is that the UUID used for the command is not unique. The same UUID is used for the main “info.plist’ file. When running the command then MailMate would try to execute this (and fail). A new UUID can always be created using the `uuidgen` command.
>
> Second problem is the folder name which was based on the original Date header. This header is often wrong or badly formatted. It's better to use `#date` and even better to use `#date-received`. Also note that `#date-received.month` includes both year and month. You might just want to use this without using the year-only-variant. Alternatively, you'll have to use some extra formatting (stripping the year).
>
> Finally, you might want to take advantage of the `moveMessage` action being able to handle a “relative” mailbox name. This will make this command work relative to the current account (the account of the message used).
>
> Here is the result after making the changes described above:
>
> ```
> {
>     name          = 'Archive to Date';
>     environment   = 'MM_FOLDER=${#date-received.year}/${#date-received.month}\n';
>     executionMode = 'singleMessage';
>     output        = actions;
>     command       = '#!/bin/bash
> cat << END
> { actions = ( { type = moveMessage; mailbox = "/Archive/${MM_FOLDER}"; } ); }
> END
> ';
>     uuid          = 'A9A7909A-8E0C-436D-A655-F55F9845B9D7';
> }
> ```
>
> -- 
> Benny
> _______________________________________________
> mailmate mailing list
> Unsubscribe: https://lists.freron.com/listinfo/mailmate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20240827/1daa06d5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20240827/1daa06d5/attachment.sig>


More information about the mailmate mailing list