Feature Request: Set filters with REST API

Hi guys,

I would like to be able to set an email filter (for a vacation auto-reply) using the REST api. Is this too advanced of a feature to request?

I currently use the REST API to allow managers the ability of creating email accounts & aliases from our custom inventory program at work. I would love to handle vacation “away” messages from within our custom database as well.

I don’t mind working on the code and then submitting a pull request once I figure out how to do it. (If anyone has any pointers of where to look into adding this feature… :stuck_out_tongue: )

Thanks,

  • Matt

You’d have to be able to read PHP and write Python to get it done. You can look at the code in the RoundCube plugin that allows you to create filters in order to see what has to be done on the server and then transfer that into the Python-based Mail-in-a-Box Daemon in order to add this feature to the API offered there.

The code that you wanna read is located here on a Mail-in-a-Box server:

/usr/local/lib/roundcubemail/plugins/managesieve/managesieve.php

or here directly from the RoundCube Git:

The code that serves the API can be found here:

I’m not an active dev of this project, so I’m sure someone else can give you more in-depth pointers if you need them.

The box already exposes a ManageSieve server for remote administration of filters:

https://wiki2.dovecot.org/Pigeonhole/ManageSieve

I see what you are referring to Josh, it looks port 4190 is the default ManageSieve listening port. I could write a telnet script from my custom app to do what I need right now, awesome.

For the future I would prefer the API to be part of the JSON & REST API but this looks like it will work for now. If and when I work on this enhancement with the REST API I will submit a Pull Request. Thank you hachre for showing me the spots where I can hook in for that! :+1:

  • Matt
1 Like

Telnet probably wont work because you’ll need to activate STARTTLS to log in.

True, thanks. I will need to use stunnel or openssl’s telnet. Won’t be working on this till next week because of other projects but I will update you on my progress when I do.

This topic was automatically closed after 61 days. New replies are no longer allowed.