On Wed, 5 Feb 2003, Thomas Mueller wrote: > I never got to use procmail but will no doubt study the > man page when I get set > up with Linux (Slackware 8.1). Can procmail search on only the headers, or > only the Return-Path: line?
Yup. Search only the headers, search only the body, search the whole e-mail. > I would like to put all the NetBSD mails in one > file or folder, coming from [EMAIL PROTECTED], > [EMAIL PROTECTED], and > [EMAIL PROTECTED], no advantage in separate files, > could search Return-Path: > line for "netbsd" string. Yup. Simple as :0 : * ^Return-Path:.*netbsd $MAILDIR/netbsd-folder > For spam, I might choose a safe procedure of putting > spam candidates in a separate file but not /dev/null until I look through them > all. You will soon see that some characteristics will flag your mail as *always* being spam. Looking through them all is a waste of time. Suppose there's a domain that has as its only purpose, spam. ALL mail from interbusiness.it is something you don't care to see. Further, complaints to the abuse address at that ISP are never acknowledged, nor do they make any difference. Pipe them to /dev/null before your log function and you never even have to know they exist... or pipe them to /dev/null after the log spec, and the only time you'll have to think about them is if you happen to peruse your logfiles, at which time you'll see the forged From: address, date and time the mail was processed by procmail, the fact that it went to /dev/null, and its size: >From [EMAIL PROTECTED] Mon Feb 24 01:40:02 2003 Subject: Check out this Crazy new Formula... Its Unbelievable Folder: /dev/null 2863 > Then I can save legit messages but delete the others en > masse. Maybe I could search the headers, not > case-sensitive, for a string charset=euc-kr and > charset=ks_c_5601-1987 (typing this from memory, > sometimes there are quotes) > Sure, no problem. > Spam phrases could occur in a message discussing the issue of spam; recurring > topics include improving one's breast or penis size, and Viagra, and then there > are the sexy young women on webcams or sexy web sites. > > Breast enlargement can occur in young men normally, and in older men as a side > effect of some prescription drugs, quite apart from spam. Procmail could be used as a conditional operator there. "If mail is from my pharmacist, send it to my inbox" "If [Vv]iagra is in the Subject, send it to /dev/null" "If [Vv]iagra is in the Body, send it to spamfolder" Given those rules in that order, your pharmacist can e-mail you and discuss your viagra use all he wants, both in Subject and body, and it will go to your inbox. When your brother writes about his vacation, and incidentally mentions he's trying out viagra... it'll end up in your spamfolder, where you can read it and reply. When the spammer writes "Viagra at discount prices" in the subject, the mail will disappear, and you'll never see it. SpamAssassin does better with those kinds of words and phrases, assigning points to various conditions, and then acting on the e-mail based on the total number of points it accrues. SpamAssassin can also send mail to a separate file where you can check it out, or straight to /dev/null. > I never heard of "ham" referring to legit email, as opposed to spam. It seems to be mostly be a recent usage pretty much restricted to the "spamfighting industry." -- Steve Ackman http://twoloonscoffee.com (Need green beans?) http://twovoyagers.com (glass, linux & other stuff)
