LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 11-13-2002, 05:21 PM   #1
realos
Member
 
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113

Rep: Reputation: 15
how to use expressions with pattern? .procmailrc


:0:
* ^(To|Cc|CC).*support@(rtr-ext|mail|)*mydomain*
support
. . .

:0:
inbox



Even though I have the above mentioned rules in .procmailrc file, a message with following header is placed in "inbox":

From: root <root@rtr-ext.mydomain.com>

Can anybody suggest what is wrong with the expression above.

(To|CC) means either To or CC right??

regards,

Realos
 
Old 11-13-2002, 07:18 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,610
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
Try this:
# Define mailbox
SUPPORT=$HOME/mail/support
# Start recipe
:0
# Match all To and CC's
* $^(To|Cc|CC):.*@mydomain.com
# Don't deliver to $DEFAULT
$SUPPORT
 
Old 11-13-2002, 11:06 PM   #3
moses
Senior Member
 
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

Rep: Reputation: 45
I'm not sure if unSpawn answered your question or not, but from the
amount of info you posted about the message header, it should be
delivered to your inbox, since your regex matches "To" and "CC", but
your header says the message is "From". . .

Here's an example of what I've got, it's been working like a dream for
years:

:0
* (^To|^From|^[Cc][Cc]).*ssi_underground
incom/ssi_underground
 
Old 11-14-2002, 09:25 AM   #4
realos
Member
 
Registered: Jul 2002
Location: Germany
Distribution: Redhat 7.3, Debian 3.1, Knoppix 3.1, Ubuntu 6.10
Posts: 113

Original Poster
Rep: Reputation: 15
Thanks guys,

@moses: you were careful, but I forgot to write the other expression that my .procmailrc contains:

"* ^(To|Cc|CC).*support@(rtr-ext|mail|)*selfnet*"


@unspawn: I don`t know what you mean with "$" in
* $^(To|Cc|CC):.*@mydomain.com ??

Can you please give hint??

--------------------------------------------------

Now I have changed my .procmailrc expression to
* ^(To|[Cc][Cc]).*support@(rtr-ext|mail|).*selfnet"

The difference is that there was no dot before asterix in the previous recipe. The difference is:

. one character (anyone)
* zero or many appearances of the last character
.* zero or many appearances of any character

I have not verified that recipe by sending an email to myself, but I hope very much that it works ....

What do you mean? Feel free to let me know if I make any mistake,

regards,
 
Old 11-14-2002, 10:06 AM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 21,610
Blog Entries: 47

Rep: Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413Reputation: 1413
Soz, that $ wasn't needed, it would be if you'd use:
DOMAIN_0="mydomain.com"
* $^(To|Cc|CC):.*@${DOMAIN_0}
...so you can delete it w/o probs.
Btw, this is in the procmailrc man page (alas w/o example).
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
printing pattern match and not whole line that matches pattern Avatar33 Programming 13 05-06-2009 06:17 AM
.procmailrc jayakrishnan Linux - Networking 0 11-19-2005 02:13 AM
Procmailrc file how many do I Need ?? wylie1001 Linux - Software 2 09-07-2005 07:20 PM
procmailrc davidsrsb Slackware 3 06-15-2005 11:07 AM
procmailrc filter for alias skyfly Linux - Security 1 05-19-2005 04:48 AM


All times are GMT -5. The time now is 12:35 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration