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 Try Also "send help"
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 the
_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 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.80
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.5 Procmail module list
The UBE stop modules are not listed here. See pointers in "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. Recipe may be message specific.
[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.
Supports single mboxes, ".gz" mbox files, directory files and
MH folders with rcvstore.
[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-japop3.rc -- Pop3 movemail implemented with procmail. You can
send a "pop3" request to move your messages from account X to
account Y. Each message is send separately. This recipe listens
"pop3" requests.
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 confirmation 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
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.
[Mime]
o pm-jamime.rc -- subroutine to read MIME headers and put the
mime version, boundary string, content-type information to
variables.
o pm-jamime-kill.rc -- General attachement killer: wipes out the
extra mime cruft leaving only the plain text. Applications for
killing: ms-tnef attachement (MS Explorer 7k),
html attachements (netscape, MS Express) vcard (Netscape),
PCX attachement (Lotus Notes).
[Filltering messages body/headers]
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-jasubject.rc -- Standardize Subject "Re[32]: FW: Sv: message"
or any other derivate to de facto "Re: message"
o pm-janetmind.rc -- Reformat http://minder.netmind.com/ messages,
The default 4k message is shortened to few important lines.
[Misc]
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 pm-janslookup.rc -- Run nslookup on given address. If you extract
address = `formail -rt -x To:` you can verify if domain is
registered before sending reply. Uses cache for already
looked up domain.
o guess-mua.rc -- Guess the Mail User Agent and set MUA: MH,PINE,MAIL
[Mailing lists]
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.6 Plus addressing foo+bar(_at_)address(_dot_)com
http://www.qz.to/~eli/faqs/addressing.html
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/
"Archived messages"
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
"pm-code.shar Jari's Procmail modules"
Send subject "send help" or "send ls-l.txt" or "send pm-code.shar"
to <jari(_dot_)aalto(_at_)poboxes(_dot_)com>. 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.
"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/
"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/
"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 SmartList code (mailing list implementation with procmail)
"Michelle's (SmartList add-ons)"
To add subscription confirmation to smartlist
ftp://ftp.fatfree.com/ --> confirm-1.1.tar.gz
"The mail-list.com front-end for Smartlist Mailing Lists"
...This is a front end to Smartlist mailing lists. It provides easy to
use addresses for subscribers of the list. It also allows list owners
to concatenate many Smartlist commands into one email message, which
is then broken up and sent in as separate messages to Smartlist.
These scripts can accept messages for any mailing list, extract the
name of the list, and then format the appropriate commands that are
then forwarded on to the standard Smartlist list-request address.
These scripts do not directly alter the Smartlist dist file.
A discussion group mailing list is available for support.
Please send a blank message to <front-end-on(_at_)mail-list(_dot_)com >
below to
start the subscription process.
ftp://ftp.mail-list.com mark david mcCreary
<mdm(_at_)internet-tools(_dot_)com
4.10 Procmail code to filter UBE
_Sysadms_ _remember_ : Spam filtering is much more efficiently done
in the MTA, especially if you just looking at From and To lines.
For example, I you can setup in Exim a rule that blocks
\d(_dot_)*(_at_)aol\(_dot_)com
(that is any aol.com local part that begins with a digit). AOL
guarrentees that _none_ of their addresses being with a digit. Exim
rejects such bogus addresses at the SMTP level before the message
is received.
"pm-dsspam.rc"
1997-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
"pm-jaube.rc 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 module
is included in pm-code.shar.
To: jari(_dot_)aalto(_at_)poboxes(_dot_)com
Subject: send pm-code.shar
"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/
"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 filtering 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
"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>
[Andy Dustman is a respected remailer operator]
...For the anti-spam procmail recipe, send me mail with subject "spam"