Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jul 1998 15:43:40 -0400 (EDT)
From:      jack <jack@germanium.xtalwind.net>
To:        "David O'Brien" <obrien@NUXI.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: manually using procmail
Message-ID:  <Pine.BSF.3.96.980708154252.14267A-100000@germanium.xtalwind.net>
In-Reply-To: <19980708113034.B8731@nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 8 Jul 1998, David O'Brien wrote:

> Does anybody know if a way to take a Berkeley mailbox-formated file and
> "pipe" it thru procmail so that it would be processed as if you received
> the mail the usual way?

Haven't read man procmail(1), have we?  :)

       Procmail  can  also  be	invoked to postprocess an already
       filled system mailbox.  This can be useful  if  you  don't
       want  to or can't use a $HOME/.forward file (in which case
       the following script could  periodically  be  called  from
       within cron(1), or whenever you start reading mail):

	      #!/bin/sh

	      ORGMAIL=/var/mail/$LOGNAME

	      if cd $HOME &&
	       test -s $ORGMAIL &&
	       lockfile -r0 -l1024 .newmail.lock 2>/dev/null
	      then
		trap "rm -f .newmail.lock" 1 2 3 13 15
		umask 077
		lockfile -l1024 -ml
		cat $ORGMAIL >>.newmail &&
		 cat /dev/null >$ORGMAIL
		lockfile -mu
		formail -s procmail <.newmail &&
		 rm -f .newmail
		rm -f .newmail.lock
	      fi
	      exit 0



--------------------------------------------------------------------------
Jack O'Neill                    Systems Administrator / Systems Analyst
jack@germanium.xtalwind.net     Crystal Wind Communications, Inc.
          Finger jack@germanium.xtalwind.net for my PGP key.
   PGP Key fingerprint = F6 C4 E6 D4 2F 15 A7 67   FD 09 E9 3C 5F CC EB CD
               enriched, vcard, HTML messages > /dev/null
       Mail from netcom.com blocked until they stop relaying SPAM
--------------------------------------------------------------------------



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980708154252.14267A-100000>