How to apply mail filter to incoming spam message

Hi there,

1) I need to be able to forward an email received and marked as spam to another user of my email server. I noticed that all mail filters work only if the email is not spam. If it is spam the mail filters dont work. (mail filters in usermin) If it is possible to achieve the above task for all user mailboxes from virtualmin at once (without having to set each one from usermin), I would be more than glad.

2) If forwarding a spam email to another local user account is not recommended, then I would like to know how to run "php test.php" command when a message is spam.

All I need is to be able to be informed if a new message gets to the spam folder.

Thanks in advance



Because by default spam filtering is enabled at the domain level and happens before it hits user filters, you have to turn off the domain-level rule before you can do what you want. This can be done in Virtualmin at Server Configuration -> Spam and Virus Delivery via the "Destination for spam emails" field (just select "Deliver normally")