procmail
[Top] [All Lists]

RE: Passing mail through a filter...$$$...Help!!

2002-02-12 10:00:55
Jeremy,

I did not see a reply to this.  Sorry if I missed it.  I'm not a procmail
expert, but I have recently setup a system like you mention.  I'm not
interested in consulting, but I thought you may find my /etc/aliases
entries, procmailrc and perl scripts useful.  I have included them below
because I have found very little documentation about this on the Web.  My
setup actually calls for stripping text from email then passing the email
along to our help desk software, RT2, but I'm sure you can substitute
formail (or some other application) for that.

Good Luck,
George


RELEVANT /etc/aliases FILE:

#Stuff

helpdeskus: "| /usr/bin/procmail -m /etc/procmailrcs/disclaim-filter"
#helpdeskus: "| /opt/rt2/bin/rt-mailgate --queue helpdeskus --action
correspond"



MAIN PROCMAIL RECIPE> mmain

:

#This file must be owned by the user rt
HOME=/home/rt
INCLUDERC=$HOME/.procmailrc
LOGFILE=/tmp/disclaimstrip.log
VERBOSE=on
SHELL = /bin/bash

0
! me(_at_)domain




So now procmail is acting as the user "rt".  Here's were it all 
happens, the > INCLUDERC file /home/rt/.procmailrc:

# This file does any filtering/mail manipulations/etc before # calling
rt-mailgate.
HOME=/home/rt
LOGFILE=log/procmail.log
VERBOSE=yes

# Place mailfiltering here
:0 wfb
        |/usr/local/scripts/strip.disclaim

0
        {
# Use a lockfile to ensure only one rt-mailgate process.
        :0:.procmail.lock
        |/opt/rt2/bin/rt-mailgate --queue helpdeskus --action correspond

# Something went wrong.  Dump it to someone
        :0e
        ! me(_at_)domain
}


And finally, here is the real simple perl script:


#!/usr/bin/perl -w

undef $/; #We want to treat STDIN as one line

$input = <>;

$input =~ s/This email message may contain information(.*?)free of 
errors or
viruses.//smg;

$/ = "\n";

print $input;


-----Original Message-----
From:   mcgee5(_at_)mindspring(_dot_)com 
[mailto:mcgee5(_at_)mindspring(_dot_)com]
Sent:   Saturday, February 09, 2002 11:18 PM
To:     procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Cc:     mcgee5(_at_)mindspring(_dot_)com
Subject:        Passing mail through a filter...$$$...Help!!

Greetings,

I am new to procmail and am having some trouble.  I am willing to pay for
any assistance provided based on a reasonable rate and a much higher
competency of Procmail than what I have.  Please respond to
mcgee5(_at_)mindspring(_dot_)com(_dot_)  Here is my problem...

I want ALL mail that comes into my server passed through a program I wrote
called "filter."  Basically, this program takes a filename as input and then
filters the file and outputs another file with the filtration in place.
Ideally, I would like all mail that the server picks up passed through this
filter.  I'm assuming what it needs to do is just open the mail file when it
gets the email, pass it through the filter, and re-save it.  This program
replaces certain words etc.  It works VERY well so I do not want to change
any of the things that control the way it works.  FYI, I'm using Sendmail as
the mail transfer agent.  I want to set things up so that ALL POP users on
my server have this filter in place.

Any assistance would be GREATLY appreciated.  I'm assuming editing of the
.procmailrc file is what needs to be done.  Sendmail is configured to pass
the mail directly to procmail already and procmail is working.  If you're
willing to go so far as to write the RC files, then I'm certainly willing to
pay.  I also would be interested in someone doing some procmail work for me
from time to time for a reasonable rate....fairly simple stuff to someone
knowledgeable.

Thanks, 
Jeremy McGee

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail



This email message may contain information that is confidential and
proprietary to Babcock & Brown or a third party.  If you are not the
intended recipient, please contact the sender and destroy the original and
any copies of the original message.  Babcock & Brown takes measures to
protect the content of its communications.  However, Babcock & Brown cannot
guarantee that email messages will not be intercepted by third parties or
that email messages will be free of errors or viruses.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>