Jump to content

Recommended Posts

Posted

Good question. You can put the script anywhere in your account, but I would recommend /home/dr/email.py because that's not accessible through a browser for the extra security.

  • First go to https://tommy.heliohost.org:2083/frontend/paper_lantern/mail/filters/managefilters.html
  • Pick the email address that you want to forward to the script and click manage filters next to it.
  • Click create new filter.
  • Name is "Pipe to Python" or whatever.
  • Set up your rules if you only want certain emails to be piped or all of them, etc.
  • In the actions dropdown box select pipe to a program
  • Enter the path to your python script with a pipe character first, such as |/home/dr/email.py
  • Click create
Then as far as the python script goes you'll need the python shebang for the version you want to use first, and then the email will come to the script along stdin so you can process the text as you would any other stdin input.
Posted

Awesome, thanks! This works with filters, but when I try this with a forwarding address, I keep getting this error:

Could not exec '/home/dr/email_reply.py'

Can I only pipe to Python with filters?

Could not exec '/home/dr/email_reply.py'
Posted

It looks like you forgot the pipe character | That's very important. It should look like

|/home/dr/email_reply.py
Yes, this will only work with filters. Forwarding just takes the email changes the to: field and sends it back through the email system. Filter is what processes the email.
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...