From owner-freebsd-questions@FreeBSD.ORG Wed Nov 17 22:14:10 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA34E106566B for ; Wed, 17 Nov 2010 22:14:10 +0000 (UTC) (envelope-from vogelke@hcst.net) Received: from beta.hcst.com (beta.hcst.com [192.52.183.241]) by mx1.freebsd.org (Postfix) with ESMTP id 8BD118FC28 for ; Wed, 17 Nov 2010 22:14:10 +0000 (UTC) Received: from beta.hcst.com (localhost [127.0.0.1]) by beta.hcst.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oAHME98Q015322 for ; Wed, 17 Nov 2010 17:14:09 -0500 Received: (from vogelke@localhost) by beta.hcst.com (8.14.3/8.14.3/Submit) id oAHME94d015321; Wed, 17 Nov 2010 17:14:09 -0500 Received: by kev.msw.wpafb.af.mil (Postfix, from userid 32768) id C10B9BF95; Wed, 17 Nov 2010 17:06:40 -0500 (EST) To: freebsd-questions@freebsd.org In-reply-to: (message from AN on Wed, 17 Nov 2010 19:59:10 +0000 (UTC)) Organization: Array Infotech X-Disclaimer: I don't speak for the USAF or Array Infotech. X-GPG-ID: 1024D/711752A0 2006-06-27 Karl Vogel X-GPG-Fingerprint: 56EB 6DBF 4224 C953 F417 CC99 4C7C 7D46 7117 52A0 References: Message-Id: <20101117220640.C10B9BF95@kev.msw.wpafb.af.mil> Date: Wed, 17 Nov 2010 17:06:40 -0500 (EST) From: vogelke+unix@pobox.com (Karl Vogel) Subject: Re: procmail config help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vogelke+unix@pobox.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 22:14:10 -0000 >> On Wed, 17 Nov 2010 19:59:10 +0000 (UTC), >> AN said: A> If anyone has a working procmail config file to share that would be A> appreciated. When messing with procmail, start with the simplest setup that can possibly work. Your logfile has to exist, or procmail will ignore it. If you already have a working .procmailrc file, here's a safe way to add tweaks: 1. copy an existing mail message to /tmp/msg, 2. cp $HOME/.procmailrc $HOME/.procnew and DON'T touch the original, 3. run "procmail -m $HOME/.procnew < /tmp/msg" to test. Try the .procmailrc skeleton below. The .whitelist and .blacklist files hold email addresses (one per line) that you want to pass or block, respectively. Logfiles are stored in the user's ~/mail directory. -- Karl Vogel I don't speak for the USAF or my company Why you might be the reincarnation of someone famous #11: When your boss criticizes your sales projection figures, you hack off your ear. --The Top Five List, top5@walrus.com --------------------------------------------------------------------------- # $Revision: 1.60+6 $ $Date: 2010-07-08 15:19:01-04 $ # # NAME: # $HOME/.procmailrc # # DESCRIPTION: # "procmail" handles local mail delivery. Use this file to: # - store your mail in a given folder, # - forward or discard mail depending on the contents, or # - run your mail through a program automatically. # Search path. PATH=/usr/local/bin:/bin:/usr/bin:$HOME/bin # Default mail folder. DEFAULT=/var/mail/andy # Current directory while procmail is executing. # All pathnames are relative to this directory. MAILDIR=$HOME/mail # File containing error messages or diagnostics. If this # file does not exist, said messages will be bounced # back to the message sender. LOGFILE=$MAILDIR/MAILLOG # If yes, keep an abstract of the From and Subject lines of # each delivered message, the folder it was delivered to, # and the size of the message. If no, skip this abstract. LOGABSTRACT=yes # If on, describe actions of procmail in detail. #VERBOSE=on # Number of seconds before procmail zaps a lockfile by force. LOCKTIMEOUT=5 # Default shell and umask value. SHELL=/bin/sh UMASK=022 # Frequently-used variables. WEEK="`/bin/date +%Yw%W`" #==================================================================== # Rules section. # # RULE: Save a copy of all incoming headers in a file called # $HOME/mail/HEADERS.YYYYwNN # where YYYY = year # NN = the week number starting on Monday. :0 chw: $HOME/hdr.lck | /bin/cat - >> $HOME/mail/HEADERS.$WEEK; #-------------------------------------------------------------------- # RULE: pass anything in the sender whitelist. :0: * ? formail -x"From:" -x"From" -x"To:" -x"Reply-To:" -x"Cc:" \ | fgrep -is -f $HOME/.whitelist $DEFAULT #-------------------------------------------------------------------- # RULE: kill anything in the sender blacklist. :0: * ? formail -x"From:" -x"From" -x"To:" -x"Reply-To:" -x"Cc:" \ | fgrep -is -f $HOME/.blacklist spam-folder #-------------------------------------------------------------------- # Keep everything else. :0 : $DEFAULT