Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd530ebf86 |
+2
-4
@@ -142,10 +142,8 @@ def connectcallback(ctx,hostname,family,hostaddr):
|
||||
def closecallback(ctx):
|
||||
m = ctx.getpriv()
|
||||
if not m: return CONTINUE
|
||||
try:
|
||||
rc = m.close()
|
||||
finally:
|
||||
m._setctx(None) # release milterContext
|
||||
rc = m.close()
|
||||
m._setctx(None) # release milterContext
|
||||
return rc
|
||||
|
||||
def dictfromlist(args):
|
||||
|
||||
+3
-9
@@ -35,12 +35,6 @@ $ python setup.py help
|
||||
libraries=["milter","smutil","resolv"]
|
||||
|
||||
* $Log$
|
||||
* Revision 1.16 2008/12/16 04:21:05 customdesigned
|
||||
* Fedora release
|
||||
*
|
||||
* Revision 1.15 2008/12/13 20:29:56 customdesigned
|
||||
* Split off milter applications.
|
||||
*
|
||||
* Revision 1.14 2008/12/04 19:43:00 customdesigned
|
||||
* Doc updates.
|
||||
*
|
||||
@@ -1100,7 +1094,7 @@ milter_addrcpt(PyObject *self, PyObject *args) {
|
||||
PyThreadState *t;
|
||||
int rc;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s|z:addrcpt", &rcpt, ¶ms)) return NULL;
|
||||
if (!PyArg_ParseTuple(args, "s|z:addrcpt", &rcpt)) return NULL;
|
||||
ctx = _find_context(self);
|
||||
if (ctx == NULL) return NULL;
|
||||
t = PyEval_SaveThread();
|
||||
@@ -1152,8 +1146,8 @@ milter_replacebody(PyObject *self, PyObject *args) {
|
||||
ctx = _find_context(self);
|
||||
if (ctx == NULL) return NULL;
|
||||
t = PyEval_SaveThread();
|
||||
return _thread_return(t,smfi_replacebody(ctx,
|
||||
(unsigned char *)bodyp, bodylen), "cannot replace message body");
|
||||
return _thread_return(t,smfi_replacebody(ctx, bodyp, bodylen),
|
||||
"cannot replace message body");
|
||||
}
|
||||
|
||||
static char milter_setpriv__doc__[] =
|
||||
|
||||
+38
-63
@@ -1,33 +1,23 @@
|
||||
# EL 3,4,5 supported, set to 0 for Fedora
|
||||
|
||||
%if 0%{?el3} || 0%{?el4}
|
||||
%define __python python2.4
|
||||
%endif
|
||||
|
||||
%define version 0.9.0
|
||||
%define release 1.el4
|
||||
%define libdir %{_libdir}/pymilter
|
||||
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
|
||||
%define pythonbase %(basename %{__python})
|
||||
%define name pymilter
|
||||
%define redhat7 0
|
||||
|
||||
Summary: Python interface to sendmail milter API
|
||||
Name: pymilter
|
||||
Version: 0.9.1
|
||||
Release: 1%{dist}
|
||||
Source: http://downloads.sourceforge.net/pymilter/%{name}-%{version}.tar.gz
|
||||
Patch: %{name}-smutil.patch
|
||||
Patch1: %{name}-start.patch
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
#Patch: %{name}-%{version}.patch
|
||||
License: GPLv2+
|
||||
Group: Development/Libraries
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
|
||||
BuildRoot: %{_tmppath}/%{name}-buildroot
|
||||
Vendor: Stuart D. Gathman <stuart@bmsi.com>
|
||||
Url: http://www.bmsi.com/python/milter.html
|
||||
Requires: %{pythonbase} >= 2.4, sendmail >= 8.13
|
||||
%if 0%{?el3} || 0%{?el4}
|
||||
# Need python2.4 specific pydns, not the version for system python
|
||||
Requires: pydns
|
||||
%else
|
||||
# Needed for callbacks, not a core function but highly useful for milters
|
||||
Requires: python-pydns
|
||||
%endif
|
||||
BuildRequires: ed, %{pythonbase}-devel >= 2.4, sendmail-devel >= 8.13
|
||||
Requires: %{__python} >= 2.4, sendmail >= 8.13
|
||||
BuildRequires: %{__python}-devel >= 2.4, sendmail-devel >= 8.13
|
||||
|
||||
%description
|
||||
This is a python extension module to enable python scripts to
|
||||
@@ -37,32 +27,30 @@ DSNs, and doing CBV.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch -p0 -b .smutil
|
||||
%patch1 -p0 -b .start
|
||||
#patch -p0 -b .bms
|
||||
|
||||
%build
|
||||
env CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
||||
%if %{redhat7}
|
||||
LDFLAGS="-s"
|
||||
%else # Redhat builds debug packages after 7.3
|
||||
LDFLAGS="-g"
|
||||
%endif
|
||||
env CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$LDFLAGS" %{__python} setup.py build
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%{__python} setup.py install --root=$RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/milter
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/milter
|
||||
%{__python} setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
|
||||
mkdir -p $RPM_BUILD_ROOT/var/run/milter
|
||||
mkdir -p $RPM_BUILD_ROOT%{libdir}
|
||||
%ifos aix4.1
|
||||
cat >$RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
|
||||
#!/bin/sh
|
||||
cd /var/log/milter
|
||||
exec /usr/local/bin/python bms.py >>milter.log 2>&1
|
||||
EOF
|
||||
%else # not aix4.1
|
||||
cp start.sh $RPM_BUILD_ROOT%{libdir}
|
||||
ed $RPM_BUILD_ROOT%{libdir}/start.sh <<'EOF'
|
||||
/^datadir=/
|
||||
c
|
||||
datadir="%{_localstatedir}/log/milter"
|
||||
.
|
||||
/^piddir=/
|
||||
c
|
||||
piddir="%{_localstatedir}/run/milter"
|
||||
.
|
||||
/^libdir=/
|
||||
c
|
||||
libdir="%{libdir}"
|
||||
.
|
||||
/^python=/
|
||||
c
|
||||
python="%{__python}"
|
||||
@@ -70,56 +58,43 @@ python="%{__python}"
|
||||
w
|
||||
q
|
||||
EOF
|
||||
%endif
|
||||
chmod a+x $RPM_BUILD_ROOT%{libdir}/start.sh
|
||||
%if !%{redhat7}
|
||||
#grep '.pyc$' INSTALLED_FILES | sed -e 's/c$/o/' >>INSTALLED_FILES
|
||||
%endif
|
||||
|
||||
# start.sh is used by spfmilter and milter, and could be used by
|
||||
# other milters using pymilter.
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
# other milters running on redhat
|
||||
%files -f INSTALLED_FILES
|
||||
%defattr(-,root,root)
|
||||
%doc README ChangeLog NEWS TODO CREDITS sample.py milter-template.py
|
||||
%{python_sitearch}/*
|
||||
%{libdir}
|
||||
%dir %attr(0755,mail,mail) %{_localstatedir}/run/milter
|
||||
%dir %attr(0755,mail,mail) %{_localstatedir}/log/milter
|
||||
%config %{libdir}/start.sh
|
||||
%dir %attr(0755,mail,mail) /var/run/milter
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
* Wed Jan 07 2009 Stuart Gathman <stuart@bmsi.com> 0.9.0-4
|
||||
- Stop using INSTALLED_FILES to make Fedora happy
|
||||
- Remove config flag from start.sh glue
|
||||
- Own /var/log/milter
|
||||
- Use _localstatedir
|
||||
|
||||
* Wed Jan 07 2009 Stuart Gathman <stuart@bmsi.com> 0.9.0-2
|
||||
- Changes to meet Fedora standards
|
||||
|
||||
* Mon Nov 24 2008 Stuart Gathman <stuart@bmsi.com> 0.9.0-1
|
||||
- Split pymilter into its own CVS module
|
||||
- Support chgfrom and addrcpt_par
|
||||
- Support NS records in Milter.dns
|
||||
|
||||
* Mon Aug 25 2008 Stuart Gathman <stuart@bmsi.com> 0.8.10-2
|
||||
- /var/run/milter directory must be owned by mail
|
||||
|
||||
* Mon Aug 25 2008 Stuart Gathman <stuart@bmsi.com> 0.8.10-1
|
||||
- improved parsing into email and fullname (still 2 self test failures)
|
||||
- implement no-DSN CBV, reduce full DSNs
|
||||
|
||||
* Mon Sep 24 2007 Stuart Gathman <stuart@bmsi.com> 0.8.9-1
|
||||
- Use ifarch hack to build milter and milter-spf packages as noarch
|
||||
- Remove spf dependency from dsn.py, add dns.py
|
||||
|
||||
* Fri Jan 05 2007 Stuart Gathman <stuart@bmsi.com> 0.8.8-1
|
||||
- move AddrCache, parse_addr, iniplist to Milter package
|
||||
- move parse_header to Milter.utils
|
||||
- fix plock for missing source and can't change owner/group
|
||||
- split out pymilter and pymilter-spf packages
|
||||
- move milter apps to /usr/lib/pymilter
|
||||
|
||||
* Sat Nov 04 2006 Stuart Gathman <stuart@bmsi.com> 0.8.7-1
|
||||
- SPF moved to pyspf RPM
|
||||
|
||||
* Tue May 23 2006 Stuart Gathman <stuart@bmsi.com> 0.8.6-2
|
||||
- Support CBV timeout
|
||||
|
||||
@@ -2,11 +2,10 @@ import os
|
||||
import sys
|
||||
from distutils.core import setup, Extension
|
||||
|
||||
# FIXME: on some versions of sendmail, smutil is renamed to sm.
|
||||
# On slackware and debian, leave it out entirely. It depends
|
||||
# FIXME: on some versions of sendmail, smutil is renamed to sm
|
||||
# on slackware and debian, leave it out entirely. It depends
|
||||
# on how libmilter was built by the sendmail package.
|
||||
#libs = ["milter", "smutil"]
|
||||
libs = ["milter"]
|
||||
libs = ["milter", "smutil"]
|
||||
libdirs = ["/usr/lib/libmilter"] # needed for Debian
|
||||
|
||||
# patch distutils if it can't cope with the "classifiers" or
|
||||
@@ -17,7 +16,7 @@ if sys.version < '2.2.3':
|
||||
DistributionMetadata.download_url = None
|
||||
|
||||
# NOTE: importing Milter to obtain version fails when milter.so not built
|
||||
setup(name = "pymilter", version = '0.9.1',
|
||||
setup(name = "pymilter", version = '0.9.0',
|
||||
description="Python interface to sendmail milter API",
|
||||
long_description="""\
|
||||
This is a python extension module to enable python scripts to
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
#!/bin/sh
|
||||
appname="$1"
|
||||
script="${2:-${appname}}"
|
||||
datadir="/var/log/milter"
|
||||
piddir="/var/run/milter"
|
||||
libdir="/usr/lib/pymilter"
|
||||
datadir=/var/log/milter
|
||||
python="python2.4"
|
||||
exec >>${datadir}/${appname}.log 2>&1
|
||||
if test -s ${datadir}/${script}.py; then
|
||||
cd ${datadir} # use version in log dir if it exists for debugging
|
||||
else
|
||||
cd ${libdir}
|
||||
cd /usr/lib/pymilter
|
||||
fi
|
||||
|
||||
${python} ${script}.py &
|
||||
echo $! >${piddir}/${appname}.pid
|
||||
echo $! >/var/run/milter/${appname}.pid
|
||||
|
||||
Reference in New Issue
Block a user