Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Procmail Troubles

Status
Not open for further replies.

lampshade

Programmer
Nov 20, 2008
6
0
0
US
I've been trying to solve this for weeks...

My Goal is to search my inbox for the following messages:

Hello
Hi
Hey

Im using three files to do this for me. The first, a .forward file in my $HOME
Code:
"|IFS=' '&&exec usr/bin/procmail||exit 75 #username"

And these two are in my ~/.procmail directory
.procmailrc
Code:
VERBOSE=off
MAILDIR=$HOME/Mail
PMDIR=$HOME/.procmail
DEFAULT=/var/spool/mail/username
LOGFILE=$PMDIR/log
INCLUDERC=$PMDIR/general.rc
#end of .procmailrc

And lastly the rule file:general.rc
Code:
:0
* ^From:.*sumone@sumaddy.com
* ^Subject:.*hello
$HOME/Mail/Hello


Whats suppose to happen, is that all three of these files work together to copy and move mail that contain the hello pattern in its subject. And to be safe it will also look for a certain persons address. Then when those patterns are matched it will stick what it found and create the specified path; if it doesnt already exist.

But its not doing that.
After im done editiing these files in emacs, vi, .. and then save it, will it work automatically? Or do i need to compile it?

If i do, the .procmailrc might require ( if not all ) the 'Shell=/bin/sh'

Not that i didnt try that...


HELP!!!!!!!!
PLEASE..
 
I guess my general.rc shouldnt have the path the to DEST folder, just the name...

Anyways to reiterate..

My .forward file is my $HOME
my .procmailrc is in my $HOME

my general.rc file is my ~/.procmail directory

I think thats about it..

My plan is to use that general.rc file to match the "From" and/or "Subject" lines in a Message thats incomming to my inbox, which happens to be /var/spool/mail/<user>

Why its not working i havent the faintest.


I want to eat turkey knowing that this is donnnne.
 
Is it intentional that you have a relative path to usr/bin/procmail?

Annihilannic.
 
Yes its intentional. That should be the first thing that is read when me the user receives mail... Then .forward talks to procmailrc gets the information and general.rc ( if properly coded ) wll mv files that match the pattersn to a folder in my mail directory...

And i know that im missing a "/" for usr/bin/procmail ..And i've known that for awhile now.


 
Usually i can try to test it by sending myself an email, and simply checking to see if a new folder has been created, in my ~/Mail directory.

What i can do to prove to myself that what i have for the general.rc file is to just make a file that has exactly what im having the general.rc file search for.. And it works..

Here are my current files:

The .procmailrc

VERBOSE=off
MAILDIR=$HOME/Mail/
PMDIR=$HOME/.procmail
DEFAULT=/var/mail/<username>
LOGFILE=$PMDIR/LOG
INCLUDERC=$PMDIR/general.rc
#end of .procmailrc

The .forward

"|IFS=' '&&exec /usr/bin/procmail||exit 75 #<username>"

the rule file that i've changed countless times

:0:
* ^Subject:.hi
Hello

:0:
* ^FROM:.*firstname.lastname
Hello

:0:
Hello


Hey anni, since your the only one with a reply to this post, could u try these files, therby subsituting your paths for mine, and seeing if any mail is moved?

-Thanks






 
Unfortunately I'm a sendmail stalwart and have no systems with procmail installed, otherwise I'd have tried already.

I find the sytnax of your .forward a little strange... what's with the IFS setting? As far as I can see it has no meaning, because by execing procmail that variable would be lost anyway. If procmail does depend on IFS being set for some reason, try this syntax:

Code:
"| IFS=' ' /usr/bin/procmail || exit 75"

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top