LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-12-2016, 08:18 AM   #1
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,058

Rep: Reputation: 47
Unhappy procmail recipe, match on variable


I have a variable 'SUBJECT' in procmail recipe. How to do a match on its value?

Thanks.
 
Old 04-12-2016, 12:05 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 15,442

Rep: Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172Reputation: 2172
Your question is too vague. Procmail doesn't do bash variables, although it utilizes some environment variables. What are you trying to do?
 
Old 04-12-2016, 09:04 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 18,972
Blog Entries: 28

Rep: Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066Reputation: 6066
Here is the best procmail tutorial I have found on the innerwebs. It's old, but it's as valid as it ever was.

You use procmail's built-in implementation of regex to specify what you are filtering for and what to do with the results. Here's a sample subject line from my .procmailrc. In this case, all the emails from my LUG include the string "(TWUUG)" (for "Tidewater Unix Users Group") in the subject line, so I filter for that string and place the email in my TWUUG mailbox.

Code:
:0: 
* ^Subject:.*(TWUUG)
TWUUG/

Last edited by frankbell; 04-12-2016 at 09:09 PM.
 
1 members found this post helpful.
Old 04-13-2016, 12:49 AM   #4
qrange
Senior Member
 
Registered: Jul 2006
Location: Belgrade, Yugoslavia
Distribution: Debian stable/testing, amd64
Posts: 1,058

Original Poster
Rep: Reputation: 47
thanks all, I've found it:
Code:
VAR1_=Whichever expression you devise
:0:
* VAR1_ ?? regexp
wherever

Last edited by qrange; 04-13-2016 at 12:50 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Three actions in a recipe of Procmail Borelian Linux - Software 1 11-11-2012 06:48 AM
Procmail Recipe: Need help vaibhavs Linux - Newbie 1 10-20-2009 01:59 PM
[SOLVED] procmail recipe required raghugs Linux - Server 3 10-09-2009 02:39 AM
Procmail recipe question gauge73 Linux - Software 3 05-03-2006 04:09 AM
Procmail recipe jebix666 Linux - General 1 06-09-2005 01:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:22 AM.

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