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 - 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 03-27-2007, 02:36 PM   #1
Skip-DMP
Member
 
Registered: Jan 2006
Distribution: RHEL3
Posts: 97

Rep: Reputation: 15
Procmail "To" Rule Help Needed


I am looking for a little help. We host a handful of domains, but I want to only be receiving email thru one of them. We have an old domain name which was in use several years ago but we still receive spam mail to it. While the domain name exists, I want to be dumping all email to the old addresses. Short term, I want to direct it to my spam account. Will this procmail rule work for me? Or am I missing something?:

Quote:
:0
* ^TO.*@myolddomain.com
| formail -A "X-Loop: spam" | /usr/sbin/sendmail -oi spam@mydomain.com
 
Old 03-28-2007, 07:01 AM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
procmail is a good ol' regular Unix-type filter. It expects to see one piece of mail per invocation. You can experiment by sending individual pieces of mail through it. Omit the

Code:
| /usr/sbin/sendmail -oi spam@mydomain.com
part of the rule, and the result will come to standard output, complete with an "X-Loop: spam" line, if the rule was invoked.

Experiment and have fun!

Hope this helps.
 
Old 03-28-2007, 08:34 AM   #3
Skip-DMP
Member
 
Registered: Jan 2006
Distribution: RHEL3
Posts: 97

Original Poster
Rep: Reputation: 15
I have a single collection point for all "low" rated spam and go thru them about once each week to check for FPs. At this point my FPs are effectively nil, but I still continue to collect them in the event one of my users questions something. Here is my complete procmailrc file at the moment. It may be ugly and clunky. I honestly don't know. My plan was to place the above where I have indicated the series of ############'s:

Quote:
:0fw
* < 256000
* !^X-Spam-Flag: YES
* !^X-Loop: spam
| /usr/bin/spamc -f -u mail

# 12/18/2006
# Mail with a score over 12 is almost certainly spam.
# We'll just dump those.
:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*
/dev/null

:0c
* !^FROM_DAEMON
* ^X-Spam-Flag: YES
* !^X-Loop: spam
| echo "`formail -x X-Spam-Status: | awk -F 'score=' '{print $2}' | cut --delimiter=' ' -f1`" >> /var/log/spam

######################

:0
* !^FROM_DAEMON
* ^X-Spam-Flag: YES
* !^X-Loop: spam
| formail -A "X-Loop: spam" | /usr/sbin/sendmail -oi spamacct@mydomain.com
 
Old 03-29-2007, 06:53 AM   #4
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
So what happened when you ran test e-mails through procmail as a command-line filter?
 
  


Reply



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
get this error when runnign make ***** "no rule to make target 'config'. stop" procfs Linux - General 4 05-12-2013 10:25 AM
Can Not install driver "No Rule to Make" zonemikel Linux - Software 4 09-05-2006 10:34 PM
Help with Installation. "No rule to make target.." Aries311 Linux - Software 2 07-02-2005 03:47 PM
"No rule to target config" salisburypirate Debian 3 03-07-2004 01:12 AM
How about a no "religious questions" rule? frogman LQ Suggestions & Feedback 4 02-14-2004 07:24 PM

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

All times are GMT -5. The time now is 03:08 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