I have a very simple procmail process that takes an inbound email and redirects it to a script:
LOGFILE=/home/foo/procmail-log VERBOSE=yes MAILDIR=/var/spool/mail/foo DEFAULT=/var/spool/mail/foo SHELL=/bin/sh :0 ! `/home/foo/scripts/blah/blah.sh` The shell script has a condition that greps a file for a sender's email address and if it finds it, it exits:
grep i "$SENDER" /home/foo/scripts/blah/blah2.txt if [[ $? -eq 0 ]] ; then exit 1 fi When this happens, I want procmail to just give up / discard the message.
Interestingly enough though, if this triggers, procmail taking the value I just grepped and trying to send an email to it.
In the procmail log, I see:
procmail: Notified comsat: "foo@:/usr/sbin/sendmail -oi [email protected] [email protected]" From [email protected] Thu Feb 6 22:31:47 2014 Subject: Test Folder: /usr/sbin/sendmail -oi [email protected] sender 3165 procmail: Executing "/usr/sbin/sendmail,-oi,[email protected],[email protected]" Why is it doing this? Is there any way I can configure procmail to not do this? I just want it to give up and drop the prior email it was processing. I've tried different exit codes (0, 1, 77) but procmail always does the same thing. Any ideas?