LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-15-2018, 11:19 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
Need help filtering messages in .procmailrc


I need some guidance on setting .procmailrc. I subscribe to the samba maillist, which is prolific. I want to see responses to messages I have submitted (by subject), and have those, and all others directed to a mail folder for archival purposes. I've set up my procmail as shown below where '/var/spool/mail/mfoley' is my personal MBOX mailbox. The problem is, ALL messages go to the archive folder (/user/mfoley/mail/$YEAR/sambaList) and none go to my personal mailbox. What am I doing wrong?
Code:
:0c:
* ^Subject:.*\[Samba\] What does a domain member
! /var/spool/mail/mfoley

:0c:
* ^Subject:.*\[Samba\] How to track attempted breakins
! /var/spool/mail/mfoley

:0c:
* ^Subject:.*\[Samba\] Are some Group Policies broken
! /var/spool/mail/mfoley

:0c:
* ^Subject:.*\[Samba\] How to change Domain password as normal user
! /var/spool/mail/mfoley

:0:
* ^Subject:.*\[Samba\]
/user/mfoley/mail/$YEAR/sambaList
 
Old 05-15-2018, 03:10 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
You don't need the "!" in front of the path to the to your mbox:
Code:
:0c:
* ^Subject:.*\[Samba\] What does a domain member
/var/spool/mail/mfoley

:0c:
* ^Subject:.*\[Samba\] How to track attempted breakins
/var/spool/mail/mfoley

:0c:
* ^Subject:.*\[Samba\] Are some Group Policies broken
/var/spool/mail/mfoley

:0c:
* ^Subject:.*\[Samba\] How to change Domain password as normal user
/var/spool/mail/mfoley

:0:
* ^Subject:.*\[Samba\]
/user/mfoley/mail/$YEAR/sambaList
 
Old 05-16-2018, 11:55 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
That appears to have worked! Not sure why I had the ! in there in the first place. That character for an action line says to forward to the specified mail addresses, but I've specified my mail folder. Hmmm, if I did specify "! mfoley" as the action line, would it deliver to my system mail folder or would it attempt to re-process through .procmailrc?
 
Old 05-17-2018, 03:05 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by mfoley View Post
That appears to have worked! Not sure why I had the ! in there in the first place. That character for an action line says to forward to the specified mail addresses, but I've specified my mail folder. Hmmm, if I did specify "! mfoley" as the action line, would it deliver to my system mail folder or would it attempt to re-process through .procmailrc?
If you use !mfoley it will deliver it to mfoley.
Now if that .procmailrc recipe is in ~mfoley you're going to have a loop.
 
Old 05-17-2018, 11:17 PM   #5
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
Quote:
Originally Posted by bathory View Post
If you use !mfoley it will deliver it to mfoley.
Now if that .procmailrc recipe is in ~mfoley you're going to have a loop.
The .procmailrc recipe is in $HOME/mfoley/.procmailrc and mfoley's system mbox file is in /var/spool/mail/mfoley. I think I would have a loop. I'll leave it the way I have it now set from your original suggestion.
 
  


Reply

Tags
procmail



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sylpheed duplicate messages filtering qrange Linux - Software 5 01-10-2014 05:03 AM
rsyslog filtering syslog messages sanjose Linux - Newbie 13 11-07-2012 03:08 PM
procmail procmailrc attachment filtering ted_chou12 Linux - Software 7 04-12-2011 11:56 AM
Procmailrc filtering Intimidator Linux - Server 1 06-11-2007 07:30 AM
Filtering mail messages on ISP's mail server broxtor Linux - Software 0 07-28-2003 02:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration