No clue how that happened...let's try this again

From: Jonathan Felder <felder_at_path.berkeley.edu>
Date: Thu, 13 Sep 2007 11:07:41 -0700

I wasn't subscribed to MicroNet before, so my first message didn't make
it. This message describes in detail how to use the scripts.

-----------------------------------------------------

This script is designed to take blucard emails, read and decode the
attachment, and then place the contents of that attachment in the body.
  This is very useful for a couple of reasons. First you can see the
contents of the attachment in the message pane of your email client.
Second you can filter messages based on the attachment contents. I, for
example, have a mail filter that looks for FELDER in the body and then
routes messages containing FELDER to another box. Third, it makes the
messages searchable. For example, if you know the dollar amount of a
charge or the vendor name, you can direct your email client to search
the blucard messages for a specific charge. All of these things make my
life as blucard holder much easier with respect to these statements.

There are two versions of this script. The only real difference between
the two is one outputs the processed message to standard out and the
other emails the processed message somewhere.

In order to make use of either version, you need to be running your own
mail server. Your mail server needs to be able to run perl, and you
need to be able to direct incoming blucard emails to the script.

The first version, named blucardprocmail.pl, outputs the message to
standard out. This is meant to be used with procmail. Procmail is a
unix based mail filtering utility. You can find more about it here:
http://www.procmail.org/

To set this up, save the script somewhere (we save it to /usr/local/bin)
and then configure a system wide procmail rule (done via /etc/procmailrc
on our system) to send messages to the script. Note that you can also
use this on a person by person basis if your mail server supports
logging in and modifying your own personal .procmailrc file.

We use the following rule for doing this:

:0fw
* ^Subject:.*BLUCARD.*Delimited Download
Statement.*|^Subject:.*BLUCARD.*Verification
Statement.*|^Subject:.*BLUCARD.*Excel Download Statement.*
* ^From:.*bfs.*@berkeley.edu
| /usr/local/bin/blucardprocmail.pl

The first line of the rule specifies that we want to consider the pipe
as a filter (f) and we wait until the filter completes (w) before
proceeding to any other rules or to delivery. The next two lines
specify criteria in order to select messages that will be processed by
this rule. In this case we're looking for emails that have subjects
that look like blucard statements and that are from bfs. The last line
specifies what happens when this rule is activated. In this case, we're
running the script.

The second version, named blucardsendmail.pl, emails the processed
message somewhere. It is meant to be used with a mail alias. This is
useful if you have recipients on multiple servers and wish to instead
use your server as an intermediate hop between your recipients and the
bfs mailings. In our case we have a lists.berkeley.edu mailing list
that receives our blucard mailings. So what we do is have blucard email
the statements to our alias, which sends it to this script, and the
script sends the processed message to the lists.berkeley.edu list.

To setup an alias in sendmail we edit the /etc/mail/aliases file and add
the following alias:

youraliasnamehere: "|/usr/local/bin/blucardsendmail.pl"

Make sure you edit the script where it says "putanemailaddresshere", and
add whatever email address you want the processed message to be sent to.

Finally once you get these scripts operational, you might want to
consider bouncing or redirecting all of your previous blucard emails
through it. That way your old messages as well as new ones will be
searchable, filterable, etc.

-- 
Jonathan Felder
Network and System Administrator
California PATH, UC Berkeley
http://www.path.berkeley.edu/systemsupport/
Windows 9x (win-doze): a 32 bit Extension to a 16 bit Graphical Shell
of an 8 bit Operating System originally coded for a 4 bit Processor by
a 2 bit company that can't stand one bit of competition.
------------------------------------------------------------------------
The following was automatically added to this message by the list server:
To learn more about Micronet, including how to subscribe to
or unsubscribe from its mailing list and how to find out
about upcoming meetings, please visit the Micronet Web site:
http://micronet.berkeley.edu/
Messages you send to this mailing list are public and world-viewable,
and the list's archives can be browsed and searched on the Internet.
This means these messages can be viewed by (among others) your bosses,
prospective employers, and people who have known you in the past.
Received on Thu Sep 13 2007 - 11:21:57 PDT

This archive was generated by hypermail 2.2.0 : Thu Sep 13 2007 - 11:22:04 PDT