0

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)

HenryD
  • 1
  • Read: [python.org/3/library/mailbox.html#examples](https://docs.python.org/3/library/mailbox.html#examples). The first example should be fine for you. – stovfl Sep 07 '18 at 12:45
  • What I understand from reading the mailbox spec is that it is for mail that is on the drive. I am referencing email that is on a GMail mailbox. – HenryD Sep 08 '18 at 00:28
  • Read: [pop3-lib](https://docs.python.org/3/library/poplib.html#) – stovfl Sep 08 '18 at 12:23
  • A working example: [read-email-pop3](https://pythonspot.com/read-email-pop3/) – stovfl Sep 08 '18 at 12:28

0 Answers0