On Wed, Jan 30, 2008 at 08:22:55PM +0100, Karsten Bräckelmann wrote: > On Wed, 2008-01-30 at 15:20 +0000, Arthur Dent wrote: > > The // are matched literally, they are not used as an RE delimiter. The > entire string after the asterisk is a regex anyway. Lose the slashes. > > Procmail does not know this kind of bounded repetition. {4,} again will > be matched literally. Also, procmail does not know classes like \d. You > will have to write it, just as you mean it. > [0-9][0-9][0-9][0-9] > > Oh, and the @ must be escaped in SA, because it denotes a LIST in Perl. > This is Perl specific, not RE related. Don't escape it in procmail. :) > > Also, this matches the entire header line -- as opposed to SA header > rules, where the RE matches on the headers value only. Thus, since this > is bound at the beginning of the line, you will need to add wildcards > for optional stuff between the To: and the numbers. > > > Something like this should work. NOTE: Untested. > > :0 : > * [EMAIL PROTECTED] > spam/to-numerical > Brilliant! It works! Thank you so much Guenther (and others who have replied off-list to help me with this).
If I can have your assistance with just one other thing however. I'm afraid I really don't understand file-locking in Procmail (I have read the man and web pages) but I'm still baffled. Now that I have it matching on the appropriate spam I want to rewrite the subject (in the same style as I have SA doing) and place it in the same spam folder as SA does so that I have it present for my nightly cron sa-learn job. This is what I have so far: :0: * [EMAIL PROTECTED] { :0 fhw * ^Subject:\/.* | formail -i "Subject: [SPAM (XXX)] $MATCH" } :0: * ^Subject:.*\[SPAM \(XXX\)\].* IN-Spam I could not find a way to combine the matching, subject rewriting and moving into one step (is this possible?). The above method works but give me the following error message in my Procmail log: procmail: Extraneous locallockfile ignored From [EMAIL PROTECTED] Wed Jan 30 19:47:28 2008 Subject: [SPAM (XXX)] This is a test Folder: IN-Spam Help me fix this and I promise I'll be right back on-topic with all future posts (honest!). > When writing procmail receipts, it often helps a lot to remind oneself > of procmails supported REs by checking 'man procmailrc' or some docs on > the net. This one is a nice reference: > http://partmaps.org/era/procmail/quickref.html > > Hope the above helps. :) Oh it surely has! Many thanks AD
pgpLzQN4cYoIA.pgp
Description: PGP signature