Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PREPFLOG(1)	      User Contributed Perl Documentation	   PREPFLOG(1)

NAME
       prepflog.pl - Pre-processor for pflogsumm

SYNOPSIS
       prepflog.pl [-d <today|yesterday>][--syslog_name=string]
		   [file1 [filen]]

       prepflog.pl -[help|version]

       If no file(s) specified,	reads from stdin. Output is to stdout.

DESCRIPTION
       Utility to filter out postfix log lines due to re-injection into
       postfix of messages from	a content filter or antivirus scanner.

       Reads from input	and writes to output intercepting and disregarding
       lines which are related to the second passage of	messages through
       postfix.

       The output is suitable to pass to pflogsumm and should avoid
       pflogsumm's double counting of these messages.

       As with pflogsumm itself, only postfix lines are	processed.  All	other
       log lines are not passed	on to the output.  A non standard syslog name
       can be handled via the syslog_name parameter. Also log lines may	be
       filtered	by today or yesterday's	date.

OPTIONS
       -d today	      extract log lines	just for today

       -d yesterday   extract log lines	just for yesterday

       -help	      Emit short usage message and bail	out.

       --syslog_name=name

		      Set syslog_name to look for for Postfix log entries.

		      By default, prepflog looks for entries in	logfiles
		      with a syslog name of "postfix," the default.
		      If you've	set a non-default "syslog_name"	parameter
		      in your Postfix configuration, use this option to
		      tell prepflog what that is.

       -version	     Print program name	and version and	bail out.

EXAMPLES
       Typical use of this pre-processor would be:

       prepflog.pl -d yesterday	/var/log/mail |	pflogsumm.pl

       Any other options can be	specified to pflogsumm as normal.  The -d flag
       can however be omitted from pflogsumm if	already	specified with
       prepflog.pl. It will do no harm if left.	 If --syslog_name is used with
       prepflog.pl it must be specified	again with pflogsumm.

       Processing of log files should be carried out just before rotating
       them. Even so it	is still possible to miss messages unless processing
       considers all log files for a particular	day. A script that may be
       helpful for this	is (which considers that logfiles are compressed when
       rotated):

	       #!/bin/sh
	       LASTLOG=`ls -t /var/log/mail*.gz	| head -n 1`
	       /bin/zcat $LASTLOG | /bin/cat - /var/log/mail | \
		       /usr/local/bin/prepflog.pl -d yesterday | \
		       /usr/local/bin/pflogsumm

CAVEATS
       The current release is a	beta version, which has	undergone internal
       testing.	In particular it has not been tested on	a highly loaded	server
       or a large corpus of mail log examples

       As always, use a	program	in a test environment until you	are
       comfortable about putting it into a production environment.

BUGS
       None known, but needs more testing.

NOTES
       Compatible with postfix 2.3 or later  and pflogsumm 1.1.3

SEE ALSO
       pflogsumm(1)

AUTHOR
       John Fawcett

       This script has been adapted from the pflogsumm written by Jim Seymour.
       Whole sections of pflogsumm code	have been imported here. The reason
       for this	is that	having taken into account the way pflogsumm works, it
       should be easier	to integrate in	the future, if indeed that step	is
       found to	be a useful one.

       Any feedback is welcome:	john@voipsupport.it

       The script is currently available at: http://www.voipsupport.it/

COPYRIGHT AND LICENSE
       Copyright (c) 2004 John Fawcett

       The parts of the	code derived from pflogsumm are	copyrighted by Jim
       Seymour.

       This program is free software; you can redistribute it and/or modify it
       under the terms of the GNU General Public License as published by the
       Free Software Foundation; either	version	2 of the License, or (at your
       option) any later version.

       This program is distributed in the hope that it will be useful, but
       WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A	PARTICULAR PURPOSE.  See the GNU
       General Public License for more details.

       You may have received a copy of the GNU General Public License along
       with this program; if not, write	to the Free Software Foundation, Inc.,
       59 Temple Place - Suite 330, Boston, MA	02111-1307, USA.

       An on-line copy of the GNU General Public License can be	found
       http://www.fsf.org/copyleft/gpl.html.

perl v5.42.0			  2025-11-02			   PREPFLOG(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=prepflog&sektion=1&manpath=FreeBSD+Ports+15.0>

home | help