Re: Procmail setup problem
Stephen, you give me an example concerning how to filter the debian mailing- lists, based on X-Mailing-List: header that the mail server add to messages. ...But some mailing-lists like snort-sign, snort-users, gnupg-devel, do not add the X-headers Do you have some advices to made a magic configuration like for debian? I suppose you need to analyze an e-mail header as example But if you remember some analogous situations you already examined... Il ven, 2004-08-27 alle 00:06, s. keeling ha scritto: Incoming from Lorenzo Rossi: Il gio, 2004-08-26 alle 21:47, s. keeling ha scritto: Solution to this is scoring: :0: * 1^0 ^To:.*debian-user * 1^0 ^Cc:.*debian-user ${HOME}/Mail/debian-user What does it meen * 1^0 ^To:.*debian-user ?? ^^^ I'm a newb... You say that like it's a bad thing. :-) Also my mother is worried about my healt :) Recipes start out with a negative score. Generic patterns that match add 1 to that score. Once the score goes positive, the action clause is executed. So, for the above, a match on either triggers the action (a non-match has no effect). man procmailsc explains this. If you want the action to trigger when both match, you can seed the score: :0: * -2^0 * 1^0 ^To:.*debian-user * 1^0 ^Cc:.*debian-user debian-user That -2^0 will set the beginning score to -2. Thk for the teaching...you explain me clear the concept but looking at the output in procmail log file I can see the following lines, and a dubt arise in my mind... :) -- procmail: [2147] Fri Aug 27 23:00:34 2004 procmail: Assigning LOGABSTRACT=all procmail: No match on (^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)[EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED]# Anything from namp-hacker procmail: Score: 0 0 ^To:.*rsbac # Anything from rsbac procmail: Score: 0 0 ^Cc:.*rsbac # will go to $MAILDIR/rsbac procmail: No match on ^X\-Mailing\-List:.*debian-\/[a-z-]* procmail: Score: 0 0 ^To:[EMAIL PROTECTED] procmail: Score: 0 0 ^Cc:[EMAIL PROTECTED] procmail: Score: 1 1 ^To:.*snort-sigs procmail: Score: 0 1 ^Cc:.*snort-sigs procmail: Locking /home/milos94/Mail/IN.snort-sigs.lock procmail: Assigning LASTFOLDER=/home/milos94/Mail/IN.snort-sigs procmail: Opening /home/milos94/Mail/IN.snort-sigs procmail: Acquiring kernel-lock procmail: Unlocking /home/milos94/Mail/IN.snort-sigs.lock procmail: Notified comsat: [EMAIL PROTECTED]:/home/milos94/Mail/IN.snort-sigs From [EMAIL PROTECTED] Fri Aug 27 23:00:34 2004 Subject: [Snort-sigs] snort-rules update @ Fri Aug 27 15:15:43 2004 Folder: /home/milos94/Mail/IN.snort-sigs --- Focusing on: - [] procmail: Score: 1 1 ^To:.*snort-sigs procmail: Score: 0 1 ^Cc:.*snort-sigs [] - It seems to me that procmail set the initial value score to 0 What I'm missing? Probably I should read again the procmail docs... I'm susbscribed to multiple debian-* lists. This separates them all out into separate folders: # # debian-${MATCH} Wow very powerfull! I like it...:) You give me a lots of suggestions... Do you think my problems are mainly related to the configurations of rules? I ran into a lot of problems when I began. Multiple readings of man procmail* helped a lot. There's also the procmail-users mailing list. I just subscribed to the mailing-list, and now I'm browsing the archive. Go read through their archives if you can't afford to subscribe. There's many _very_ good websites out there to help you with lots of examples. Timo Salmi's is pretty helpful when you're new to this. Yes, I'm studing his material... So is Nancy McGough's (sp?). I have not read jet If you read Usenet newsgroups, comp.mail.misc is the place to go. One suggestion you should take as gospel: make a copy, THEN change your recipe. It can be fairly difficult to figure out what's going on when a recipe fails spectacularly. If you've a backup, you can avoid that problem. :) Yoy have said one of the most important rule...infact I'm doing the tests on a copy of my e-mail files. I have already experienced some problems... -- Any technology distinguishable from magic is insufficiently advanced. (*) http://www.spots.ab.ca/~keeling - - Thanks again Lorenzo -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL
Re: Procmail setup problem
Incoming from Lorenzo Rossi: you give me an example concerning how to filter the debian mailing- lists, based on X-Mailing-List: header that the mail server add to messages. ...But some mailing-lists like snort-sign, snort-users, gnupg-devel, do not add the X-headers Correct. X-* headers are not standard, and assumptions about them do not apply to all mailing lists. Do you have some advices to made a magic configuration like for debian? I suppose you need to analyze an e-mail header as example But if you remember some analogous situations you already examined... Correct again. Yes, you do have to analyze headers to nail these things down. I think the best way is, give it some where to go _if your recipe set recognizes it_, and if no recipe recognizes it, it should fall into your inbox (which is the default). DON'T create any recipe that delivers to /dev/null yet, no matter how good you think your recipe is. Send it to crap or something instead. Once in /dev/null, there's no going back. Il ven, 2004-08-27 alle 00:06, s. keeling ha scritto: Incoming from Lorenzo Rossi: [snip] Thk for the teaching...you explain me clear the concept but looking at the output in procmail log file I can see the following lines, and a doubt arise in my mind... :) [snip] procmail: Score: 1 1 ^To:.*snort-sigs procmail: Score: 0 1 ^Cc:.*snort-sigs Focusing on: procmail: Score: 1 1 ^To:.*snort-sigs procmail: Score: 0 1 ^Cc:.*snort-sigs [] It seems to me that procmail set the initial value score to 0 What I'm missing? Probably I should read again the procmail docs... Perhaps we both should. :-) Sorry, I don't profess to be an expert. Those can be found in procmail-users. I'm just trying to explain what I've managed to find works for me. The manpages should give you better information. -- Any technology distinguishable from magic is insufficiently advanced. (*) http://www.spots.ab.ca/~keeling - - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Procmail setup problem
On Thu, Aug 26, 2004 at 07:03:56PM +0200, Lorenzo Rossi wrote: Hi, i was trying to setup procmail to store incoming e-mails to different files in my home directory, but, procmail write all my incoming emails to the same file, the mbox file. I can not understand why? My procmail config file look like so: -- PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:. MAILDIR=$HOME/Mail DEFAULT=$MAILDIR/mbox LOGFILE=$MAILDIR/Procmail_log_from LOCKFILE=$HOME/.lockmail cut :0: # Anything from Bugtraq * [EMAIL PROTECTED] bugtraq I don't think that's a very good recipe, I'd change it to * ^To:[EMAIL PROTECTED] Or even better, use TO_: * [EMAIL PROTECTED] cut :0: * ^To:.*debian-user * Cc:.*debian-user ${HOME}/Mail/debian-user This will only match mails that have debian-user in *both* To and Cc. you might have more luck with * ^To:.debian-user|\ ^Cc:.debian-user Any ideas?? I personally don't rely on To: TO_ or TO for my mailing list sorting. Most mailing lists add headers to all mails that pass through them, I've found it's much more reliable to use those for sorting. E.g. the following sorts debian-user: :0 : * ^List-Id:.* debian-user.lists.debian.org list.debian-user/ Hope it helps. /M -- Magnus Therning(OpenPGP: 0xAB4DFBA4) [EMAIL PROTECTED] http://magnus.therning.org/ Tragedy purges the mind of trivia. -- George Gilder signature.asc Description: Digital signature
Re: Procmail setup problem
On Thu, 26 Aug 2004 19:03:56 +0200, Lorenzo Rossi [EMAIL PROTECTED] wrote: i was trying to setup procmail to store incoming e-mails to different files in my home directory, but, procmail write all my incoming emails to the same file, the mbox file. I can not understand why? My procmail config file look like so: [...] :0: * ^To:.*debian-user * Cc:.*debian-user ${HOME}/Mail/debian-user [...] procmail: Match on ^To:.*debian-user procmail: No match on Cc:.*debian-user [...] Any ideas?? From the procmailrc manpage: Conditions are anded Split that into two rules, one for To and one for CC, and you'll be fine. Actually, what would be even better is: :0: * ^TO_debian-user ${HOME}/Mail/debian-user That'll catch To, Cc, Bcc, and a bunch of others. -- Michael A. Marsh http://www.umiacs.umd.edu/~mmarsh -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Procmail setup problem
Incoming from Lorenzo Rossi: i was trying to setup procmail to store incoming e-mails to different files in my home directory, but, procmail write all my incoming emails to the same file, the mbox file. I can not understand why? PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:. MAILDIR=$HOME/Mail DEFAULT=$MAILDIR/mbox LOGFILE=$MAILDIR/Procmail_log_from LOCKFILE=$HOME/.lockmail :0: # Anything from Bugtraq * [EMAIL PROTECTED] bugtraq :0: * ^To:.*debian-user * Cc:.*debian-user ${HOME}/Mail/debian-user It matched the first, then didn't match the second. They cancel out. You're also missing the ^ on the Cc: line. Solution to this is scoring: :0: * 1^0 ^To:.*debian-user * 1^0 ^Cc:.*debian-user ${HOME}/Mail/debian-user You don't need ${HOME}/Mail/; all targets are relative to MAILDIR. procmail has a macro you can use instead of both of those: ^TO should match debian-user when in To: or Cc: (man procmailrc, then / MISC). procmail: Unlocking /home/milos94/.lockmail procmail: [20786] Thu Aug 26 18:41:11 2004 procmail: Assigning LOGABSTRACT=all procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED]# Anything from namp-hacker procmail: No match on [EMAIL PROTECTED] # Anything from rsbac procmail: Match on ^To:.*debian-user ^^^ procmail: No match on Cc:.*debian-user ^ I'm susbscribed to multiple debian-* lists. This separates them all out into separate folders: # # debian-${MATCH} # # [EMAIL PROTECTED] The match operator (\/) matches whatever the regexp that # follows it matches. Possible values are debian-user, debian-boot, # ... # :0 * ^X\-Mailing\-List:.*debian-\/[a-z-]* { LOG=debian-${MATCH} - :0: IN.debian-${MATCH} } -- Any technology distinguishable from magic is insufficiently advanced. (*) http://www.spots.ab.ca/~keeling - - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Procmail setup problem
Magnus, Il gio, 2004-08-26 alle 21:39, Magnus Therning ha scritto: On Thu, Aug 26, 2004 at 07:03:56PM +0200, Lorenzo Rossi wrote: Hi, i was trying to setup procmail to store incoming e-mails to different files in my home directory, but, procmail write all my incoming emails to the same file, the mbox file. I can not understand why? My procmail config file look like so: -- PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:. MAILDIR=$HOME/Mail DEFAULT=$MAILDIR/mbox LOGFILE=$MAILDIR/Procmail_log_from LOCKFILE=$HOME/.lockmail cut :0: # Anything from Bugtraq * [EMAIL PROTECTED] bugtraq I don't think that's a very good recipe, I'd change it to * ^To:[EMAIL PROTECTED] ok, thk for the suggestion, I go to modify the config file...I'm a newb of regex :) Or even better, use TO_: * [EMAIL PROTECTED] I go to study the meeningof To_ cut :0: * ^To:.*debian-user * Cc:.*debian-user ${HOME}/Mail/debian-user This will only match mails that have debian-user in *both* To and Cc. you might have more luck with * ^To:.debian-user|\ ^Cc:.debian-user Yes, you have reason, I did not put the logical OR beetween the 2 lines...:) Any ideas?? I personally don't rely on To: TO_ or TO for my mailing list sorting. Most mailing lists add headers to all mails that pass through them, I've found it's much more reliable to use those for sorting. E.g. the following sorts debian-user: :0 : * ^List-Id:.* debian-user.lists.debian.org list.debian-user/ Hope it helps. /M Magnus, you help me very mutch, you tech me the syntax.. Now I go to modify the procmailrc config file, writing better rules with your advices ;) Lorenzo -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Procmail setup problem
Incoming from Lorenzo Rossi: Il gio, 2004-08-26 alle 21:47, s. keeling ha scritto: Solution to this is scoring: :0: * 1^0 ^To:.*debian-user * 1^0 ^Cc:.*debian-user ${HOME}/Mail/debian-user What does it meen * 1^0 ^To:.*debian-user ?? ^^^ I'm a newb... You say that like it's a bad thing. :-) Recipes start out with a negative score. Generic patterns that match add 1 to that score. Once the score goes positive, the action clause is executed. So, for the above, a match on either triggers the action (a non-match has no effect). man procmailsc explains this. If you want the action to trigger when both match, you can seed the score: :0: * -2^0 * 1^0 ^To:.*debian-user * 1^0 ^Cc:.*debian-user debian-user That -2^0 will set the beginning score to -2. I'm susbscribed to multiple debian-* lists. This separates them all out into separate folders: # # debian-${MATCH} Wow very powerfull! I like it...:) You give me a lots of suggestions... Do you think my problems are mainly related to the configurations of rules? I ran into a lot of problems when I began. Multiple readings of man procmail* helped a lot. There's also the procmail-users mailing list. Go read through their archives if you can't afford to subscribe. There's many _very_ good websites out there to help you with lots of examples. Timo Salmi's is pretty helpful when you're new to this. So is Nancy McGough's (sp?). If you read Usenet newsgroups, comp.mail.misc is the place to go. One suggestion you should take as gospel: make a copy, THEN change your recipe. It can be fairly difficult to figure out what's going on when a recipe fails spectacularly. If you've a backup, you can avoid that problem. -- Any technology distinguishable from magic is insufficiently advanced. (*) http://www.spots.ab.ca/~keeling - - -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Procmail setup problem
Stephen, Il gio, 2004-08-26 alle 21:47, s. keeling ha scritto: Incoming from Lorenzo Rossi: i was trying to setup procmail to store incoming e-mails to different files in my home directory, but, procmail write all my incoming emails to the same file, the mbox file. I can not understand why? PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:. MAILDIR=$HOME/Mail DEFAULT=$MAILDIR/mbox LOGFILE=$MAILDIR/Procmail_log_from LOCKFILE=$HOME/.lockmail :0: # Anything from Bugtraq * [EMAIL PROTECTED] bugtraq :0: * ^To:.*debian-user * Cc:.*debian-user ${HOME}/Mail/debian-user It matched the first, then didn't match the second. They cancel out. You're also missing the ^ on the Cc: line. I know..I'm wrong... :) Solution to this is scoring: :0: * 1^0 ^To:.*debian-user * 1^0 ^Cc:.*debian-user ${HOME}/Mail/debian-user What does it meen * 1^0 ^To:.*debian-user ?? ^^^ I'm a newb... You don't need ${HOME}/Mail/; all targets are relative to MAILDIR. Yes, now I undertood.. I expanded all path because I would like to be sure avoid all possible errors... procmail has a macro you can use instead of both of those: ^TO should match debian-user when in To: or Cc: (man procmailrc, then / MISC). I go to study! ;) procmail: Unlocking /home/milos94/.lockmail procmail: [20786] Thu Aug 26 18:41:11 2004 procmail: Assigning LOGABSTRACT=all procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED] procmail: No match on [EMAIL PROTECTED]# Anything from namp-hacker procmail: No match on [EMAIL PROTECTED] # Anything from rsbac procmail: Match on ^To:.*debian-user ^^^ procmail: No match on Cc:.*debian-user ^ I'm susbscribed to multiple debian-* lists. This separates them all out into separate folders: # # debian-${MATCH} # # [EMAIL PROTECTED] The match operator (\/) matches whatever the regexp that # follows it matches. Possible values are debian-user, debian-boot, # ... # :0 * ^X\-Mailing\-List:.*debian-\/[a-z-]* { LOG=debian-${MATCH} - :0: IN.debian-${MATCH} } Wow very powerfull! I like it...:) You give me a lots of suggestions... Do you think my problems are mainly related to the configurations of rules? -- Any technology distinguishable from magic is insufficiently advanced. (*) http://www.spots.ab.ca/~keeling - - thanks from a newb.. Lorenzo -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Procmail setup problem
Thanks Michael, I have miss the sentence Conditions are andednow I kow ;) Lorenzo Il gio, 2004-08-26 alle 21:45, Michael Marsh ha scritto: On Thu, 26 Aug 2004 19:03:56 +0200, Lorenzo Rossi [EMAIL PROTECTED] wrote: i was trying to setup procmail to store incoming e-mails to different files in my home directory, but, procmail write all my incoming emails to the same file, the mbox file. I can not understand why? My procmail config file look like so: [...] :0: * ^To:.*debian-user * Cc:.*debian-user ${HOME}/Mail/debian-user [...] procmail: Match on ^To:.*debian-user procmail: No match on Cc:.*debian-user [...] Any ideas?? From the procmailrc manpage: Conditions are anded Split that into two rules, one for To and one for CC, and you'll be fine. Actually, what would be even better is: :0: * ^TO_debian-user ${HOME}/Mail/debian-user That'll catch To, Cc, Bcc, and a bunch of others. -- Michael A. Marsh http://www.umiacs.umd.edu/~mmarsh -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Procmail setup
On Thu, 2002-03-14 at 11:10, Ryan J Goss wrote: I recently joined this mailing list and enjoy the good discussions, but I am trying to figure out how to set up procmail so that all debian related messages get forwarded to a debian folder and not into my inbox. I don't know what I am doing wrong. Here is what .procmailrc looks like: MAILDIR=$HOME/mail #folder exists PMDIR=$HOME/.procmail/ #folder exists LOGFILE=$PMDIR/log INCLUDERC=$PMDIR/debian.rc #file exists SNIP Try this one : # MOST LISTS - Automagically handle lists :0 * ^((List-Id|X-(Mailing-)?List):(.*[]\/[^]*)) { LISTID=$MATCH :0: * LISTID ?? ^\/[EMAIL PROTECTED] $MATCH } That will put all normal (mailman type) mailing lists into their own file, titled with the list name. HTH Greeno
Re: Procmail setup
On Wed, Mar 13, 2002 at 06:10:09PM -0600, Ryan J Goss wrote: | I recently joined this mailing list and enjoy the good discussions, but I | am trying to figure out how to set up procmail so that all debian related | messages get forwarded to a debian folder and not into my inbox. I don't | know what I am doing wrong. Here is what .procmailrc looks like: I'm not a procmail guru, so I can't say what's wrong with yours, but the following works fine for me: PMDIR=$HOME/.procmail MAILDIR=$HOME/Mail :0: * ^X-Mailing-List:.*debian-user MailingLists/debian-user Good luck! (In a former life my email address used to be [EMAIL PROTECTED])
Re: Procmail setup
My god! This might be the single most useful thing I've ever received on a mailing list (of which I'm subscribed to almost 50). Thank you! Thank you! Thank you! Caleb (90% shorter procmailrc now) Shay [EMAIL PROTECTED] Try this one : # MOST LISTS - Automagically handle lists :0 * ^((List-Id|X-(Mailing-)?List):(.*[]\/[^]*)) { LISTID=$MATCH :0: * LISTID ?? ^\/[EMAIL PROTECTED] $MATCH } That will put all normal (mailman type) mailing lists into their own file, titled with the list name. signature.asc Description: This is a digitally signed message part