[MlMt] How to create a Mailbox Rule which extracts attachments

Benny Kjær Nielsen mailinglist at freron.com
Mon Jul 1 09:55:03 EDT 2024


Hi,

this is a relatively old thread, but I'd like to put some focus on a new 
feature which I'd like to be used/tested since it involved a lot of 
changes to various parts of MailMate.

On 12 Feb 2024, at 4:55, leo wrote:

> Maybe it is possible to develop a bundle which extracts attachments to 
> folders?

Yes, that is possible, but it's not easy. MailMate included an example 
of exporting messages (in the Command menu) which could be changed to 
export attachments. Luckily, there is now an easier way.

> But good to know I’m not alone here with this need….

I've had some very varied requests for different kinds of export needs. 
Hopefully, the new functionality will address most of those needs, but 
we'll see. I'll be interested in knowing its specific limitations.

The new feature can be used in two different ways. Its direct use (after 
selecting some emails) is available via the “File > Export” menu 
item and its rule-based use is, of course, available in the Rules pane 
of any mailbox (as an action). Both have the same functionality, but the 
latter is triggered automatically.

These are the options when doing an Export:

* Export: [ Messages || Attachments | Images | PDFs ]
* Relative path: [ No subpath | Source/Mailbox path | Mailbox | Sender 
Address ]
* Filename: [ Filename | Internal ID | Subject ]

The first option determines what to export, the second option let's you 
specify folders to be created (if they do not already exist) and the 
final option lets you control the file naming.

Some of it is a bit proof-of-concept. All 3 options can be extended with 
more options using low-level configuration files, but let's first see 
what kind of needs they do not cover.

> On 26 Jan 2024, at 19:25, Stefan Dorscht wrote:
>
>> I have a similar request here, I would like to export attachments 
>> from mails (with one or more attachments - some without attachments 
>> which shouldn’t be touched) to folders on my Mac.
>>
>> It would be ideal if all the attachments of each mail were placed in 
>> a single new folder.

That's not covered by the above since this folder would then need a 
unique name like the internal ID.

>> It would be even better if this folder then also had the name of the 
>> sender of the mail.

That part could be done with “Sender Address” for the relative path, 
but different emails from the same sender would then share this folder.

>>> From some incoming mail messages is there a way to extracts its 
>>> attachments to a folder?
>>>
>>> I am thinking of setting up a Smart Mailbox, but in the *Actions* 
>>> for the Mailboxes _Rules_ I couldn’t find anything which acts on 
>>> attachments…

This is possible now. Using the “Attachments” options, MailMate will 
pick any part of an email with a filename assigned in its headers (which 
I think is the most robust way to identify attachments). There's also 
support for just exporting images or PDFs, but more variants could be 
made if needed.

-- 
Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freron.com/pipermail/mailmate/attachments/20240701/0de673f6/attachment.htm>


More information about the mailmate mailing list