Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Commands/Approve.mmCommand
Original file line number Diff line number Diff line change
@@ -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';
}
2 changes: 2 additions & 0 deletions Commands/Reject.mmCommand
Original file line number Diff line number Diff line change
@@ -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';
}
6 changes: 6 additions & 0 deletions Commands/Set Email Action.mmCommand
Original file line number Diff line number Diff line change
@@ -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';
}
2 changes: 1 addition & 1 deletion Commands/Set Password.mmCommand
Original file line number Diff line number Diff line change
@@ -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';
}
3 changes: 2 additions & 1 deletion Commands/Show Archive.mmCommand
Original file line number Diff line number Diff line change
@@ -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';
}
4 changes: 2 additions & 2 deletions Commands/Subscribe Info.mmCommand
Original file line number Diff line number Diff line change
@@ -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';
}
4 changes: 2 additions & 2 deletions Commands/Unsubscribe.mmCommand
Original file line number Diff line number Diff line change
@@ -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';
}
23 changes: 9 additions & 14 deletions README.mdown
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 6 additions & 2 deletions Support/bin/approve
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -23,7 +27,7 @@ cat << END
};
resultActions = (
{
type = "openMessage";
type = "${ACTION}";
}
);
},
Expand Down
9 changes: 7 additions & 2 deletions Support/bin/reject
Original file line number Diff line number Diff line change
@@ -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 = (
Expand All @@ -12,7 +17,7 @@ cat << END
};
resultActions = (
{
type = "openMessage";
type = "${ACTION}";
}
);
},
Expand Down
26 changes: 26 additions & 0 deletions Support/bin/set_action
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

ACTION=`defaults read com.freron.MailMate MmMailManCommandAction 2>/dev/null`

osascript <<END
tell application "System Events"
activate
set theDefault to "open composer"
if "${ACTION}" is equal to "sendMessage"
set theDefault to "send immediately"
end

set result to choose from list {"open composer", "send immediately"} with title "Approve/Reject Emails" with prompt "After creating reply then" default items { theDefault }

if result is not false then
set theAction to item 1 of result
if theAction is "open composer" then
set theAction to "openMessage"
else
set theAction to "sendMessage"
end

do shell script "defaults write com.freron.MailMate MmMailManCommandAction -string '" & theAction & "'"
end if
end tell
END
2 changes: 1 addition & 1 deletion Support/bin/set_password
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#/bin/bash
#!/bin/bash

PASSWORD=`security find-generic-password -s "${MM_IDENTIFIER}" -w 2>/dev/null`

Expand Down
18 changes: 13 additions & 5 deletions Support/bin/showinfo
Original file line number Diff line number Diff line change
Expand Up @@ -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


6 changes: 3 additions & 3 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<plist version="1.0">
<dict>
<key>contactEmailRot13</key>
<string>zz-ohaqyrf@sereba.pbz</string>
<string>znk.naqrefra@tznvy.pbz</string>
<key>contactName</key>
<string>Benny Kjær Nielsen</string>
<string>Max Rydahl Andersen</string>
<key>description</key>
<string>Commands for the MailMan mailing list software</string>
<string>Commands for the MailMan mailing list software.</string>
<key>name</key>
<string>MailMan</string>
<key>uuid</key>
Expand Down