[PLUG] Procmail recipe

Sandy Herring sandy at herring.org
Tue Oct 22 23:17:03 UTC 2002


Russ,

I take it you want to both (1) add an "X-Folder: SPAM" header, and (2)
deliver it to your SPAM mail folder. This will do it...

#SPAM
:0:
* ^Subject:.*\*\*\*\*\*SPAM\*\*\*\*\*
| ${FORMAIL} -A"X-Folder: SPAM"
SPAM

...assuming, of course, the `${FORMAIL}' expands to the location of the
`formail' executable on your system (e.g. /usr/bin/formail). That's not an
environment variable which is automatically set by `procmail'.

BTW, note the inclusion of the ".*" regexp after the "Subject:" header.

Lastly, if it's spamassassin that's tagging the Subject: for you (I'd bet a
brewskie on that :-), you could simply test against the header it inserts...

## Flagged as SPAM by spamassassin?
:0:
* ^X-Spam-Status: Yes
SPAM

...and not even bother adding your own X-header.

hth,
Sandy


On Tue, 22 Oct 2002, Russ Johnson wrote: 
> I'm just now getting to some of the more convoluted procmail stuff.
> 
> I have the following in my .procmailrc:
> 
> #SPAM
> :0:
> * ^Subject:\*\*\*\*\*SPAM\*\*\*\*\*
> | ${FORMAIL} -A"X-Folder: SPAM" >>~/Mail/SPAM
> 
> Basically, I want any mail with "*****SPAM*****" in the subject line to
> go to the spam holding area, ~/Mail/SPAM. 
> 
> What I have above isn't working. 
> 
> I've tried * ^Subject:*****SPAM***** too, and that didn't work either.
> 
> What have I overlooked?
> 
> -- 
> --
> Russ Johnson
> Dimension 7/Stargate Online
> http://www.dimstar.net

-- 
Sandy Herring, RHCE                        o              sandy at herring.org
Peck of Pickled Pisces               __  o               http://herring.org/
UNIX or Web authoring questions?  |\/ o\  o  http://herring.org/finger.html
->http://herring.org/techie.html  |/\__/     http://herring.org/pub-key.asc
*sh, Perl, C, VBA, PICK Assembler, Data/Basic, PROC & profanity spoken here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20021022/50a49e74/attachment.asc>


More information about the PLUG mailing list