[MlMt] Junk mail actions

Benny Kjær Nielsen mailinglist at freron.com
Wed Aug 21 09:23:00 EDT 2013


On 21 Aug 2013, at 0:28, Benny Kjær Nielsen wrote:

> On 20 Aug 2013, at 22:05, Christopher LILJENSTOLPE wrote:
>
>> [...]
>> 1) Tell spamsieve it's junk
>> 2) Send a copy to the training address(es) of my upstream server
>> 3) Delete it.
>>
>> Is there a way to add scripts to the functions?
>
> Only in the latest test versions and it's both experimental and 
> undocumented :-)

I needed to fix a couple of bugs before I could make it work. Before 
trying the following you must fetch the latest test release (r3625).

Let me first cite part of the release notes for r3587:

> ### Rules and Scripts
>
> This is **highly experimental** and don't expect anything to work as 
> expected. I would prefer if anything related to this is only discussed 
> by feedback email or on the mailing list:
>
> 	defaults write com.freron.MailMate MmTwoPointOhFeaturesEnabled -bool 
> YES
>
> Restart MailMate and the Mailbox Editor of all mailboxes should 
> include a “Rules”
> pane. It should then be possible to filter messages and then 
> “Move/Copy to Mailbox”,
> “Set/Remove Tag”, “Play Sound”, and “Run Script”. The last 
> one works to some extent, but it's undocumented for now since the 
> “API” is still in flux.
>
> You might also notice an empty “Command” menu in the main menu of 
> MailMate. How to use this is also undocumented for now.

The following is what you need to do (I think) to solve your problem.

First, unarchive the attached file in this folder:

	~/Library/Application Support/MailMate/Bundles/

Second, edit this file:

	~/Library/Application Support/MailMate/Bundles/Junk 
Handling.mmBundle/Commands/SendUpstream.mmCommand

You need to replace two email addresses. One with your own address and 
another with the upstream address. Ideally, this should be done 
elsewhere, but we'll hardcode it for now.

Third, double-click the universal Junk mailbox and select the Rules 
pane. Add a rule which only has a set of actions (which are then going 
to be applied to all messages added to the Junk folder). They should be 
like this:

![](cid:157200AF-0EAD-41AC-B7C9-A1784D4D9FF1 at freron.com 
"PastedImage.png")

That's it. Now you can try to move a message to the Junk mailbox.

Note that the script is also available in the “Command/Junk 
handling” menu. This is useful for testing the script on selected 
message(s).

Also note that I assume the `sendmail` Terminal command used in the 
MailMate command works. I'm a bit unsure on whether or not it works by 
default on OS X. On my current machine (10.7) it seems Postfix is 
launched automatically, but I might have configured something in the 
past. You can watch errors using the following command in the Terminal:

	tail -f /var/log/mail.log

I haven't tested with SpamSieve, but in theory that should work as well 
(when moving to Junk the message is marked as junk and thereby 
implicitly given to SpamSieve).

Feedback is welcome. Don't forget the part about fetching the latest 
test release.

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20130821/9871762b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Junk Handling.mmBundle.zip
Type: application/zip
Size: 2431 bytes
Desc: not available
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20130821/9871762b/attachment-0001.zip>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedImage.png
Type: image/png
Size: 14357 bytes
Desc: not available
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20130821/9871762b/attachment-0001.png>


More information about the mailmate mailing list