Solved

Procmail looking at the body of a message

Posted on 2008-06-14
11
219 Views
Last Modified: 2008-06-19
I'm working on a .procmailrc file to look at the body of a message and look for a list of words that I will make that are going to be bad works. But I can't find any in documentation on this.

thanks
0
Comment
Question by:thomasbonham
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
11 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 250 total points
ID: 21785940
#this will egrep headers
:0

#this is for body
:0 B


refer
man procmailex
man procmailrc
0
 
LVL 78

Expert Comment

by:arnold
ID: 21786633
If you want the filter to active if there are a combination of words, consider scoring.
man procmailsc.  using scoring you can assign a weight to a word/words.
http://www.hmug.org/man/5/PROCMAILSC.php
0
 

Author Comment

by:thomasbonham
ID: 21822952
Those are all helpful links. But does anyone know why when I use the :0fw part of procmail with me piping it to my perl script that I'm working. So how come when I put the :0fw in there the .forward quit working all together.

Thanks
0
When ransomware hits your clients, what do you do?

MSPs: Endpoint security isn’t enough to prevent ransomware.
As the impact and severity of crypto ransomware attacks has grown, Webroot fought back, not just by building a next-gen endpoint solution capable of preventing ransomware attacks but also by being a thought leader.

 
LVL 43

Expert Comment

by:ravenpl
ID: 21823007
> So how come when I put the :0fw in there the .forward quit working all together.
What You mean. And how the .forward applies here? I assume Your .forward contains single line
|procmail
0
 

Author Comment

by:thomasbonham
ID: 21823232
No the .forward is how I'm taking that message that comes into the inbox and forwarding it on to a list of email address that need to see that message.
The file looks like this

\system-username   your@your.com,your1@your.com
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 21823309
OK, and where is the procmail as LDA configured then?
0
 

Author Comment

by:thomasbonham
ID: 21823518
I do not know what you are talking about here. If you are asking where is the procmailrc file at it is in the home directory with the .forward.

They are both owned by the user and the both are 644 and I have tried 777 and it still doesn't work.
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 250 total points
ID: 21823569
:fw defines a filter.
The application processes the mesage and then returns or supposed to return the message to procmail for further processing.
Upload your .promcailrc file.  I gather you have your MTA (mail server) configured to pass the message to procmail for the LDA (Final Disposition).  In this type of configuration, the .forward file is never check since procmail does not consult it.

procmail recipe can be configured/setup to perform the forwarding.
#default deliver
:0c
$STORElocally

#Forward to an individual or a list
:0
! someemailaddress@somedomain.com
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 21823577
I was asking, where sendmail/postfix/MTA is instructed to deliver local messages via procmail(LDA)?
Usually it's
|procmail
line in .forward file
0
 

Author Comment

by:thomasbonham
ID: 21826781
I think I have it working now. But the one thing that is with the "! somewemail@someemail.com" do I need to do a line like that from every email address?

Here is what I have if anyone would like to see it.
:0fw
| perl /usr/local/bin/mail.pl
:0
!bonham@bonhamlinux.org

Open in new window

0
 
LVL 78

Expert Comment

by:arnold
ID: 21826839
It depends on how you have the emails setup.  If it is a list, send to the list.  If you have to individually specify the email addresses, you can have a variable that contains the email addresses in a comma separated list.
0

Featured Post

Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as high-speed processing of the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question