To get an EFM filter to forward bad mail and ignore good mail, a new version of FQ's shell command "except" would be handy. Say there were a program called
Code:
NAME
exceptstop - switch the exit code of a program with 99
SYNOPSIS
exceptstop program [ arg ... ]
DESCRIPTION
exceptstop runs program with the given arguments.
If program exits 0, exceptstop exits 99.
If program exits 100, exceptstop exits 100;
If program exits 111, exceptstop exits 111.
If program exits anything else, exceptstop exits 0.
SEE ALSO
except(1), condredirect(1)
Then the CNC Simple Filter
Code:
condredirect bad@domain.tld exceptstop /big/dom/x/emailfilter/emailfilter_1.py
(I'm shortening xdomain to x so it will fit here on one nice line.)
would filter "blackholed" mail to
bad@domain.tld and let good mail go to its intended email box.
Might as well write it out (it's confusing to me anyway):
Code:
1. EFM --> exits 0-good --> exceptstop --> exits 99-stop
--> condredirect does nothing --> exits 0-deliver
2. EFM --> exits 99-blackhole --> exceptstop --> exits 0-good
--> condredirect fwds msg to bad@ --> exits 99-stop
3. EFM --> exits 100-bounce --> exceptstop --> exits 100-bounce
--> condredirect does nothing --> exits 100-bounce
Does anyone know how to write something like "exceptstop"?
(A simpler program that just changes 100 to 99 could be used in conjunction with the existing "except" command. It would change
bounce actions into forwards, which would be more confusing.)
When I say
forward I mean
redirect. Errr.