PDA

View Full Version : Delete mail based on Delivered-To


Randall
08-30-2007, 06:36 PM
I've been using the SMTP-Recipient filter to delete mail from my catch-all based on certain domain names, since only one of my IRMs actually uses it -- the rest is dictionary spam and joe-job backscatter.

But now I'm redirecting spam from that account via SA, and since it runs before the built-in filters, much of the stuff that previously was being quietly deleted is now filling up my spam box at the rate of several hundred per hour. :eeww: The SMTP-Recipient filter doesn't work on the spam box because the SA redirect must have changed the envelope.

I think this filter recipe on the spam box would work:

condredirect blackhole@example.com sh -c '822field delivered-to | grep -iq @example-irm.com'

Is there something more direct than this, something that would delete the mail without shuffling bits to a blackhole account?

Randall

Tom E.
08-30-2007, 07:51 PM
Like this?
if 822field delivered-to | grep -iq @example-irm.com; then exit 99; fi

Randall
08-30-2007, 10:09 PM
Like this?
if 822field delivered-to | grep -iq @example-irm.com; then exit 99; fi I thought it might be something like that.

Not that I can claim to understand any of this stuff. But I actually did see "if...fi" in my mind's eye. :clown: Maybe it comes from exposure to the OS X terminal.

Anyway, I shall test that code forthwith. Or something like that. :yeah:

Randall

Randall
08-30-2007, 10:30 PM
Works beautifully -- the flood of example-irm.com junk has stopped dead, while other, more worthy spam (is that an oxymoron or what?) continues to trickle in.

Thanks! :bow:

Randall

Tom E.
08-31-2007, 10:23 AM
But I actually did see "if...fi" in my mind's eye.
Maybe you were channeling Tevya from Fiddler on the Roof.
if...fi were a rich man, bada, binga, bada binga...
(that's if Tevya were played by James Gandolfini)

Since I'm off-topic already, did you hear that Mr. T is the spokesman for a new cold remedy?

:hahaha: It's called "I Pity the Flu"

(I don't know if that ones been done yet, but I made it up yesterday)

Randall
08-31-2007, 11:08 AM
(I don't know if that ones been done yet, but I made it up yesterday) Only two results on Google ... which may be a good thing. :rasberry:

Randall