user393267
user393267

Reputation:

automate Mail so it can run a shell script when a specific message is received

I am trying to see if there is a way to get this done: Basically I get email from a server at specific intervals, so I am trying to run a shell script that will perform an install of a specific package on my mac when the mail arrives.

I do not have access to the server so I cannot do anything on it; I can only rely on the fact that at an undetermined time during the day, I will get the email and I will need to install a package. I am doing it by hand but it is tedious honestly, and prone to error if I am not checking the email for any reason.

I was thinking to use Applescript, but if there is any other way to do this via console or shell script, I would be more happy honestly (never been a great fan of Applescript).

Is there any way to accomplish this task? I don't even understand if mail on OSX is scriptable. I've looked around but I've found only Automator links. I know Python as scripting language, if that can be used in any way with Mail.

Thanks in advance.

Upvotes: 1

Views: 1846

Answers (1)

Sam Axe
Sam Axe

Reputation: 33738

Hit preferences in Mail, select the Rules tab. One of the actions is to run an AppleScript. You could have the AppleScript fire off a shell script if you wanted.

Upvotes: 2

Related Questions