Run python script after incoming email


I’m a newbie to linux mail server. I’d like to run a python script based on an email that arrives in the inbox of a specified mail account. E.g.: When I send an email with subject ‘>’ this mail triggers the python script for creating an alias. I’d like to use this to create aliases for me and my wife when we register to newsletter or websites without logging on to mailinabox.

Is there a way to do this?

Regards Christian

Why not use +tags and sieve filtering instead? You can add ‘+tagname’ after any email user on your system and the message will be delivered to your inbox. Then you can use custom sieve filtering to forward it on to others (as well as a bunch of other stuff).

So if you want to give your email address to Microsoft, and your email address is, then give them Then go into your MIAB roundcube install, click “Settings” and then click the “Filters” tab, then click the ‘+’ icon at the bottom to create a new filter.

Hi! This would mean, that would always be active and all the messages would be forwarded. When I want to delete I would have to set another filter to delete the message. Is this assumption correct?

Best Regards


Yup. On a former mailserver, I used to point mail directly to /dev/null when I didn’t want them anymore, but that was usually when it was either a service that was compromised and lost their entire user roster, or because I got more unsolicited mail than I could handle to the alias.

If you really need a ‘throwaway’ email address you don’t want to have to check, you might consider either an alternate account on your MIAB or use a service like