Roundcube Community Forum

 

Detailed instructions for how to use PHP-based email "pipe-to-program" filters.

Started by MisterPotamus, December 31, 2024, 02:06:16 PM

Previous topic - Next topic

MisterPotamus

My email hosting provider (Directnic) utilizes roundcube, but they only support "pipe-to-program" email filters that are written in PHP.

I'm looking for detailed documentation for what are the inputs, outputs, functions, variables, and script return values that are utilized within PHP-written "pipe-to-program" email filters. Directnic has made it clear that they themselves do not offer documentation for writing such PHP-based roundcube filters, and that's why I'm posting this message here.

I am NOT looking for help with the PHP language itself. I am very familiar with PHP.

I simply want instructions and documentation specifically for writing PHP email filtering programs for roundcube. For example (just two items out of many things that I want to learn): what will appear on the PHP-based email filter's command line when a message is passed into the filter, and what should a PHP-written roundcube email filter return when deterimining that a given email should be accepted, bounced back to the sender, dropped, rejected, forwarded, redirected to a folder, etc. etc. etc.

And again, these are just two of the several things that I want to learn about writing PHP-based roundcube email filters, and I therefore am looking for pointers to detailed documentation about writing PHP-based roundcube email filters.

Thank you in advance for any pointers to such documentation.


SKaero

Roundcube doesn't handle email filtering, that would be the responsibly of the mail server so there is no Roundcube "pipe-to-program" function.

My best guess at what your looking at is the cPanel "Pipe to a Program" function but all that does is send the message body to the script it doesn't allow for custom filter logic. https://docs.cpanel.net/knowledge-base/email/how-to-configure-email-filters/#pipe-to-a-program an example of how you can read the email body is here: https://hostlantern.com/clients/knowledgebase/384/How-to-pipe-an-email-to-a-PHP-script.html but again it doesn't allow for returning any filter logic.

If your host isn't using cPanel they may have something custom setup but you would have to ask them for documentation on that.

MisterPotamus

Oh, I see. Well, as I already mentioned in my original message, the Directnic people refuse to offer any filter documentation.

So, I guess I'm just out of luck.

Thank you for your explanation.