I had to make a small interface for a client who wants to be able to block spam. I couldn’t find a ready-made one or other option. If the approach is stupid, please tell me if there was an easier option without giving him access to the system.
Since I couldn’t find it anywhere and I only know PHP, I did it like this.
I set the interface to the client account
domain/file.php
<?php
if (!empty($_POST['textfield']))
{
file_put_contents("spam.txt",$_POST['textfield']);
}
$content = file_get_contents("spam.txt");
?>
I’m not sure about your code but there is already an option in Roundcube / Sieve to filter e-mails.
Another way is to use global exim4 blocking lists, like so:
I have setup three global blocking lists. One for tld’s, one for domains and one for specific e-mailaddresses.