[milters] Archive

Lists Index Date Thread Search

Article: 256
From: Rick Knight
Date: 2010-01-19 15:19:55 -0500
Subject: LibSnert and Milter-report

This is a multi-part message in MIME format.
--------------020706070403090202060407
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I am still trying to install Milter-report on my sendmail server. I have 
built and installed LibSnert and Milter-report. I have created the 
folders for the unix socket, pid file and cache file. I have set 
permissions on those folders. When I start Milter-report nothing 
happens. No unix socket or pid file is created. Cache folder is empty. 
Ps -w aux | grep milter-report shows nothing running. What am I doing 
wrong? How can I get Milter report to work on my system?

Software versions...
sendmail-8.14.2
libsnert-1.73.4
milter-report-0.13

Sendmail MC additions...
INPUT_MAIL_FILTER(`milter-report',`S=unix:/var/spool/milter-report/milter-report.sock, 
T=C:10s;S:10s;R:60s;E:10s')
define(`confMILTER_LOG_LEVEL', 14)

Milter-report configure command...
./configure --prefix=/usr --enable-socket=/var/spool/milter-report/milter-re
port.sock --enable-pid=/var/spool/milter-report/milter-report.pid 
--enable-cache
-file=/var/cache/milter-report/milter-report.db --enable-run-group=smmsp 
--enabl
e-run-user=smmsp

Output of configure...
platform is... Linux
checking for md5sum... md5sum
checking for autoconf-2.61... no
checking for autoconf-2.59... no
checking for autoconf... autoconf

milter-report/0.13.28
Copyright 2005, 2009 by Anthony Howe. All rights reserved.


Generating files...

configure: creating ./config.status
config.status: creating manual.shtml
config.status: creating startup.sh
config.status: creating sample.mc
config.status: creating install.sh
config.status: creating makefile
config.status: creating config.h

milter-report/0.13.28
Copyright 2005, 2009 by Anthony Howe. All rights reserved.

  Platform..............: Linux gcc
  LibSnert..............: yes
  --prefix..............: /usr
  --datadir.............: ${prefix}/share
  --localstatedir.......: ${prefix}/var
  --exec_prefix.........: ${prefix}
  --sbindir.............: ${exec_prefix}/sbin
  --libexecdir..........: ${exec_prefix}/libexec
  --enable-run-user.....: smmsp
  --enable-run-group....: smmsp
  --enable-pid..........: /var/spool/milter-report/milter-report.pid
  --enable-socket.......: /var/spool/milter-report/milter-report.sock
  --enable-cache-file...: /var/cache/milter-report/milter-report.db
  --enable-cache-type...: default
  --with-sendmail.......: /etc/mail
  CFLAGS................:  -I/usr/include/db44 
-I/home/share/org/sqlite/include -D_REENTRANT -O2 -Wall 
-I${top_srcdir}/../../include
  LDFLAGS...............:  -L/home/share/org/sqlite/lib 
-L${top_srcdir}/../../lib
  LIBS..................:  -lsnert -lpthread -ldl  -lmilter -ldb4 
/home/share/org/sqlite/lib/libsqlite3.a -lrt -lpthread


Build commands...
make
make install

I have also attached my startup script.

Thank you,
Rick Knight


--------------020706070403090202060407
Content-Type: text/plain;
 name="milter-report"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="milter-report"

#!/bin/sh
#
# Copyright 2005, 2009 by Anthony Howe. All rights reserved.
#
# startup.sh.  Generated from startup.sh.in by configure.
#
# $OpenBSD$

# chkconfig: 345 87 12
# description: milter-report

# REQUIRE: syslogd
# BEFORE:  mail
# KEYWORD: FreeBSD NetBSD


prefix="/usr"
exec_prefix="${prefix}"
libexecdir="${exec_prefix}/libexec"
sbindir="${exec_prefix}/sbin"
localstatedir="/var"
PACKAGE_NAME="milter-report"
PID_FILE="${localstatedir}/spool/milter-report/${PACKAGE_NAME}.pid"

COLUMN='\r\033[71C'
FG_RED='\033[1;31m'
FG_GREEN='\033[1;32m'
FG_NORMAL='\033[0m'

##########################################################################
#	Nothing to be configured below this point.
##########################################################################

if test -x $libexecdir/$PACKAGE_NAME ; then
	PROGRAM=$libexecdir/$PACKAGE_NAME
elif test -x $sbindir/$PACKAGE_NAME ; then
	PROGRAM=$sbindir/$PACKAGE_NAME
else
	echo "$PACKAGE_NAME not found".
	exit 0;
fi

os=`uname -s`

unalias announce >/dev/null 2>&1
announce()
{
	case $os in
	Linux*)
		printf "$1"
		;;
	esac
}

unalias pass >/dev/null 2>&1
pass()
{
	case $os in
	Linux*)
		printf ${COLUMN}'['${FG_GREEN}'  OK  '${FG_NORMAL}']\n'
		;;
	*)
		echo -n " $PACKAGE_NAME"
		;;
	esac
}

unalias fail >/dev/null 2>&1
fail()
{
	case $os in
	Linux*)
		printf ${COLUMN}'['${FG_RED}'FAILED'${FG_NORMAL}']\n'
		;;
	*)
		;;
	esac
}

#
# I choose to use getpid() instead of the $PID_FILE, because .pid
# files can disappear while the program is still running.
#
unalias getpid >/dev/null 2>&1
getpid()
{
	sleep 1
	case $os in
	Linux*)
ps acxj | grep "$PACKAGE_NAME" | sed -n -e '/^  *1 /{
s/^ *[^ ][^ ]*  *\([0-9][0-9]*\).*/\1/
p
}'
		;;
	SunOS)
ps -ef | grep "$PACKAGE_NAME" | sed -n -e '/^ *[^ ][^ ]*  *[0-9][0-9]*  *1 /{
s/^ *[^ ][^ ]*  *\([0-9][0-9]*\).*/\1/
p
}'
		;;
	*BSD*)
ps -acxj | grep "$PACKAGE_NAME" | sed -n -e '/^ *[^ ][^ ]*  *[0-9][0-9]*  *1 /{
s/^ *[^ ][^ ]*  *\([0-9][0-9]*\).*/\1/
p
}'
		;;
	esac
}

unalias start >/dev/null 2>&1
start()
{
        announce "Starting $PACKAGE_NAME"

	pid=`getpid "$PROGRAM"`
	if test X"$pid" != X ; then
		# I'm not dead yet.
		fail
		return
	fi

	$PROGRAM $OPTIONS

	pid=`getpid "$PROGRAM"`
	if test X"$pid" = X ; then
		# I think I'm dead.
		fail
		return
	fi

	pass
}

unalias stop >/dev/null 2>&1
stop()
{
        announce "Stopping $PACKAGE_NAME"

	# The milter knows how to terminate a running instance of itself.
	$PROGRAM -x

	sleep 1
	pid=`getpid "$PROGRAM"`
	if test X"$pid" != X ; then
		# I'm not dead yet.
		kill -KILL $pid

		pid=`getpid "$PROGRAM"`
		if test X"$pid" != X ; then					
			# I'm still not dead.
			fail
			return
		fi
	fi

	pass
}

case "$1" in
restart)
	stop
	start
	;;
start)
	start
	;;
stop)
	stop
	;;
status)
	pid=`getpid "$PROGRAM"`
	if test X"$pid" != X ; then
		echo "$PACKAGE_NAME:${pid}"	
	else
		echo "$PACKAGE_NAME:STOPPED"	
	fi
	;;
*)
	echo "Usage: $PACKAGE_NAME {start|stop|restart|status}"
	exit 1
esac

exit $?


--------------020706070403090202060407--

Lists Index Date Thread Search