Archive-name: mail/procmail-pointers
URL: ftp://cs.uta.fi/pub/ssjaaa/pm-tips.html
Maintainer: Jari Aalto <jari(_dot_)aalto(_at_)poboxes(_dot_)com>
Announcement: "Procmail pointer list"
You can also order the text file from file Server with:
To: <jari(_dot_)aalto(_at_)poboxes(_dot_)com>
Subject: send pm-tips.txt
Era's exellent procmail link page (FAQ and other) is at
http://www.iki.fi/~era/procmail/links.html
4.0 Procmail pointers (exerpted from pm-tips.txt)
4.1 Procmail discussion list
Traffic in this list is about 5-20 messages per day. Do not join
if you can't handle that much traffic.
.submitting questions/answers
<procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de>
.subscription requests
<procmail-request(_at_)informatik(_dot_)rwth-aachen(_dot_)de>
4.2 To join procmail discussion list
[Ralph Sims <ralphs(_at_)halcyon(_dot_)com>] Be sure to use _SUBJECT_
field,
and send subject "subscribe" to *procmail-request*.
4.3 To get off procmail discussion list
_SUBJECT_ line does not matter, but you must put command to _BODY_ of
message.
To get off the list: send a message to *procmail-request* with any
subject line and the word "unsubscribe" in the body (leave off the
quotes). If that fails, use "unsubscribe user(_at_)your(_dot_)domain".
If *that*
fails, try email to
<procmail-owner(_at_)informatik(_dot_)rwth-aachen(_dot_)de>
(purportedly that should go to a person). I'm suggesting a number
of things because I lost that first message.
The biggest problem with unsubscribing is trying to do so from an
email address other than the one you subscribed from. Forging
headers is left as an exercise to the class.
4.4 Procmail mailing list archive
Get a list of files available at the procmail mail server
by sending mail: [Subject: archive ls]. Get Best of the Procmail
mailing list by sending mail. You'll need gzip and a MIME-decoder
to unpack it: [Subject: archive get best_of_procmail_list*]
4.5 Procmail Lint service (code check)
If you have and can use Emacs, please download the Procmail
programming mode, tinypm.el, that [jari] has written. Lint is
included in there and it can auto-correct mistakes on the fly. You
can get it from the mentioned _uta_ ftp site (get tgz kit).
Because not all people know how to use Emacs, how to use Emacs lisp
packages or are otherwise clueless about Unix tools, I put up
procmail Lint service where you can send your code.
To: jari(_dot_)aalto(_at_)poboxes(_dot_)com
Subject: send pm-lint.hlp
This service is highly experimental and if traffic starts to get
too high, I have to close it because every message to the lint
starts an background Emacs process and it consumes server
resources. The preferred way is that you get your own Emacs package
and Lint your code locally. When you send a message to the Lint
it will respond to you with message similar to this:
*** 1997-11-24 22:13 (pm.lint) 3.11pre7 tinypm.el 1.72
cd /users/jaalto/junk/
pm.lint:010: Warning, no right hand variable found. ([$`']
pm.lint:055: Pedantic, flag orer style is not standard `hW:'
pm.lint:060: Warning, message dropped to folder, you need lock.
pm.lint:062: Warning, recipe with "|" may need `w' flag.
pm.lint:073: Warning, Formail used but no `f' flag found.
4.6 Procmail module list
The UBE stop modules are not listed here. See "pointers."procmail
code" section later. The pm-ja*.rc modules are in Jari's file
server; all other modules can be found from Alan's file server.
_subroutine_ = A piece of code that gets something in INPUT and
responds with OUTPUT. Subroutine is not message specific.
_recipe_ = A piece of code, that is somewhat self containing:
It reads something from the message or does something
according to matches in message.
[Header files] These are like #include .h files in C, they define
some common variables, but do not contain actual code.
o pm-javar.rc -- Defines standard variables: SPC WSPC NSPC WSPCL and
perl styled \s \d \D \w \W and \a \A (alphabet only)
o headers.rc -- From Alan's procmail-lib. Define standard regexp
and macros: address, from, to, cc, list_precedence
[General]
o pm-jafrom.rc -- Derive FROM field without calling `formail'
unnecessarily. If all fails, use formail.
o get-from.rc -- From Alan's procmail-lib. get the "best" from
address Sets FROM and FRIENDLY, the latter being the "friendly"
user name sans any address.
o pm-jaaddr.rc -- extract 'foo(_at_)some(_dot_)com' email address
from INPUT
o pm-jastore.rc -- Define MBOX as the folder where to drop
message and this subroutine will store it appropriately.
Currently supports single mboxes and ".gz" files.
[Date and time handling] For these, you extract the date from somewhere
first and then feed the string to some of these subroutines:
o pm-jatime.rc -- a lowlevel subroutine. Parse time "hh:mm:ss"
from variable INPUT
o pm-jadate1.rc -- a lowlevel subroutine. Parse date
"Tue, 31 Dec 1997 19:32:57" from variable INPUT
o pm-jadate2.rc -- a lowlevel subroutine. Parse ISO standard date
"1997-11-01 19:32:57" from variable INPUT
o pm-jadate3.rc -- a lowlevel subroutine. Parse date
Tue Nov 25 19:32:57 from variable INPUT
o pm-jadate4.rc -- Call shell command "date" once to construct RFC
"Tue, 31 Dec 1997 19:32:57" and parse the YY MM HH and other
values. You usually use this subroutine if you can't get the date
anywhere else.
[Date and time handling] You use these recipes to get
date directly from the message:
o pm-jadate.rc -- higher level recipe. Read date from message's
headers: From_ Received, or call shell `date' if none succeeds.
The date values reflect the receive date, not the sending date.
o date.rc -- higher level recipe.
From Alan's procmail-lib: parse date or from headers
Resent-Date:, Date, and From
[Forwarding and account modules]
o pm-jafwd.rc -- controling Forward remotedly. You can change the
forward address with a "control message" or turn on/off the
forwarding with "control message"
o pm-japing.rc -- Send short reply to subject containing word
"ping" to show that the account is up and that email address is
valid.
o correct-addr.rc -- From alan's procmail lib. To help forward mail
from an OLD address to a NEW address, and do some mailing list
mail management. This recipe file is intended to make it easy
for users to forward their mail from their old address to a new
address, and, at the same time, educate their correspondants
about it by CC'ing them with the mail.
[Vacation modules]
o pm-javac.rc -- A framework for your vacation replies. This
recipe will handle the vacation cache and compose an initial
reply; which you only need to fill in. (Like putting vacation
message to the body)
o ackmail.rc -- From Alan's procmail lib. procmail rc to
acknowledge mail (with either a vacation message, or an
acknowledgement)
[Message-id based modules]
o pm-jadup.rc -- Handle duplicate messages by Message-Id.
Store duplicate message to separate folder.
o dupcheck.rc -- From Alan's procmail-lib. If the current mail has
a "Message-Id:" header, run the mail through "formail -D",
causing duplicate messages to be dropped. Can use md5 cache.
[Cron modules]
o pm-jacron.rc -- A framework for your daily cron tasks. This
recipe contains all the needed checks that your includerc is
called whenever a day changes. (Day change is subject to
messages you receive). You own cron includerc is run once a day.
[Backup modules]
o pm-jabup.rc -- Save messages to backup directory and keep only N
messages per day. Idea by John Gianni, packaged by Jari. Note:
The implementation will always call shell for each message you
receive; so using this module is not recommended if you get
many messages per daiy. Instead, use the cron module to clean
the messages' backup directory only one a day, an not everytime
a message arrives.
[Confirmation modules]
o pm-jacookie.rc -- Handle cookie (unique id) confirmations.
Also known as Procmail authentication service (PAS).
This simple procmail module will accept messages only from
user's who have returned a "cookie" key. You can use this to
to protect your mailing list from false "subscribe" messages
or from getting mail from unknown people, typically spammers
who won't send the cookie back to you to "validate" themselves.
Uses subroutine pm-jaacookie1.rc, which generates the unique
cookie; CRC 32 by default.
o See also Michelle's confimation module for SmartList
[File Servers]
o pm-jasrv.rc -- A Mime Procmail file server (MPFS) It contains
all the instructions and supports several MIME encoding types:
text/plain and x-gzip64. The keyword SEND is configurable. You
can set up as many files servers as you need to different
directories by changing the SEND keyword. MPFS supports
password for file access.
o pm-jasrv1.rc -- A ripped down version, very modest and most
basic, Tiny Procmail File Server (TPFS) is also available.
The same variables have been used for these two servers: you can
switch to one or the other by just changing the `includerc'. Above
servers are Plug-in modules: you create a directory, put files
there and your server is immediately up.
o commands.rc -- From Alan's procmail-lib, check for commands in the
subject line. Handles commands
(send|get) [help|info|procmail info|procmail lib|procmailrc]
and few others.
o rc.autoreply -- John Gianni's autoreply. You can't direcly use
this module, but you may find some ideas from it. The autoreply
feature is accomplished by "copy & paste" method, where the
procmail actions are repeated over and over; only subject "the
commands" and the files send are different. Send subject
"send rc.autoreply" to <jjg(_at_)cadence(_dot_)com> to get this
module.
[Misc]
o pm-jadaemon.rc -- Handle DAEMON messages by changing subject to
reflect the a) error reason b) to whom the message was originally
sent c) original subject sent and what was the subject. Store the
DAEMON messages to separate folder.
o pm-jaempty.rc -- check if message body is empty (nothing relevant)
Define variable BODY_EMPTY to "yes" or "no" if message is empty.
o guess-mua.rc -- Guess the Mail User Agent and set MUA: MH,PINE,MAIL
o Microlist, a small mailing list by david hunt
<dh(_at_)west(_dot_)net>
...This version contains vars set for my environment and needs,
and requires resetting of those vars before use. It's exact
function and use will remain a mystery until I get a readme
file written for it. If anyone wants to use it, I suggest you
write to me first. If anyone has any suggestions or criticisms
(no matter how harsh) please writ
http://www.west.net/~dh/homedir/microlist/microlist4.3
4.7 General procmail pointers
.Procmail is discussed in usenet newsgroup *comp.mail.misc*.
.Binary in ftp://ftp.informatik.rwth-aachen.de:/pub/packages/procmail/
Articles from procmail mailing list: covers from 1994-08 to 1995-05
(A .gz file: ~2Meg when uncompressed)
ftp://ftp.informatik.rwth-aachen.de:/pub/packages/procmail/
And Latest articles can be found here, hosted by Achim Bohnet
Covers from 1995-10 to the present day.
<ach(_at_)mpe(_dot_)mpg(_dot_)de>. The www page has nice search
capabilities.
http://www.rosat.mpe-garching.mpg.de/mailing-lists/procmail/
http://www.rosat.mpe-garching.mpg.de/~ach/exmh/archive/procmail/
"Era's Procmail faq"
http://www.iki.fi/~era/procmail/mini-faq.html
"Era's Procmail Link collections" A huge page with full of good links...
http://www.iki.fi/~era/procmail/links.html
"Nancy McGough's Mail Filtering FAQ"
http://ssil.uoregon.edu/~trenton/autopage/page7547.html
http://www.ii.com/internet/faqs/launchers/mail/filtering-faq/
"Catherine's Getting Started With Procmail"
This is a quick tutorial intended to get a procmail neophyte
started using procmail with as little trouble and fuss as possible.
http://shell3.ba.best.com/~ariel/nospam/proctut.shtml
4.8 Procmail Code
"Alan's procmail library"
Send subject "send procmail library" to Alan Stebbens
<aks(_at_)sgi(_dot_)com>
http://reality.sgi.com/aks
"Elijah's"
http://www.qz.to/~eli/src/procmail/rc.master.html
"Concordia scripts"
We provide sample sets of recipes to get you started. The great
thing about the concordia scripts is the fact that they are
designed to run from a central location and be called from a
.procmailrc installed in the user's ~/home directory.
<webdoc(_at_)alcor(_dot_)concordia(_dot_)ca>
http://alcor.concordia.ca/topics/email/auto/procmail/
"Jari's Procmail modules"
Send [jari] email with Subject "send help" or "Send ls-l.txt". The
first one sends the server help file and second sends list of
available files. In this server directory you find procmail
recipes and Emacs information. Server started 1997-09-10.
"Meng on procmail"
...goes into exhaustive detail about how I manage my mailing lists
http://icg.resnet.upenn.edu/procmail/
http://res2.resnet.upenn.edu/procmail/
"Michelle's (SmartList add-ons)"
To add subscription confirmation to smartlist
ftp://ftp.fatfree.com/ --> confirm-1.1.tar.gz
"David's" David Hunt <dh(_at_)west(_dot_)net>
...My .procmailrc and .forward files can be viewed at
http://www.west.net/~dh/homedir/pmdir/
4.9 Procmail code to filter UBE
"pm-dsspam.rc"
197-09-13 Daniel Smith <DanS(_at_)bristol(_dot_)com> has one exellent
spam filter
called `spamc.rc'. It uses some nice heuristics and filters from
various people, icluding [david] and [phil]. You can get this
first version by sending following message.
To: jari(_dot_)aalto(_at_)poboxes(_dot_)com
Subject: send pm-dsspam.rc
Later Dan made substantial changes to it and the new version is
available from ftp://ftp.bristol.nl/pub/users/DanS/spamcheck
"Jari's ube filter (compiled from others)"
After Daniel Smith posted his spam recipes to procmail mailing
list, Jari investigated them and compiled other recipes to a
general purpose UBE module that needs no special setup and can be
installed via simple INCLUDERC. No additional ube-list files are
used, all UBE all detected happens using procmail rules. The UBE
detecting module ins included in Jari's procmail module package.
You get the modules by sending Subject "send pm-code.shar" to
<jari(_dot_)aalto(_at_)poboxes(_dot_)com>
"Protect yourself from spam: A practical guide to procmail"
..take you, step by step, through everything you need to know in
order to enlist the aid of a Unix host in filtering unwanted e-mail
traffic. (This page is exellent to get you started with procmail
and filetering with simple recipes and how to store messages to
folders. Recommended for newcomers to Procmail.)
http://www.sun.com/sunworldonline/swol-12-1997/swol-12-spam.html
"Catherine A. Hampton's Spambouncer"
...The attached set of procmail recipes/filters, which I call
The Spam Bouncer, are for users who are sick of spam (unsolicited
junk mail email) and want to filter it out of their mail as easily
as possible. These recipes can be used as shared recipes for a
whole system, or by an individual for their own mailbox only.
http://www.best.com/~ariel/nospam/
"Gregory's junkfilter". Gregory Sutter and Matthew Hunt.
http://www.pobox.com/~gsutter/junkmail/ <gsutter(_at_)pobox(_dot_)com>
"Download procmail spam filters"
This is exellent site and contains many other spam stop pointers.
http://www.telebyte.com/stopspamr
"Andy's" <andy(_at_)neptune(_dot_)chem(_dot_)uga(_dot_)edu>
...For the anti-spam procmail recipe, send me mail with
subject "spam"