diff --git a/Commands/Approve.mmCommand b/Commands/Approve.mmCommand index a7265b9..d9230ff 100644 --- a/Commands/Approve.mmCommand +++ b/Commands/Approve.mmCommand @@ -1,7 +1,9 @@ { name = 'Approve'; uuid = 'F3D4B55F-2E86-4CAC-A0A5-18D172F017B7'; - environment = 'MM_TO=${to}\nMM_NAME=${list-id.description}\nMM_IDENTIFIER=${list-id.identifier}\n'; + conditions = 'list-id exists'; + 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/Reject.mmCommand b/Commands/Reject.mmCommand index 59305b7..cbf1dac 100644 --- a/Commands/Reject.mmCommand +++ b/Commands/Reject.mmCommand @@ -1,7 +1,9 @@ { name = 'Reject'; uuid = 'BF23BD82-6EE9-4298-9B52-03A6B9CE6E80'; + conditions = '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/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/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'; } diff --git a/Commands/Show Archive.mmCommand b/Commands/Show Archive.mmCommand index aea6310..ac7a210 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'; + 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 39b6219..89fe95a 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"; + 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 3e6576a..59afed4 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"; + conditions = "list-unsubscribe exists"; environment = 'MM_LIST_INFO=${List-Unsubscribe}\n'; command = '#!/bin/bash\n"${MM_BUNDLE_SUPPORT}/bin/showinfo"\n'; + keyEquivalent = '^m'; } diff --git a/README.mdown b/README.mdown index ab2a957..35cd067 100644 --- a/README.mdown +++ b/README.mdown @@ -1,24 +1,19 @@ -# 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) +* 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) +* 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 diff --git a/Support/bin/approve b/Support/bin/approve index dccb015..528f497 100755 --- a/Support/bin/approve +++ b/Support/bin/approve @@ -1,6 +1,10 @@ -#/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` +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..4b257c8 100755 --- a/Support/bin/reject +++ b/Support/bin/reject @@ -1,4 +1,9 @@ -#/bin/bash +#!/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..94a357b --- /dev/null +++ b/Support/bin/set_action @@ -0,0 +1,26 @@ +#!/bin/bash + +ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null` + +osascript </dev/null` 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 + + 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