Python - fetchmail to execute command based on email subject

410 Views Asked by At

I am wanting to control a remote system based on an email inbox. For example, a email account with a message in it, with a subject of "Start motor". I have fetchmail retrieving one message and outputting it into file. Is there an option to just get a message subject with fetchmail?

I am trying to parse or grep the output file to search for the subject "Start motor". I was trying to pipe the grep but I do not see an option to True/False if the text string is found?

Assuming the text string is found, I want to GPIO.output(18,GPIO.HIGH)

0

There are 0 best solutions below