topgeardavid Posted May 19, 2017 Posted May 19, 2017 How could I set up a forwarding address that pipes to a Python script? What path should the script be at?
Krydos Posted May 19, 2017 Posted May 19, 2017 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.htmlPick 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 programEnter the path to your python script with a pipe character first, such as |/home/dr/email.pyClick createThen 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.
topgeardavid Posted May 19, 2017 Author Posted May 19, 2017 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'
Krydos Posted May 19, 2017 Posted May 19, 2017 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. 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now