Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

lampshade (Programmer)
21 Nov 08 21:40
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..
lampshade (Programmer)
24 Nov 08 20:38
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.
Annihilannic (MIS)
24 Nov 08 22:14
Is it intentional that you have a relative path to usr/bin/procmail?

Annihilannic.

lampshade (Programmer)
24 Nov 08 22:41
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.


 
lampshade (Programmer)
25 Nov 08 1:27
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






 
Annihilannic (MIS)
26 Nov 08 17:20
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.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close