From 13ce6b91c3696b5bfe8f7d62be8953fe0663665f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Kj=C3=A6r=20Nielsen?= Date: Tue, 29 Sep 2015 21:32:45 +0200 Subject: [PATCH 1/9] Switched name to Max and added period to the bundle title. --- info.plist | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/info.plist b/info.plist index 1185158..a4499ef 100644 --- a/info.plist +++ b/info.plist @@ -3,11 +3,11 @@ contactEmailRot13 - zz-ohaqyrf@sereba.pbz + znk.naqrefra@tznvy.pbz contactName - Benny Kjær Nielsen + Max Rydahl Andersen description - Commands for the MailMan mailing list software + Commands for the MailMan mailing list software. name MailMan uuid From 92ff19543b483b1bfcf8d544ad8cdec0ffcca8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Kj=C3=A6r=20Nielsen?= Date: Tue, 29 Sep 2015 21:34:09 +0200 Subject: [PATCH 2/9] Cleaned up a few things and replaced the install instructions. --- README.mdown | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/README.mdown b/README.mdown index ab2a957..eb4b72d 100644 --- a/README.mdown +++ b/README.mdown @@ -1,24 +1,18 @@ -# MailMan MailMate Bundle - for working with mailman based mailing lists +# Features This bundle groks the `List-*` headers used by MailMan based systems. -Allows you to do the following actions: +It allows you to do the following actions (in the “Commands ▸ MailMan” menu): - * Set Password (used for reject/approve) - * Reject or Approve a moderator mail - * Show mailing list archive in browse (opens in browser) - * Show Subscribe page (opens in browser) - * Unsubscribe (opens in browser) +* Set Password (used for reject/approve) +* Reject or Approve a moderator mail +* Show mailing list archive (opens in browser) +* Show Subscribe page (opens in browser) +* Unsubscribe (opens in browser) # Installation -``` -mkdir -p ~/Library/Application Support/MailMate/Bundles -cd ~/Library/Application Support/MailMate/Bundles -git clone https://github.com/maxandersen/listMate.mmBundle -``` - -Then mailmate should have a `Commands > MailMan` menu where you can operate on the mailing list. +You can install this bundle in MailMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. # Thanks From 9149d563733babce8380147a97b035c261f66dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Kj=C3=A6r=20Nielsen?= Date: Tue, 29 Sep 2015 21:36:00 +0200 Subject: [PATCH 3/9] Added the same shortcut (^M) to all commands except Set Password which is rarely needed. --- Commands/Approve.mmCommand | 2 ++ Commands/Reject.mmCommand | 2 ++ Commands/Show Archive.mmCommand | 3 ++- Commands/Subscribe Info.mmCommand | 4 ++-- Commands/Unsubscribe.mmCommand | 4 ++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Commands/Approve.mmCommand b/Commands/Approve.mmCommand index a7265b9..6f3cbb0 100644 --- a/Commands/Approve.mmCommand +++ b/Commands/Approve.mmCommand @@ -1,7 +1,9 @@ { name = 'Approve'; uuid = 'F3D4B55F-2E86-4CAC-A0A5-18D172F017B7'; + select = 'list-id exists'; environment = 'MM_TO=${to}\nMM_NAME=${list-id.description}\nMM_IDENTIFIER=${list-id.identifier}\n'; output = 'actions'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/approve"\n'; + keyEquivalent = '^m'; } diff --git a/Commands/Reject.mmCommand b/Commands/Reject.mmCommand index 59305b7..8aee929 100644 --- a/Commands/Reject.mmCommand +++ b/Commands/Reject.mmCommand @@ -1,7 +1,9 @@ { name = 'Reject'; uuid = 'BF23BD82-6EE9-4298-9B52-03A6B9CE6E80'; + select = 'list-id exists'; environment = 'MM_TO=${to}\n'; output = 'actions'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/reject"\n'; + keyEquivalent = '^m'; } diff --git a/Commands/Show Archive.mmCommand b/Commands/Show Archive.mmCommand index aea6310..888fe1a 100644 --- a/Commands/Show Archive.mmCommand +++ b/Commands/Show Archive.mmCommand @@ -1,7 +1,8 @@ { - isDisabled = 0; name = 'Show Archive'; uuid = '7B421EEB-5146-4776-AE05-53D2ED581AE1'; + select = 'list-subscribe exists'; environment = 'MM_LIST_INFO=${List-Archive}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/showinfo"\n'; + keyEquivalent = '^m'; } diff --git a/Commands/Subscribe Info.mmCommand b/Commands/Subscribe Info.mmCommand index 39b6219..7b8517a 100644 --- a/Commands/Subscribe Info.mmCommand +++ b/Commands/Subscribe Info.mmCommand @@ -1,8 +1,8 @@ { - isDisabled = 0; name = 'Show Subscribe Info'; uuid = '20C4178E-9BC4-4F45-9549-8B9F6E9E30F0'; - select = "List-Subscribe exists"; + select = 'list-subscribe exists'; environment = 'MM_LIST_INFO=${List-Subscribe}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/showinfo"\n'; + keyEquivalent = '^m'; } diff --git a/Commands/Unsubscribe.mmCommand b/Commands/Unsubscribe.mmCommand index 3e6576a..0806554 100644 --- a/Commands/Unsubscribe.mmCommand +++ b/Commands/Unsubscribe.mmCommand @@ -1,8 +1,8 @@ { - isDisabled = 0; name = 'Unsubscribe'; uuid = 'F1E5592F-377B-4F49-9F7F-F8A7C8E2F7BA'; - select = "List-Unsubscribe exists"; + select = "list-unsubscribe exists"; environment = 'MM_LIST_INFO=${List-Unsubscribe}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/showinfo"\n'; + keyEquivalent = '^m'; } From 31fd43cbb9c394121baaacd03af41cbd9a1c8baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Kj=C3=A6r=20Nielsen?= Date: Wed, 30 Sep 2015 12:47:39 +0200 Subject: [PATCH 4/9] New: Configurable action for Approve/Reject (open in composer or send message). --- Commands/Set Email Action.mmCommand | 6 ++++++ Support/bin/approve | 6 +++++- Support/bin/reject | 7 ++++++- Support/bin/set_action | 26 ++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Commands/Set Email Action.mmCommand create mode 100755 Support/bin/set_action diff --git a/Commands/Set Email Action.mmCommand b/Commands/Set Email Action.mmCommand new file mode 100644 index 0000000..ac8ca3a --- /dev/null +++ b/Commands/Set Email Action.mmCommand @@ -0,0 +1,6 @@ +{ + name = 'Set Email Action'; + uuid = 'A8BD1D41-BED3-4545-9DAF-314274847CA3'; + command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/set_action"\n'; + executionMode = 'noMessages'; +} diff --git a/Support/bin/approve b/Support/bin/approve index dccb015..586c6cc 100755 --- a/Support/bin/approve +++ b/Support/bin/approve @@ -1,6 +1,10 @@ #/bin/bash PASSWORD=`security find-generic-password -s "${MM_IDENTIFIER}" -w 2>/dev/null` +ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null` +if [ -z "${ACTION}" ]; then + ACTION="openMessage" +fi # If no password then ask for one if [ -z "${PASSWORD}" ]; then @@ -23,7 +27,7 @@ cat << END }; resultActions = ( { - type = "openMessage"; + type = "${ACTION}"; } ); }, diff --git a/Support/bin/reject b/Support/bin/reject index 66b8027..98ab23d 100755 --- a/Support/bin/reject +++ b/Support/bin/reject @@ -1,5 +1,10 @@ #/bin/bash +ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null` +if [ -z "${ACTION}" ]; then + ACTION="openMessage" +fi + cat << END { actions = ( { @@ -12,7 +17,7 @@ cat << END }; resultActions = ( { - type = "openMessage"; + type = "${ACTION}"; } ); }, diff --git a/Support/bin/set_action b/Support/bin/set_action new file mode 100755 index 0000000..936f947 --- /dev/null +++ b/Support/bin/set_action @@ -0,0 +1,26 @@ +#/bin/bash + +ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null` + +osascript < Date: Wed, 30 Sep 2015 12:56:41 +0200 Subject: [PATCH 5/9] Added new command to list of features --- README.mdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.mdown b/README.mdown index eb4b72d..35cd067 100644 --- a/README.mdown +++ b/README.mdown @@ -4,10 +4,11 @@ This bundle groks the `List-*` headers used by MailMan based systems. It allows you to do the following actions (in the “Commands ▸ MailMan” menu): -* Set Password (used for reject/approve) -* Reject or Approve a moderator mail +* Reject or approve a moderator mail +* Set password for approve replies +* Set default action for reject/approve replies (open in composer or send email) * Show mailing list archive (opens in browser) -* Show Subscribe page (opens in browser) +* Show subscribe page (opens in browser) * Unsubscribe (opens in browser) # Installation From a92fb3a344af62f1f91ba8cd17403d689bced0fb Mon Sep 17 00:00:00 2001 From: Max Rydahl Andersen Date: Thu, 16 Feb 2017 22:11:13 +0100 Subject: [PATCH 6/9] Use mailto if available Why: * when i'm not behind vpn I cannot visit the http urls for unsuscribe. would be great if unsubscribe would honor mailto: if they are available. * Using the menu always is slow. This change addreses the need by: * look for mailto before http and then just use it to open corresponding mailto. * add a shortcut `Option+u` for unsubscribe. --- Support/bin/showinfo | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Support/bin/showinfo b/Support/bin/showinfo index e5a7ea7..aae064b 100755 --- a/Support/bin/showinfo +++ b/Support/bin/showinfo @@ -4,9 +4,17 @@ require "uri" uris = URI.extract(ENV['MM_LIST_INFO']) -uris.each do |url| - if url.start_with?('http') - cmd = "open " + url - system(cmd) - end +nothingfound = true + +uris.each do |url| url.start_with?("mailto:") + system("open " + url) + nothingfound = false +end + +if nothingfound then + uris.each do |url| url.start_with?("http") + system("open " + url) + end end + + From d13f3ac97e3ab9167595ac4e3537f2eeabd0cf77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Kj=C3=A6r=20Nielsen?= Date: Fri, 24 Nov 2017 14:30:27 +0100 Subject: [PATCH 7/9] Fixed: Shebangs were incorrect. --- Support/bin/approve | 2 +- Support/bin/reject | 2 +- Support/bin/set_action | 2 +- Support/bin/set_password | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Support/bin/approve b/Support/bin/approve index 586c6cc..528f497 100755 --- a/Support/bin/approve +++ b/Support/bin/approve @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash PASSWORD=`security find-generic-password -s "${MM_IDENTIFIER}" -w 2>/dev/null` ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null` diff --git a/Support/bin/reject b/Support/bin/reject index 98ab23d..4b257c8 100755 --- a/Support/bin/reject +++ b/Support/bin/reject @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null` if [ -z "${ACTION}" ]; then diff --git a/Support/bin/set_action b/Support/bin/set_action index 936f947..94a357b 100755 --- a/Support/bin/set_action +++ b/Support/bin/set_action @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null` diff --git a/Support/bin/set_password b/Support/bin/set_password index af449a1..449f01c 100755 --- a/Support/bin/set_password +++ b/Support/bin/set_password @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash PASSWORD=`security find-generic-password -s "${MM_IDENTIFIER}" -w 2>/dev/null` From 36ae2999ef0d0a2b2549a64bf444dcfbf33e78d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Kj=C3=A6r=20Nielsen?= Date: Sat, 2 Dec 2017 12:14:17 +0100 Subject: [PATCH 8/9] Fixed: Renamed key to the correct one ('select' -> 'conditions'). --- Commands/Approve.mmCommand | 2 +- Commands/Reject.mmCommand | 2 +- Commands/Show Archive.mmCommand | 2 +- Commands/Subscribe Info.mmCommand | 2 +- Commands/Unsubscribe.mmCommand | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Commands/Approve.mmCommand b/Commands/Approve.mmCommand index 6f3cbb0..6ac2e6a 100644 --- a/Commands/Approve.mmCommand +++ b/Commands/Approve.mmCommand @@ -1,7 +1,7 @@ { name = 'Approve'; uuid = 'F3D4B55F-2E86-4CAC-A0A5-18D172F017B7'; - select = 'list-id exists'; + conditions = 'list-id exists'; environment = 'MM_TO=${to}\nMM_NAME=${list-id.description}\nMM_IDENTIFIER=${list-id.identifier}\n'; output = 'actions'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/approve"\n'; diff --git a/Commands/Reject.mmCommand b/Commands/Reject.mmCommand index 8aee929..cbf1dac 100644 --- a/Commands/Reject.mmCommand +++ b/Commands/Reject.mmCommand @@ -1,7 +1,7 @@ { name = 'Reject'; uuid = 'BF23BD82-6EE9-4298-9B52-03A6B9CE6E80'; - select = 'list-id exists'; + conditions = 'list-id exists'; environment = 'MM_TO=${to}\n'; output = 'actions'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/reject"\n'; diff --git a/Commands/Show Archive.mmCommand b/Commands/Show Archive.mmCommand index 888fe1a..ac7a210 100644 --- a/Commands/Show Archive.mmCommand +++ b/Commands/Show Archive.mmCommand @@ -1,7 +1,7 @@ { name = 'Show Archive'; uuid = '7B421EEB-5146-4776-AE05-53D2ED581AE1'; - select = 'list-subscribe exists'; + conditions = 'list-subscribe exists'; environment = 'MM_LIST_INFO=${List-Archive}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/showinfo"\n'; keyEquivalent = '^m'; diff --git a/Commands/Subscribe Info.mmCommand b/Commands/Subscribe Info.mmCommand index 7b8517a..89fe95a 100644 --- a/Commands/Subscribe Info.mmCommand +++ b/Commands/Subscribe Info.mmCommand @@ -1,7 +1,7 @@ { name = 'Show Subscribe Info'; uuid = '20C4178E-9BC4-4F45-9549-8B9F6E9E30F0'; - select = 'list-subscribe exists'; + conditions = 'list-subscribe exists'; environment = 'MM_LIST_INFO=${List-Subscribe}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/showinfo"\n'; keyEquivalent = '^m'; diff --git a/Commands/Unsubscribe.mmCommand b/Commands/Unsubscribe.mmCommand index 0806554..59afed4 100644 --- a/Commands/Unsubscribe.mmCommand +++ b/Commands/Unsubscribe.mmCommand @@ -1,7 +1,7 @@ { name = 'Unsubscribe'; uuid = 'F1E5592F-377B-4F49-9F7F-F8A7C8E2F7BA'; - select = "list-unsubscribe exists"; + conditions = "list-unsubscribe exists"; environment = 'MM_LIST_INFO=${List-Unsubscribe}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/showinfo"\n'; keyEquivalent = '^m'; From 426beb90a6488f060d9a0d002a2fdbc8fe26d7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Kj=C3=A6r=20Nielsen?= Date: Sat, 3 Mar 2018 12:03:06 +0100 Subject: [PATCH 9/9] Fixed: Setting MM_NAME even if a List-ID description isn't found. --- Commands/Approve.mmCommand | 2 +- Commands/Set Password.mmCommand | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Commands/Approve.mmCommand b/Commands/Approve.mmCommand index 6ac2e6a..d9230ff 100644 --- a/Commands/Approve.mmCommand +++ b/Commands/Approve.mmCommand @@ -2,7 +2,7 @@ name = 'Approve'; uuid = 'F3D4B55F-2E86-4CAC-A0A5-18D172F017B7'; conditions = 'list-id exists'; - environment = 'MM_TO=${to}\nMM_NAME=${list-id.description}\nMM_IDENTIFIER=${list-id.identifier}\n'; + environment = 'MM_TO=${to}\nMM_NAME=${list-id.description:${list-id.identifier}}\nMM_IDENTIFIER=${list-id.identifier}\n'; output = 'actions'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/approve"\n'; keyEquivalent = '^m'; diff --git a/Commands/Set Password.mmCommand b/Commands/Set Password.mmCommand index 5c1354c..8334b3d 100644 --- a/Commands/Set Password.mmCommand +++ b/Commands/Set Password.mmCommand @@ -1,6 +1,6 @@ { name = 'Set Password'; uuid = '00C14F3D-A787-4C6F-8BDC-5BC59B7B3F3A'; - environment = 'MM_NAME=${list-id.description}\nMM_IDENTIFIER=${list-id.identifier}\n'; + environment = 'MM_NAME=${list-id.description:${list-id.identifier}}\nMM_IDENTIFIER=${list-id.identifier}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/set_password"\n'; }