Skip to main content
Sign in
Snippets Groups Projects
Commit d2253848 authored by Stuart Gathman's avatar Stuart Gathman
Browse files

Create milter and milter-spf as noarch packages.

parent a84f6aa5
No related branches found
No related tags found
No related merge requests found
Don't match dynamic ptr in bestguess. Convert DSN to REJECT unless sender gets SPF pass or best guess pass. Make
configurable by SPF result with NOTSPAM policy (reject or deliver without DSN).
Maybe policy should be NODSN - still verify sender with CBV.
When content filtering is not installed, reject BLACKLISTed MFROM When content filtering is not installed, reject BLACKLISTed MFROM
immediately. There is no use waiting until EOM. immediately. There is no use waiting until EOM.
...@@ -224,3 +226,4 @@ data structure as autowhitelist.log. ...@@ -224,3 +226,4 @@ data structure as autowhitelist.log.
DONE Backup copies for outgoing/incoming mail. DONE Backup copies for outgoing/incoming mail.
DONE Don't match dynamic ptr in bestguess.
...@@ -23,7 +23,7 @@ pidof() { ...@@ -23,7 +23,7 @@ pidof() {
# Source function library. # Source function library.
. /etc/rc.d/init.d/functions . /etc/rc.d/init.d/functions
[ -x /var/log/milter/start.sh ] || exit 0 [ -x /usr/lib/pymilter/start.sh ] || exit 0
RETVAL=0 RETVAL=0
prog="milter" prog="milter"
...@@ -36,7 +36,7 @@ start() { ...@@ -36,7 +36,7 @@ start() {
mkdir -p /var/run/milter mkdir -p /var/run/milter
chown mail:mail /var/run/milter chown mail:mail /var/run/milter
fi fi
daemon --check milter --user mail /var/log/milter/start.sh milter bms daemon --check milter --user mail /usr/lib/pymilter/start.sh milter bms
RETVAL=$? RETVAL=$?
echo echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/milter [ $RETVAL -eq 0 ] && touch /var/lock/subsys/milter
... ...
......
%define name pymilter %define version 0.8.9
%define version 0.8.8
%define release 1 %define release 1
# what version of RH are we building for? # what version of RH are we building for?
%define redhat7 0 %define redhat7 1
# Options for Redhat version 6.x: # Options for Redhat version 6.x:
# rpm -ba|--rebuild --define "rh7 1" # rpm -ba|--rebuild --define "rh7 1"
...@@ -19,7 +18,7 @@ ...@@ -19,7 +18,7 @@
%endif %endif
# RH9, other systems (single ps line per process) # RH9, other systems (single ps line per process)
%ifos Linux %ifos Linux
%define python python %define python python2.4
%else %else
%define python python %define python python
%endif %endif
...@@ -29,11 +28,17 @@ ...@@ -29,11 +28,17 @@
%define libdir /usr/lib/pymilter %define libdir /usr/lib/pymilter
%endif %endif
Summary: Python interface to sendmail milter API # This spec file contains 2 noarch packages in addition to the pymilter
Name: %{name} # module. To compile all three, use:
# rpmbuild -ba --target=i386,noarch pymilter.spec
%ifarch noarch
Name: milter
Group: Applications/System
Summary: BMS spam and reputation milter
Version: %{version} Version: %{version}
Release: %{release} Release: %{release}
Source: %{name}-%{version}.tar.gz Source: pymilter-%{version}.tar.gz
#Patch: %{name}-%{version}.patch #Patch: %{name}-%{version}.patch
License: GPL License: GPL
Group: Development/Libraries Group: Development/Libraries
...@@ -42,22 +47,10 @@ Prefix: %{_prefix} ...@@ -42,22 +47,10 @@ Prefix: %{_prefix}
Vendor: Stuart D. Gathman <stuart@bmsi.com> Vendor: Stuart D. Gathman <stuart@bmsi.com>
Packager: Stuart D. Gathman <stuart@bmsi.com> Packager: Stuart D. Gathman <stuart@bmsi.com>
Url: http://www.bmsi.com/python/milter.html Url: http://www.bmsi.com/python/milter.html
Requires: %{python} >= 2.4, sendmail >= 8.13 Requires: %{python} >= 2.4, pyspf >= 2.0.4, pymilter
%ifos Linux %ifos Linux
Requires: chkconfig Requires: chkconfig
%endif %endif
BuildRequires: %{python}-devel >= 2.4, sendmail-devel >= 8.13
%description
This is a python extension module to enable python scripts to
attach to sendmail's libmilter functionality. Additional python
modules provide for navigating and modifying MIME parts, sending
DSNs, and doing CBV.
%package -n milter
Group: Applications/System
Summary: BMS spam and reputation milter
Requires: pyspf >= 2.0.4
%description -n milter %description -n milter
A complex but effective spam filtering, SPF checking, and reputation tracking A complex but effective spam filtering, SPF checking, and reputation tracking
...@@ -66,28 +59,18 @@ mail application. It uses pydspam if installed for bayesian filtering. ...@@ -66,28 +59,18 @@ mail application. It uses pydspam if installed for bayesian filtering.
%package spf %package spf
Group: Applications/System Group: Applications/System
Summary: BMS spam and reputation milter Summary: BMS spam and reputation milter
Requires: pyspf >= 2.0.4 Requires: pyspf >= 2.0.4, pymilter
%description spf %description spf
A simple mail filter to add Received-SPF headers and reject forged mail. A simple mail filter to add Received-SPF headers and reject forged mail.
Rejection policy is configured via sendmail access file. Rejection policy is configured via sendmail access file.
%prep %prep
%setup %setup -n pymilter-%{version}
#patch -p0 -b .bms #patch -p0 -b .bms
%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 %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%{python} setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
grep '.pyc$' INSTALLED_FILES | sed -e 's/c$/o/' >>INSTALLED_FILES
mkdir -p $RPM_BUILD_ROOT/var/log/milter mkdir -p $RPM_BUILD_ROOT/var/log/milter
mkdir -p $RPM_BUILD_ROOT/etc/mail mkdir -p $RPM_BUILD_ROOT/etc/mail
mkdir $RPM_BUILD_ROOT/var/log/milter/save mkdir $RPM_BUILD_ROOT/var/log/milter/save
...@@ -198,16 +181,9 @@ if [ $1 = 0 ]; then ...@@ -198,16 +181,9 @@ if [ $1 = 0 ]; then
fi fi
%endif %endif
%clean %files
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root) %defattr(-,root,root)
%doc README HOWTO ChangeLog NEWS TODO CREDITS sample.py milter-template.py
%config %{libdir}/start.sh %config %{libdir}/start.sh
%files -n milter
%defattr(-,root,root)
/etc/logrotate.d/milter /etc/logrotate.d/milter
/etc/cron.daily/milter /etc/cron.daily/milter
%ifos aix4.1 %ifos aix4.1
...@@ -219,7 +195,9 @@ rm -rf $RPM_BUILD_ROOT ...@@ -219,7 +195,9 @@ rm -rf $RPM_BUILD_ROOT
%dir /var/log/milter %dir /var/log/milter
%dir /var/log/milter/save %dir /var/log/milter/save
%config %{libdir}/bms.py %config %{libdir}/bms.py
%if !%{redhat7}
%{libdir}/bms.py? %{libdir}/bms.py?
%endif
%config(noreplace) /var/log/milter/strike3.txt %config(noreplace) /var/log/milter/strike3.txt
%config(noreplace) /var/log/milter/softfail.txt %config(noreplace) /var/log/milter/softfail.txt
%config(noreplace) /var/log/milter/fail.txt %config(noreplace) /var/log/milter/fail.txt
...@@ -236,7 +214,62 @@ rm -rf $RPM_BUILD_ROOT ...@@ -236,7 +214,62 @@ rm -rf $RPM_BUILD_ROOT
%config(noreplace) /etc/mail/spfmilter.cfg %config(noreplace) /etc/mail/spfmilter.cfg
/etc/rc.d/init.d/spfmilter /etc/rc.d/init.d/spfmilter
%else # not noarch
%define name pymilter
Summary: Python interface to sendmail milter API
Name: %{name}
Version: %{version}
Release: %{release}
Source: %{name}-%{version}.tar.gz
#Patch: %{name}-%{version}.patch
License: GPL
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{_prefix}
Vendor: Stuart D. Gathman <stuart@bmsi.com>
Packager: Stuart D. Gathman <stuart@bmsi.com>
Url: http://www.bmsi.com/python/milter.html
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
attach to sendmail's libmilter functionality. Additional python
modules provide for navigating and modifying MIME parts, sending
DSNs, and doing CBV.
%prep
%setup
#patch -p0 -b .bms
%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 --record=INSTALLED_FILES
%if !%{redhat7}
grep '.pyc$' INSTALLED_FILES | sed -e 's/c$/o/' >>INSTALLED_FILES
%endif
%files -f INSTALLED_FILES
%defattr(-,root,root)
%doc README HOWTO ChangeLog NEWS TODO CREDITS sample.py milter-template.py
%endif # noarch
%clean
rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* 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
* Fri Jan 05 2007 Stuart Gathman <stuart@bmsi.com> 0.8.8-1 * Fri Jan 05 2007 Stuart Gathman <stuart@bmsi.com> 0.8.8-1
- move AddrCache, parse_addr, iniplist to Milter package - move AddrCache, parse_addr, iniplist to Milter package
- move parse_header to Milter.utils - move parse_header to Milter.utils
... ...
......
...@@ -12,5 +12,5 @@ fi ...@@ -12,5 +12,5 @@ fi
cd /var/log/milter cd /var/log/milter
exec >>${appname}.log 2>&1 exec >>${appname}.log 2>&1
${python} ${appname}.py & ${python} ${script}.py &
echo $! >/var/run/milter/${appname}.pid echo $! >/var/run/milter/${appname}.pid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment