procmail
[Top] [All Lists]

ANNOUNCE: Procmail tips page

1998-06-19 14:05:39
        This is a regular posting once a month.

        In addition to Era's procmail pages at

            http://www.iki.fi/~era/procmail/
            http://www.iki.fi/~era/procmail/links.html

        there is document that evolved when I joined the world of procmail.
        I wanted to know all about it and learn all the features that were
        not so well documented before. thanks to following people and
        docunts, the procmail tips page was born. It contains tons of
        examples from the procmail archive that I waded through many weeks
        before I found those shining gems that makes your procmail a little
        bit easier.

        You can read the document (+450K .txt) from my University's ftp
        server; but the connection may be slow ot you may get busy signal
        "connection refused".

            ftp://cs.uta.fi/pub/ssjaaa/pm-tips.html

        Alternatively, you can get it by email sending message to
        File Server:

            To: <jari(_dot_)aalto(_at_)poboxes(_dot_)com>
            Subject: send pm-tips.txt           Try "send help" too

        You can convert the .txt file to .html file with the Perl script
        "t2html.pls" which is also available from the File Server or fromt
        the homepage

            ftp://cs.uta.fi/pub/ssjaaa/t2html.html

        May your journey with procmail be easier now on :-) All my sincere
        thanks goes to people that helped me to understand procmail when I
        was real green:

        .[stephen]  Stephen R. van den Berg, Author of Procmail
                    Last heard from stephen 1997-08 in procmail mailing
                    list by using address <srb(_at_)cuci(_dot_)nl>
        .[alan]     Alan K. Stebbens    
<aks(_at_)anywhere(_dot_)engr(_dot_)sgi(_dot_)com>
        .[david]    David W. Tamkin     <dattier(_at_)wwa(_dot_)com>
        .[phil]     Philip Guenther     <guenther(_at_)gac(_dot_)edu>
        .[elijah]   Eli the Bearded     
<process(_at_)qz(_dot_)little-neck(_dot_)ny(_dot_)us>
        .[aaron]    Aaron Schrab        <aaron+procmail(_at_)schrab(_dot_)com>
        .[dan]      Daniel Smith        <dan(_at_)bristol(_dot_)com>
        .[hal]      Hal Wine            <hal(_at_)dtor(_dot_)com>
        .[timothy]  Timothy J Luoma     
<luomat+procmail(_at_)luomat(_dot_)peak(_dot_)org>
        .[sean]     Sean B. Straw       
<PSE-L(_at_)mail(_dot_)professional(_dot_)org>
        .[ed]       Edward J. Sabol     
<sabol(_at_)alderaan(_dot_)gsfc(_dot_)nasa(_dot_)gov>
        .[jari]     Jari Aalto          
<jari(_dot_)aalto(_at_)poboxes(_dot_)com>
        .[faq]      Procmail FAQ        j1era+pr(_at_)iki(_dot_)fi
        .[manual]   Quote from some procmail manual page
        .PM-L       Procmail mailing list
        <<text>>    Text has been rephrased or something was added which does
                    not exist in original message.

pm-tips.txt Table of contents 1998-04-28

        1.0 Document id
            1.1 General
            1.2 Abbreviations and thanks
            1.3 Version information
            1.4 Document layout
            1.5 About presented recipes
            1.6 Variables used in recipes
            1.7 About "useless use of cat award"
            1.8 Sending improvements
            1.9 What is Procmail?

        2.0 UBE in Internet
            2.1 Terms used and foreword
            2.2 UBE strategies
            2.3 UBE and bouncing message back
            2.4 UBE and "I don't mind" attitude
            2.5 Is one or two UBE messages acceptable

        3.0 Anti-UBE pointers
            3.1 NoCEM, CAUCE and others
            3.2 General Filtering pages (more than procmail)
            3.3 Junk email and spam
            3.4 Comprehensive list of spammers
            3.5 Misc pointers
            3.6 Questionable UBE stop services
            3.7 UBE related newsgroups
            3.8 Software: yell -- perl
            3.9 Software: RBL lookup tool -- C
            3.10 Software, mapSoN
            3.11 Software: spamgard
            3.12 Software, Spam Be Gone

        4.0 Procmail pointers
            4.1 Procmail discussion list
            4.2 To get off procmail discussion list
            4.3 Procmail Lint service (code check)
            4.4 Procmail module list
            4.5 General procmail pointers
            4.6 Procmail Code
            4.7 SmartList code (mailing list implementation with procmail)
            4.8 Procmail code to filter UBE

        5.0 Dry run testing
            5.1 What is dry run testing
            5.2 Why the From field is not okay after dry run
            5.3 Getting default value of procmail variable

        6.0 Things to remember
            6.1 Get newest procmail
            6.2 Csh's tilde is not supported
            6.3 Be sure to write the recipe start right
            6.4 Always set SHELL and PATH variables
            6.5 Keep the log on all the time
            6.6 Never add trailing slash for directories
            6.7 Remember what term DELIVERED means
            6.8 Beware putting comment in wrong place
            6.9 Brace placement
            6.10 Local lockfile usage
            6.11 Global lockfile
            6.12 Gee, where do I put all those ! * $ ??
            6.13 Sending automatic reply, use X-loop header
            6.14 Avoid extra shell layer (check command for SHELLMETAS)
            6.15 Think what shell commands you use
            6.16 Using absolute path when calling a shell program

        7.0 Procmail flags
            7.1 The order of the flags
            7.2 Flag w and recipe with |
            7.3 Flag w, lockfile and recipe with |
            7.4 Flag f and w together
            7.5 Flags h and b
            7.6 Flag h and sinking to /dev/null
            7.7 Flag i and pipe flag f
            7.8 Flag r
            7.9 Flag c's background
            7.10 Flag c before nested block forks a child
            7.11 Flags before nested block
            7.12 Flags aAeE tutorial

        8.0 Matching and regexps
            8.1 Matches are not case sensitive
            8.2 Procmail uses multiline matches
            8.3 Headers are folded before matching
            8.4 Improving Space-Tab syndrome
            8.5 Rules for generating a character class
            8.6 Matching space at the end of condition
            8.7 Beware leading backslash
            8.8 Correct use of TO Macro
            8.9 Procmail's regexp engine
            8.10 Procmail and egrep differences
            8.11 Undesrtanding procmail's minimal matching (stingy vs. greedy)
            8.12 Explaining \/ and ()\/
            8.13 Explaning  ^^ and ^
            8.14 ANDing traditionally
            8.15 ORing traditionally
            8.16 ORing and score recipe
            8.17 ORing by using De Morgan rules

        9.0 Variables
            9.1 Setting and unsetting variables
            9.2 Variable initialisation and sh syntax
            9.3 Testing variables
            9.4 What is construct $\VAR in procmail 3.11
            9.5 Common pitfalls when using variables
            9.6 Quoting: Using single or double quotes
            9.7 Quoting: Passing values to a external program
            9.8 Passing values from an external program
            9.9 Incrementing variable by N
            9.10 Comparing values
            9.11 Strings: How to strip trailing newline
            9.12 Strings: Getting partial matches from string
            9.13 How to raise a flag if the message was filed
            9.14 Dollar sign in condition line
            9.15 Finding mysterious foo variable
            9.16 Storing code to variable
            9.17 Getting headers to a variable
            9.18 Converting value to lowercase

        10.0 Suggestions and miscellaneous
            10.1 Speeding up procmail
            10.2 See the procmail installation's examples
            10.3 Printing statistics of your incoming mail
            10.4 Storing UBE mboxes outside of quota
            10.5 Gzipping messages
            10.6 Using first 5-30 lines from the message
            10.7 Using cat or echo in scripts
            10.8 How to run an extra shell command as a side effect?
            10.9 Forcing "ok" return status from shell script
            10.10 Make your own .procmailrc available to others
            10.11 Using dates efficiently
            10.12 Keep message backup, no matter what
            10.13 Keep simple header log
            10.14 Emergency stop for your .procmailrc

        11.0 Scoring
            11.1 Using scores by an example
            11.2 Brief Score tutorial
            11.3 Score's scope
            11.4 Counting lines in a message (Adding Lines: header)
            11.5 Determining if body is longer than header
            11.6 Matching last Received header
            11.7 How to add Content-Length header
            11.8 Processing messages shorter than N lines
            11.9 Counting commas with recursive inclurerc

        12.0 Formail usage
            12.1 Always use formail's -rt switch
            12.2 Using -rt and rewriting the From address
            12.3 Formail -rt and Resent-From header
            12.4 Quoting the message
            12.5 Without quoting the message
            12.6 How to include headers and body to the reply message
            12.7 How to add text to the beginning of message
            12.8 How to add text to the end of message
            12.9 How to truncate headers (save filing space)
            12.10 Adding extra headers from file
            12.11 Extracting all From addresses from mailbox
            12.12 Applying procmail recipe on whole mailbox
            12.13 Splitting digest
            12.14 Making formail to run series of commands for each mail
            12.15 Option -D and cache
            12.16 Option -D and message-id in the body
            12.17 Reducing formail calls (conditionally adding fields)
            12.18 Formail -A -a options
            12.19 Formail -e -s options

        13.0 Saving mailing list messages
            13.1 Using plus addressing foo+bar(_at_)address(_dot_)com
            13.2 Using RFC comment trick for additional information
            13.3 Simple list mail detection
            13.4 Archiving according to TO
            13.5 Using Return-Path to detect mailing lists

        14.0 Procmail, MIME and HTML
            14.1 Software to deal with mime or html
            14.2 Trapping html mime messages
            14.3 Complaining about html messages
            14.4 Getting rid of unwanted mime attachements (html, vcard)
            14.5 Sending contents of a html page in plain text to someone

        15.0 Simple recipe examples
            15.1 Saving: MH folders -- numbered messages
            15.2 Saving: to monthly folders
            15.3 Modifying: Filtering basics
            15.4 Modifying: Squeezing empty lines around message body
            15.5 Service: Auto answerer to empty messages
            15.6 Service: Ping responder
            15.7 Service: simple vacation with procmail
            15.8 Service: vacation code example
            15.9 Service: Auto-forwarding
            15.10 Service: forward only specific messages
            15.11 Service: Making digests
            15.12 Kill: simple killfile recipe with procmail
            15.13 Kill: duplicate messages
            15.14 Kill: spam filter with simple recipes
            15.15 Kill: (un)subscribe messages
            15.16 Time: Once a day cron-like job
            15.17 Time: Running a recipe at a given time
            15.18 Time: Triggering email and using cron
            15.19 Decoding: Uudecode
            15.20 Decoding: MIME
            15.21 How to send commands in the message's body
            15.22 Matching two words on a line, but not one
            15.23 How to define personal XX macros?
            15.24 How to change subject by body match
            15.25 How to change Subject according to some other header
            15.26 How to call program with parameters

        16.0 Miscellaneous recipes
            16.1 Sending two files in a message
            16.2 Excessive quoting of message
            16.3 Sending message to pager in chunks
            16.4 Playing particular sound when message arrives
            16.5 Combining multiple Original-Cc and Original-To headers
            16.6 Forwarding sensitive messages in encrypted format

        17.0 Procmail and PGP
            17.1 Decrypt pgp messages automatically
            17.2 Getkeys from keyserver
            17.3 Auto grab incoming pgp keys

        18.0 Includerc usage
            18.1 Using: multiple rc files
            18.2 Using: You can call rc file conditionally
            18.3 Making: naming of the rc file
            18.4 Making: Using namespace when saving procmail variables
            18.5 Making: Public and private variables in rc file
            18.6 The rules of thumb for constructing general purpose rc file
            18.7 An includerc skeleton

        19.0 Mailing list server
            19.1 Mailing list server pointers
            19.2 Simple Mailing list server

        20.0 Common troubles
            20.1 Procmail as mail filtering device
            20.2 My ISP isn't very interested in installing procmail
            20.3 My ISP has systemwide procmailrc; is this a good idea?
            20.4 Procmail changes mailbox and directory permissions
            20.5 Changing mbox permission during compilation to 660
            20.6 The .forward file must be real file
            20.7 Qmail: Procmail looks file from /var/spool/mail only
            20.8 Qmail: patch to procmail 3.11pre7 to work with Maildirs
            20.9 AFS: How to use Procmail when HOME is in AFS cell
            20.10 Help, some idiot sent my address to 30 mailing lists
            20.11 Help, Procmail beeps and prints to my console
            20.12 Help, procmail dumps mail to console
            20.13 Help, corrupted From_ line in mailbox
            20.14 Directing user's mail to HOME instead of /var/spool/
            20.15 I can't see the sendmail's response in LOGFILE
            20.16 Compiling procmail and choosing locking scheme

        21.0 Implementation details
            21.1 What happens to mail if MDA Procmail fails
            21.2 Procmail reads entire 90Mb message into memory
            21.3 Variables DEFAULT and ORGMAIL
            21.4 When DEFAULT cannot be mailed to
            21.5 Variable DROPPRIVS
            21.6 Variable HOME
            21.7 Variable HOST
            21.8 Variable LINEBUF
            21.9 Variable TRAP
            21.10 Variable UMASK
            21.11 Performance difference between backtick and "|" recipe
            21.12 Procmail's temporary file names while writing file out
            21.13 Parameter $@
            21.14 Procmail variables are null terminated (detecting null string)
            21.15 FROM_DAEMON TO and TO_ and case-sensitiveness
            21.16 TO_ macro deciphered
            21.17 TO_ macro and RFC 822
            21.18 FROM_DAEMON deciphered

        22.0 Technical matters
            22.1 List of exit codes
            22.2 List of precedence codes
            22.3 Sendmail and -t
            22.4 RFC22 Reply-To and formail problem with multiple recipients
            22.5 Procmail and IMAP server
            22.6 Machine which processes mail
            22.7 Compiling procmail and MAILSPOOLHOME

        23.0 Procmail version notes: features and bugs, patches
            23.1 Procmail doesn't allow filing to multiple mboxes
            23.2 TIMEOUT has its pecularities
            23.3 Variable capture |= is unreliable
            23.4 Forwarding with ! token and -t switch
            23.5 V3.10 regexps bug
            23.6 V3.10-3.11pre7: FROM_MAILER has changed
            23.7 V3.11pre5-pre6 are dangerous
            23.8 V3.11pre7 has different flag c handling
            23.9 V3.11pre7 and MATCH strips all leading blank lines in body
            23.10 V3.11pre7 has a MATCH bug
            23.11 Patch: limit what binaries can be executed by procmail

        24.0 Smartlist
            24.1 Installation trouble: getparams

        25.0 Additional procmail or MUA software
            25.1 Comstat to handle multiple mailboxes
            25.2 Elm and pgp support (Mutt)
            25.3 MH sites

        26.0 Additional procmail software for Emacs
            26.1 What is Emacs
            26.2 Emacs and procmail mode and Lint
            26.3 Emacs and lining up backslashes
            26.4 Emacs and browsing mailbox files
            26.5 Emacs and live-find-file.el
            26.6 Emacs and font-lock.el

        27.0 Procmail, Emacs and Gnus
            27.1 Gnus pointers
            27.2 Why use procmail with Gnus
            27.3 Setting up gnus for procmail - Basics
            27.4 Gnus for procmail - More gnus
            27.5 Emacs and Gnus -- Fiddling with spool files
            27.6 Gnus and article snippets
            27.7 Emacs GNUS - POP - Procmail

        28.0 RFC, Request for comments
            28.1 RFCs and their jurisdiction (munged Addresses)
            28.2 Comments about addresses munging
            28.3 RFC and valid email address characters
            28.4 RFCs and message's signature
            28.5 Some RFC Pointers

        29.0 Introduction to E-mail Headers
            29.1 Lecture by Alan Stebbens
            29.2 Applied to received messages
            29.3 Bcc lecture by Alan Stebbens
            29.4 Bcc lecture by Philip Guenther

        30.0 Message's headers
            30.1 What's that X-UIDL header?
            30.2 From_ is the envelope sender
            30.3 Message-Id
            30.4 X-Subscription-Info
            30.5 Reply-To header
            30.6 Mail-Copies-To header
            30.7 Mail-Followup-To and Reply-To-Personal headers
            30.8 Content-Length header and From_ specification

        31.0 MIME tags
            31.1 MS Exchange application/ms-tnef

        32.0 Jokes
            32.1 The ultimate spam filter

        33.0 Other interesting code
            33.1 Misc email related pointers
            33.2 Expire mail pointers
            33.3 Usenet News related pointers
            33.4 Html layout of the Code sections
            33.5 Code: Perl Extract procmail man pages from 
procmail-3.11pre7.tar.gz
            33.6 Code: Sh remove matching lines from file
            33.7 Code: Sh expire mail
            33.8 Code: Gawk expire mail

<Prev in Thread] Current Thread [Next in Thread>
  • ANNOUNCE: Procmail tips page, jari.aalto <=