Hi,
Lot of improvements have been made since my last announcement
Please get the newest pm-code.shar kit by email
To: <jari(_dot_)aalto(_at_)poboxes(_dot_)com>
Subject: send help (or "send pm-code.shar")
I want to thank <Bill(_dot_)Houle(_at_)sandiegoca(_dot_)ncr(_dot_)com> for
all the sent headers
that made me improve the mailing list detector module so that it virtually
replaces all your previous mailing list settings.
I'm separate description has been send for the pm-jalist.rc module.
The pm-code.shar content description is attached
jari
Header file modules
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 SPCL 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 modules
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* -- Subroutine to extract various email components
from INPUT. Like address=foo(_at_)some(_dot_)com, net=com,
account=foo...
o *pm-jastore.rc* -- Subroutine for general mailbox delivery.
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 the 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.
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* -- controlling Forward remotedly. You can change the
forward address with a "control message" or turn on/off the
forwarding with a "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 correspondents
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 to ensure that your
includerc is called whenever a day changes. (Day change is
subject to messages you receive). Your 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 day. Instead, use the cron module to clean
the messages' backup directory only once a day, and 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-jacookie1.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 gzip. 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 *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 *send-file.rc* is a very simplistic piece of procmail code
to send file (non-MIME support) requested in subject line.
http://www.universe.digex.net/~mbr/unix/send-file.html
Mime modules
o *pm-jamime.rc* -- Subroutine to read MIME headers and put the
mime version, boundary string, content-type information to
variables.
o *pm-jamime-decode.rc* -- recipe to decode quoted-printable
or base64 encoding in the body.
o *pm-jamime-kill.rc* -- Recipe for attachment killing: 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).
o *pm-jamime-save.rc* -- Recipe for saving simple file attachement.
When you receive _ONE_ file attachement in a message, this
recipe can save it to separate directory. The content is
also decoded (base64,qp) while saving to file.
Filtering message body or 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.
Miscellaneus modules
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
compose return address with "formail -rt -x To:" you can
verify if domain is registered before sending reply. Uses cache
for already looked up domains.
o *guess-mua.rc* -- Guess the Mail User Agent and set MUA:
MH,PINE,MAIL
Mailing list modules
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 write
http://www.west.net/~dh/homedir/microlist/microlist4.3
o *pm-jalist.rc* -- Subroutine to extract mailing list name from
message. Do you need to add new recipe to your .procmailrc
every time you subscribe to new mailing list? If you do,
take a look at thsi module, which examines the message and
defines variable `LIST' to hold the maling list name. You
can use it directly to save the messages adaptively to
correct folders. No more hand work and manual storing
of mailing list messages.