Submitted by markhard on Mon, 08/11/2014 - 08:27
hello,
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?
Status:
Active
Comments
Submitted by andreychek on Mon, 08/11/2014 - 10:40 Comment #1
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.
Submitted by JamieCameron on Mon, 08/11/2014 - 11:57 Comment #2
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.
Submitted by markhard on Tue, 08/12/2014 - 04:36 Comment #3
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?
Submitted by andreychek on Tue, 08/12/2014 - 15:51 Comment #4
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.