<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body><div style="font-family: sans-serif;"><div class="markdown" style="white-space: normal;">
<p dir="auto">On 23 Aug 2024, at 11:08, Benny Kjær Nielsen wrote:</p>
<blockquote style="margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #5855D5; color: #5855D5;">
<p dir="auto">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.)</p>
</blockquote>
<p dir="auto">It now works, thanks!</p>
<p dir="auto">Patrik</p>
<blockquote style="margin: 0 0 5px; padding-left: 5px; border-left: 2px solid #5855D5; color: #5855D5;">
<p dir="auto">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 <code style="padding: 0 0.25em; background-color: #F7F7F7;">uuidgen</code> command.</p>
<p dir="auto">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 <code style="padding: 0 0.25em; background-color: #F7F7F7;">#date</code> and even better to use <code style="padding: 0 0.25em; background-color: #F7F7F7;">#date-received</code>. Also note that <code style="padding: 0 0.25em; background-color: #F7F7F7;">#date-received.month</code> 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).</p>
<p dir="auto">Finally, you might want to take advantage of the <code style="padding: 0 0.25em; background-color: #F7F7F7;">moveMessage</code> 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).</p>
<p dir="auto">Here is the result after making the changes described above:</p>
<pre style="margin-left: 15px; margin-right: 15px; padding: 5px; border: thin solid gray; overflow-x: auto; max-width: 90vw; background-color: #F7F7F7;"><code style="padding: 0 0.25em; background-color: #F7F7F7;">{
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';
}
</code></pre>
<p dir="auto">--<br>
Benny</p>
<hr>
<p dir="auto">mailmate mailing list<br>
Unsubscribe: <a href="https://lists.freron.com/listinfo/mailmate">https://lists.freron.com/listinfo/mailmate</a></p>
</blockquote>
</div>
</div>
</body>
</html>