I copied a large number of .eml files from Mail.app to a separate folder. Each message has two attachments: a .kmz in base64 and a .gpx in plain text.

I want to get these attachments from the .eml files. Since the .eml identifies the original file name, it would be nice to keep that. But it's also possible that more than one might have the same filename.

Two possible solutions :

But since I don't know much about either language, I don't know what mods they would need to be able to work on my files nor the syntax I'd need to run them.

There is also a free tool offered online, but since dozens of domain names are pushing it with identical web pages, I suspect it's malware.

I can go through the messages one by one in Mail.app and drag out the attachments, but it would be nice to not have to do that 408 times.

  • "There is also a free tool offered online" - What is this tool?
    – Thinkr
    Commented May 8, 2023 at 10:15

1 Answer 1


Well, this is embarrassing. Instead of dragging all the messages out to a Finder folder, what I should have done (and have now done) is select all those messages and then File→Save Attachments…

I think there were some filename collisions, though. Because I expect 408 messages to provide 408 .kmz, 408 .gpx, & 408 .eml for a total of 1224 files. But I only got 818 files.  I ran a script to move them into dated directories, so I'm not sure what's missing.  The ones I looked at contained all three file types.

  • What do you mean by "I only have 818 files"? Since you have 408 .kmz and 408 .gpx files, 408*2 = 816; you are supposed to have 816 files. Also, why were you expecting 1224 files?
    – Thinkr
    Commented May 8, 2023 at 10:17
  • Sloppy typing. I also got a lot of .eml files (the enclosing e-mails). So either Garmin failed to send everything, or something else went wrong. Maybe. It's been five months, so now I'm speculating.
    – WGroleau
    Commented May 8, 2023 at 14:50
  • Yeah, might need an update though?
    – Thinkr
    Commented May 8, 2023 at 15:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .