email piping after spam/virus check


is it possible to do email piping after spam/virus check being done? i managed to pipe email to php script using mail alias "feed to program" but the problem is that all incoming email is directly forwarded without being scanned for spam and virus.

what i wanted is incoming mails to be scanned first before being piped to my php script, is this possible?



Howdy -- you may want to look into setting up the email piping from withing Usermin, rather than Virtualmin. Usermin generally performs those actions later in the delivery process.

Unfortunately due to the way mail delivery works on Linux, spam/virus scanning is done only upon delivery to a user - and piping to a command happens before (or instead of) that.

i tried email forwarding in usermin but i didn't have the option to "feed to program" only forward to email, does this forward to email scan for spam/virus before forwarding or directly forward it when email is received?

I had to ask for Jamie's assistance on this one... it sounds like this can indeed be done in Usermin, but the option isn't enabled by default for security reasons, as it allows an email user to execute any program on the server.

What you would need is to use the "Procmail Mail Filter" option.

To use that, you would first need to enable it by going into Webmin -> Webmin -> Usermin Configuration -> Available Modules, and there you can enable "Procmail Mail Filter".

Once you do that, your email users will be able to pipe email into a program using Usermin.